Skip to content

Commit ab17f13

Browse files
committed
Update OAuth config for ambient credentials
1 parent f24a8f9 commit ab17f13

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

internal/command/command.go

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -232,19 +232,12 @@ func newServerConfig(ctx context.Context, config *Config) (*auth_providers.Serve
232232
return nil, err
233233
}
234234

235-
server = &auth_providers.Server{
236-
Host: config.Hostname,
237-
APIPath: config.APIPath,
238-
AccessToken: token,
239-
AuthType: "oauth",
240-
ClientID: "",
241-
ClientSecret: "",
242-
OAuthTokenUrl: "",
243-
Scopes: nil,
244-
Audience: "",
245-
SkipTLSVerify: false,
246-
CACertPath: "",
247-
}
235+
oauthConfig := auth_providers.NewOAuthAuthenticatorBuilder().
236+
WithAccessToken(token).
237+
WithCaCertificatePath("")
238+
oauthConfig.CommandAuthConfig = authConfig
239+
240+
server = oauthConfig.GetServerConfig()
248241
}
249242

250243
log.Info("Configuration was valid - Successfully generated server config", "authMethod", server.AuthType, "hostname", server.Host, "apiPath", server.APIPath)

0 commit comments

Comments
 (0)