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

Method executeMakeToken

workflow/executor_credentials.go:38–55  ·  view source on GitHub ↗

executeMakeToken creates a token from specified credentials using domain/user/password

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

Source from the content-addressed store, hash-verified

36
37// executeMakeToken creates a token from specified credentials using domain/user/password
38func (e *Executor) executeMakeToken(ctx context.Context, client *csclient.Client, beaconID string, action Action) (string, error) {
39 domain, _ := action.Parameters["domain"].(string)
40 user, ok := action.Parameters["user"].(string)
41 if !ok {
42 return "", fmt.Errorf("user parameter required for make_token")
43 }
44 password, ok := action.Parameters["password"].(string)
45 if !ok {
46 return "", fmt.Errorf("password parameter required for make_token")
47 }
48
49 resp, err := client.MakeToken(ctx, beaconID, domain, user, password)
50 if err != nil {
51 return "", err
52 }
53
54 return e.waitForOutput(ctx, client, resp.TaskID)
55}
56
57// executeMakeTokenUpn creates a token from specified credentials using UPN
58func (e *Executor) executeMakeTokenUpn(ctx context.Context, client *csclient.Client, beaconID string, action Action) (string, error) {

Callers 1

executeActionMethod · 0.95

Calls 1

waitForOutputMethod · 0.95

Tested by

no test coverage detected