Documentation
¶
Index ¶
- Constants
- func Authenticator(apiKey string, options ...AuthenticatorOption) (authentication.Authenticator, error)
- type AuthenticatorOption
- func WithHTTPClient(c *http.Client) AuthenticatorOption
- func WithIAMEndpoint(iamEndpoint string) AuthenticatorOption
- func WithIBMInstanceID(ibmInstanceID string) AuthenticatorOption
- func WithRefreshBeforeDuration(duration time.Duration) AuthenticatorOption
- func WithSysdigTeamID(sysdigTeamID string) AuthenticatorOption
Constants ¶
const ( // DefaultIAMEndpoint is the default production IAM endpoint for IBM Cloud. DefaultIAMEndpoint = "https://iam.cloud.ibm.com/identity/token" // TestIAMEndpoint is the test IAM endpoint for IBM Cloud. TestIAMEndpoint = "https://iam.test.cloud.ibm.com/identity/token" // DefaultRefreshBeforeExpirationDuration is the default duration before expected expiration to refresh the IAM token. DefaultRefreshBeforeExpirationDuration = 5 * time.Minute )
Variables ¶
This section is empty.
Functions ¶
func Authenticator ¶
func Authenticator(apiKey string, options ...AuthenticatorOption) (authentication.Authenticator, error)
Authenticator returns an authentication.Authenticator for IBM Cloud IAM.
Types ¶
type AuthenticatorOption ¶
type AuthenticatorOption func(*authenticator) error
AuthenticatorOption defines options for the IBM IAM authentication.Authenticator.
func WithHTTPClient ¶
func WithHTTPClient(c *http.Client) AuthenticatorOption
WithHTTPClient sets the http.Client to be used for IAM authentication.
func WithIAMEndpoint ¶
func WithIAMEndpoint(iamEndpoint string) AuthenticatorOption
WithIAMEndpoint sets the IAM endpoint to be used for IAM authentication.
func WithIBMInstanceID ¶
func WithIBMInstanceID(ibmInstanceID string) AuthenticatorOption
WithIBMInstanceID sets the instance ID to be set for IBM Sysdig requests. See: https://cloud.ibm.com/docs/monitoring?topic=monitoring-mon-curl#mon-curl-headers-iam
func WithRefreshBeforeDuration ¶
func WithRefreshBeforeDuration(duration time.Duration) AuthenticatorOption
WithRefreshBeforeDuration sets the duration before expiration to trigger a token refresh.
func WithSysdigTeamID ¶
func WithSysdigTeamID(sysdigTeamID string) AuthenticatorOption
WithSysdigTeamID sets the TeamID to be set for IBM Sysdig requests. May not be required. TODO: check if this is still required. See: https://cloud.ibm.com/docs/monitoring?topic=monitoring-team_id