| 25 | } |
| 26 | |
| 27 | func WithAzureInstanceIdentity(opts ...InstanceIdentityOption) SessionTokenSetup { |
| 28 | cfg := applyInstanceIdentityOptions(opts) |
| 29 | return func(client *codersdk.Client) RefreshableSessionTokenProvider { |
| 30 | return &InstanceIdentitySessionTokenProvider{ |
| 31 | TokenExchanger: &AzureSessionTokenExchanger{client: client, agentName: cfg.AgentName}, |
| 32 | } |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | // AuthWorkspaceAzureInstanceIdentity uses the Azure Instance Metadata Service to |
| 37 | // fetch a signed payload, and exchange it for a session token for a workspace agent. |