ibmiam

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2024 License: Apache-2.0 Imports: 10 Imported by: 41

Documentation

Index

Constants

View Source
const CustomInitFuncProviderName = "CustomInitFuncProviderIBM"

CustomInitFuncProviderName the Name of the IBM IAM provider with a custom init function

View Source
const EnvProviderName = "EnvProviderIBM"

EnvProviderName name of the IBM IAM provider that loads IAM credentials from environment variables

View Source
const EnvProviderTrustedProfileName = "EnvProviderTrustedProfileIBM"

EnvProviderName name of the IBM IAM provider that loads IAM trusted profile credentials from environment variables

View Source
const (
	// SharedConfProviderName of the IBM IAM provider that loads IAM credentials
	// from shared config
	SharedConfProviderName = "SharedConfigProviderIBM"
)
View Source
const (
	// SharedCredsProviderName name of the IBM IAM provider that loads IAM credentials
	// from shared credentials file
	SharedCredsProviderName = "SharedCredentialsProviderIBM"
)
View Source
const StaticProviderName = "StaticProviderIBM"

StaticProviderName name of the IBM IAM provider that uses IAM details passed directly

Variables

This section is empty.

Functions

func CheckForConflictingIamCredentials added in v1.11.0

func CheckForConflictingIamCredentials() error

Helper function to check whether both api-key and trusted-profile-id are set in environment variables.

Returns:

Error if both apiKey and trustedProfileID are set, nil if only either of them is set.

func NewConfigCredentials

func NewConfigCredentials(config *aws.Config, filename, profilename string) *credentials.Credentials

NewConfigCredentials Constructor

func NewCustomInitFuncCredentials

func NewCustomInitFuncCredentials(config *aws.Config, initFunc func() (*token.Token, error), authEndPoint,
	serviceInstanceID string) *credentials.Credentials

NewCustomInitFuncCredentials costructor

func NewEnvCredentials

func NewEnvCredentials(config *aws.Config) *credentials.Credentials

NewEnvCredentials Constructor

func NewEnvCredentialsTrustedProfile added in v1.11.0

func NewEnvCredentialsTrustedProfile(config *aws.Config) *credentials.Credentials

NewEnvCredentials Constructor

func NewSharedCredentials

func NewSharedCredentials(config *aws.Config, filename, profilename string) *credentials.Credentials

NewSharedCredentials constructor for IBM IAM that uses IAM credentials passed in Returns:

credentials.NewCredentials(newSharedCredentialsProvider()) (AWS type)

func NewStaticCredentials

func NewStaticCredentials(config *aws.Config, authEndPoint, apiKey, serviceInstanceID string) *credentials.Credentials

NewStaticCredentials constructor for IBM IAM that uses IAM credentials passed in Returns: credentials.NewCredentials(newStaticProvider()) (AWS type)

func NewTrustedProfileCredentialsCR added in v1.11.0

func NewTrustedProfileCredentialsCR(config *aws.Config, authEndPoint string, trustedProfileID string, crTokenFilePath string, serviceInstanceID string) *credentials.Credentials

NewTrustedProfileCredentials constructor for IBM IAM that uses IAM trusted-profile credentials passed Returns: credentials.NewCredentials(newTrustedProfileProvider()) (AWS type)

Types

type Provider

type Provider struct {

	// Error
	ErrorStatus error
	// contains filtered or unexported fields
}

Provider Struct

func NewCustomInitFuncProvider

func NewCustomInitFuncProvider(config *aws.Config, initFunc func() (*token.Token, error), authEndPoint,
	serviceInstanceID string, client tokenmanager.IBMClientDo) *Provider

NewCustomInitFuncProvider constructor of IBM IAM Provider with a custom init Function Parameters:

aws.config: AWS Config to provide service configuration for service clients. By default,
	all clients will use the defaults.DefaultConfig structure.
initFunc token: Contents of the token
authEndPoint: IAM Authentication Server end point
serviceInstanceID: service instance ID of the IBM account
client: Token Management's client

Returns:

A complete Provider with Token Manager initialized

func NewEnvProvider

func NewEnvProvider(config *aws.Config) *Provider

NewEnvProvider constructor of the IBM IAM provider that loads IAM credentials from environment variables Parameter:

AWS Config

Returns:

A new provider with AWS config, API Key, IBM IAM Authentication Server Endpoint and
Service Instance ID

func NewProvider

func NewProvider(providerName string, config *aws.Config, apiKey, authEndPoint, serviceInstanceID string,
	client tokenmanager.IBMClientDo) (provider *Provider)

NewProvider allows the creation of a custom IBM IAM Provider Parameters:

Provider Name
AWS Config
API Key
IBM IAM Authentication Server Endpoint
Service Instance ID
Token Manager client

Returns:

Provider

func NewSharedConfigProvider

func NewSharedConfigProvider(config *aws.Config, filename, profilename string) *Provider

NewSharedConfigProvider constructor of the IBM IAM provider that loads IAM Credentials from shared config Parameters:

AWS Config
Profile filename
Profile name

Returns:

Common Ini Provider with values

func NewSharedCredentialsProvider

func NewSharedCredentialsProvider(config *aws.Config, filename, profilename string) *Provider

NewSharedCredentialsProvider constructor of the IBM IAM provider that loads IAM credentials from shared credentials file Parameters:

AWS Config
Profile filename
Profile prefix

Returns:

Common initial provider with config file/profile

func NewStaticProvider

func NewStaticProvider(config *aws.Config, authEndPoint, apiKey, serviceInstanceID string) *Provider

NewStaticProvider constructor of the IBM IAM provider that uses IAM details passed directly Returns: New Provider (AWS type)

func (*Provider) IsExpired

func (p *Provider) IsExpired() bool

IsExpired ...

Provider expired or not - boolean

func (*Provider) IsValid

func (p *Provider) IsValid() bool

IsValid ... Returns:

Provider validation - boolean

func (*Provider) Retrieve

func (p *Provider) Retrieve() (credentials.Value, error)

Retrieve ... Returns:

Credential values
Error

type ResourceType added in v1.11.0

type ResourceType string
const (
	TrustedProfileProviderName              = "TrustedProfileProviderIBM"
	ResourceComputeResource    ResourceType = "CR"
)

TrustedProfileProviderName name of the IBM IAM provider that uses IAM trusted-profile details passed directly

type TrustedProfileProvider added in v1.11.0

type TrustedProfileProvider struct {

	// Error
	ErrorStatus error
	// contains filtered or unexported fields
}

Provider Struct

func NewEnvProviderTrustedProfile added in v1.11.0

func NewEnvProviderTrustedProfile(config *aws.Config) *TrustedProfileProvider

NewEnvProvider constructor of the IBM IAM provider that loads IAM trusted profile credentials from environment variables Parameter:

AWS Config

Returns:

A new provider with AWS config, Trusted Profile ID, CR token file path, IBM IAM Authentication Server Endpoint and
Service Instance ID

func NewTrustedProfileProvider added in v1.11.0

func NewTrustedProfileProvider(providerName string, config *aws.Config, authEndPoint string, trustedProfileID string, crTokenFilePath string,
	serviceInstanceID string, resourceType string) (provider *TrustedProfileProvider)

NewTrustedProfileProvider allows the creation of a custom IBM IAM Trusted Profile Provider Parameters:

Provider Name
AWS Config
Trusted Profile ID
CR token file path
IBM IAM Authentication Server Endpoint
Service Instance ID
Resource type

Returns:

TrustedProfileProvider

func NewTrustedProfileProviderCR added in v1.11.0

func NewTrustedProfileProviderCR(config *aws.Config, authEndPoint string, trustedProfileID string, crTokenFilePath string, serviceInstanceID string) *TrustedProfileProvider

NewTrustedProfileProviderWithCR constructor of the IBM IAM provider that uses IAM trusted-profile details passed Returns: New TrustedProfileProvider (AWS type)

func (*TrustedProfileProvider) IsExpired added in v1.11.0

func (p *TrustedProfileProvider) IsExpired() bool

IsExpired ...

TrustedProfileProvider expired or not - boolean

func (*TrustedProfileProvider) IsValid added in v1.11.0

func (p *TrustedProfileProvider) IsValid() bool

IsValid ... Returns:

TrustedProfileProvider validation - boolean

func (*TrustedProfileProvider) Retrieve added in v1.11.0

func (p *TrustedProfileProvider) Retrieve() (credentials.Value, error)

Retrieve ... Returns:

Credential values
Error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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