executeMakeToken creates a token from specified credentials using domain/user/password
(ctx context.Context, client *csclient.Client, beaconID string, action Action)
| 36 | |
| 37 | // executeMakeToken creates a token from specified credentials using domain/user/password |
| 38 | func (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 |
| 58 | func (e *Executor) executeMakeTokenUpn(ctx context.Context, client *csclient.Client, beaconID string, action Action) (string, error) { |
no test coverage detected