MCPcopy Create free account
hub / github.com/Xenov-X/csbot / executeTokenStoreRemove

Method executeTokenStoreRemove

workflow/executor_credentials.go:197–219  ·  view source on GitHub ↗

executeTokenStoreRemove removes a specific token from the token store

(ctx context.Context, client *csclient.Client, beaconID string, action Action)

Source from the content-addressed store, hash-verified

195
196// executeTokenStoreRemove removes a specific token from the token store
197func (e *Executor) executeTokenStoreRemove(ctx context.Context, client *csclient.Client, beaconID string, action Action) (string, error) {
198 idVal, ok := action.Parameters["id"]
199 if !ok {
200 return "", fmt.Errorf("id parameter required for token_store_remove")
201 }
202
203 var id int
204 switch v := idVal.(type) {
205 case float64:
206 id = int(v)
207 case int:
208 id = v
209 default:
210 return "", fmt.Errorf("id parameter must be a number")
211 }
212
213 resp, err := client.TokenStoreRemove(ctx, beaconID, id)
214 if err != nil {
215 return "", err
216 }
217
218 return e.fireAndForget(resp.TaskID, fmt.Sprintf("token store remove %d", id))
219}
220
221// executeTokenStoreRemoveAll removes all tokens from the token store
222func (e *Executor) executeTokenStoreRemoveAll(ctx context.Context, client *csclient.Client, beaconID string) (string, error) {

Callers 1

executeActionMethod · 0.95

Calls 1

fireAndForgetMethod · 0.95

Tested by

no test coverage detected