ibmiam

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL