Package: ibmiam

import "../ibm-cos-sdk-go/aws/credentials/ibmiam"

Sub-Packages

token, tokenmanager

Constants

const EnvProviderName = readonly

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

Value:

"EnvProviderIBM"
const StaticProviderName = readonly

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

Value:

"StaticProviderIBM"
const SharedConfProviderName = readonly

SharedConfProviderName of the IBM IAM provider that loads IAM credentials from shared config

Value:

"SharedConfigProviderIBM"
const TrustedProfileProviderName = readonly

Value:

"TrustedProfileProviderIBM"
const ResourceComputeResource ResourceType = readonly

Value:

"CR"
const ResourceServiceID ResourceType = readonly

Value:

"SID"
const CustomInitFuncProviderName = readonly

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

Value:

"CustomInitFuncProviderIBM"
const SharedCredsProviderName = readonly

SharedCredsProviderName name of the IBM IAM provider that loads IAM credentials from shared credentials file

Value:

"SharedCredentialsProviderIBM"
const EnvProviderTrustedProfileName = readonly

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

Value:

"EnvProviderTrustedProfileIBM"

Type Summary collapse

Function Summary collapse

Type Details

TrustedProfileConfig struct

TrustedProfileConfig has all the authentication parameters for trusted profile.

Structure Fields:

TrustedProfileName string
CrTokenFilePath string
TrustedProfileID string
IAMAccountID string
ServiceIDApiKey string

Function Details

func CheckForConflictingIamCredentials() error



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// File 'aws/credentials/ibmiam/iamcreds_file_utils.go', line 15

func CheckForConflictingIamCredentials() error { apiKey := os.Getenv("IBM_API_KEY_ID") trustedProfileID := os.Getenv("TRUSTED_PROFILE_ID") trustedProfileName := os.Getenv("TRUSTED_PROFILE_NAME") crTokenFilePath := os.Getenv("CR_TOKEN_FILE_PATH") serviceIdApiKey := os.Getenv("IBM_SERVICE_ID_API_KEY") if apiKey != "" && (trustedProfileID != "" || trustedProfileName != "") { return awserr.New("InvalidCredentials", `only one of ApiKey or TrustedProfile credentials should be set, not both.`, nil) } if trustedProfileName != "" && trustedProfileID != "" { return awserr.New("InvalidCredentials", `only one of TrustedProfileName or TrustedProfileID should be set, not both.`, nil) } if crTokenFilePath != "" && serviceIdApiKey != "" { return awserr.New("InvalidCredentials", `only one of ServiceIdApiKey or CrTokenFilePath should be set, not both.`, nil) } return nil }

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

NewConfigCredentials Constructor



70
71
72
// File 'aws/credentials/ibmiam/shared_config_provider.go', line 70

func NewConfigCredentials(config *aws.Config, filename, profilename string) *credentials.Credentials { return credentials.NewCredentials(NewSharedConfigProvider(config, filename, profilename)) }

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

NewEnvCredentials Constructor



32
33
34
// File 'aws/credentials/ibmiam/env_provider.go', line 32

func NewEnvCredentials(config *aws.Config) *credentials.Credentials { return credentials.NewCredentials(NewEnvProvider(config)) }

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

NewEnvCredentials Constructor



49
50
51
// File 'aws/credentials/ibmiam/env_provider_trusted_profile.go', line 49

func NewEnvCredentialsTrustedProfile(config *aws.Config) *credentials.Credentials { return credentials.NewCredentials(NewEnvProviderTrustedProfile(config)) }

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)


66
67
68
// File 'aws/credentials/ibmiam/shared_credentials_provider.go', line 66

func NewSharedCredentials(config *aws.Config, filename, profilename string) *credentials.Credentials { return credentials.NewCredentials(NewSharedCredentialsProvider(config, filename, profilename)) }

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)



18
19
20
// File 'aws/credentials/ibmiam/static_provider.go', line 18

func NewStaticCredentials(config *aws.Config, authEndPoint, apiKey, serviceInstanceID string) *credentials.Credentials { return credentials.NewCredentials(NewStaticProvider(config, authEndPoint, apiKey, serviceInstanceID)) }

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-id, crTokenFilePath credentials passed Returns: credentials.NewCredentials(newTrustedProfileProvider()) (AWS type)



34
35
36
// File 'aws/credentials/ibmiam/trusted_profile_provider.go', line 34

func NewTrustedProfileCredentialsCR(config *aws.Config, authEndPoint string, trustedProfileID string, crTokenFilePath string, serviceInstanceID string) *credentials.Credentials { return credentials.NewCredentials(NewTrustedProfileProviderCR(config, authEndPoint, trustedProfileID, crTokenFilePath, serviceInstanceID)) }

func NewTrustedProfileCredentialsServiceIDWithTrustedProfileId(config *aws.Config, authEndPoint string, trustedProfileID string, serviceIdApiKey string, serviceInstanceID string) *credentials.Credentials

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



55
56
57
// File 'aws/credentials/ibmiam/trusted_profile_provider.go', line 55

func NewTrustedProfileCredentialsServiceIDWithTrustedProfileId(config *aws.Config, authEndPoint string, trustedProfileID string, serviceIdApiKey string, serviceInstanceID string) *credentials.Credentials { return credentials.NewCredentials(NewTrustedProfileProviderServiceIdWithTrustedProfileId(config, authEndPoint, trustedProfileID, serviceIdApiKey, serviceInstanceID)) }

func NewTrustedProfileCredentialsServiceIDWithTrustedProfileName(config *aws.Config, authEndPoint string, trustedProfileName string, iamAccountId string, serviceIdApiKey string, serviceInstanceID string) *credentials.Credentials

NewTrustedProfileCredentials constructor for IBM IAM that uses IAM trusted-profile-id, serviceId-api-key

credentials passed Returns: credentials.NewCredentials(newTrustedProfileProvider()) (AWS type)



78
79
80
// File 'aws/credentials/ibmiam/trusted_profile_provider.go', line 78

func NewTrustedProfileCredentialsServiceIDWithTrustedProfileName(config *aws.Config, authEndPoint string, trustedProfileName string, iamAccountId string, serviceIdApiKey string, serviceInstanceID string) *credentials.Credentials { return credentials.NewCredentials(NewTrustedProfileProviderServiceIdWithTrustedProfileName(config, authEndPoint, trustedProfileName, iamAccountId, serviceIdApiKey, serviceInstanceID)) }