MCPcopy
hub / github.com/crowdsecurity/crowdsec / UpdateAllowlistMeta

Method UpdateAllowlistMeta

pkg/database/allowlists.go:207–216  ·  view source on GitHub ↗
(ctx context.Context, allowlistID string, name string, description string)

Source from the content-addressed store, hash-verified

205}
206
207func (c *Client) UpdateAllowlistMeta(ctx context.Context, allowlistID string, name string, description string) error {
208 c.Log.Debugf("updating allowlist %s meta", name)
209
210 err := c.Ent.AllowList.Update().Where(allowlist.AllowlistIDEQ(allowlistID)).SetName(name).SetDescription(description).Exec(ctx)
211 if err != nil {
212 return fmt.Errorf("unable to update allowlist: %w", err)
213 }
214
215 return nil
216}
217
218func (c *Client) ReplaceAllowlist(ctx context.Context, list *ent.AllowList, items []*models.AllowlistItem, fromConsole bool) (int, error) {
219 c.Log.Debugf("replacing values in allowlist %s", list.Name)

Callers 1

updateOneAllowlistMethod · 0.80

Calls 6

AllowlistIDEQFunction · 0.92
ExecMethod · 0.45
SetDescriptionMethod · 0.45
SetNameMethod · 0.45
WhereMethod · 0.45
UpdateMethod · 0.45

Tested by

no test coverage detected