MCPcopy Index your code
hub / github.com/coder/coder / WithGoogleInstanceIdentity

Function WithGoogleInstanceIdentity

codersdk/agentsdk/google.go:32–44  ·  view source on GitHub ↗
(serviceAccount string, gcpClient *metadata.Client, opts ...InstanceIdentityOption)

Source from the content-addressed store, hash-verified

30}
31
32func WithGoogleInstanceIdentity(serviceAccount string, gcpClient *metadata.Client, opts ...InstanceIdentityOption) SessionTokenSetup {
33 cfg := applyInstanceIdentityOptions(opts)
34 return func(client *codersdk.Client) RefreshableSessionTokenProvider {
35 return &InstanceIdentitySessionTokenProvider{
36 TokenExchanger: &GoogleSessionTokenExchanger{
37 client: client,
38 gcpClient: gcpClient,
39 serviceAccount: serviceAccount,
40 agentName: cfg.AgentName,
41 },
42 }
43 }
44}
45
46// exchange uses the Google Compute Engine Metadata API to fetch a signed JWT, and exchange it for a session token for a
47// workspace agent.

Calls 1