Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Login ¶
Login In general, this method just call the vault login path you specified here. We usually use this to login in local env for developers. e.g: loginPath: auth/mycompany-dev/login data: map[string]interface{}{"role_id": "developer"}
func LoginByAwsRoleArn ¶
LoginByAwsRoleArn A classic AWS credentials(AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY) is required for this function to execute AWS API to query the specific role. In general, you need to setup the AWS credential in env vars like this: _=os.Setenv("AWS_ACCESS_KEY_ID","AKKKAFYN9K3AUY74SNY39") _=os.Setenv("AWS_SECRET_ACCESS_KEY","ZTL9288NXdymfhxcISMOCU+AsYy9O3RsiDptABm8") Please note that you need to setup the trust configuration in AWS role console to make sure this credential have permission to query the awsRoleArn.
func LoginWithinAwsEcsContainerAutomatically ¶
LoginWithinAwsEcsContainerAutomatically If the aws ecs container is running under a specific aws assume role, and this role is configured on Vault server side, then this method will query the aws assume role's credential in ECS container automatically and return a Vault client with valid token. NO need any other classic AWS credentials(AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY)
Types ¶
type TokenManager ¶
type TokenManager struct {
// contains filtered or unexported fields
}
func NewTokenManager ¶
func NewTokenManager(ctx context.Context, client *vault.Client) *TokenManager
func (*TokenManager) MonitoringForToken ¶
func (tm *TokenManager) MonitoringForToken()