Package: endpointcreds

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

Overview

Package endpointcreds provides support for retrieving credentials from an arbitrary HTTP endpoint.

The credentials endpoint Provider can receive both static and refreshable credentials that will expire. Credentials are static when an “Expiration” value is not provided in the endpoint's response.

Static credentials will never expire once they have been retrieved. The format of the static credentials response:

{ "AccessKeyId" : "MUA...", "SecretAccessKey" : "/7PC5om....", }

Refreshable credentials will expire within the “ExpiryWindow” of the Expiration value in the response. The format of the refreshable credentials response:

{ "AccessKeyId" : "MUA...", "SecretAccessKey" : "/7PC5om....", "Token" : "AQoDY....=", "Expiration" : "2016-02-25T06:03:31Z" }

Errors should be returned in the following format and only returned with 400 or 500 HTTP status codes.

{ "code": "ErrorCode", "message": "Helpful error message." }

Constants

const ProviderName = readonly

ProviderName is the name of the credentials provider.

Value:

`CredentialsEndpointProvider`

Type Summary collapse

Function Summary collapse

Function Details

func NewCredentialsClient(cfg aws.Config, handlers request.Handlers, endpoint string, options ...func(*Provider)) *credentials.Credentials

NewCredentialsClient returns a pointer to a new Credentials object wrapping the endpoint credentials Provider.



105
106
107
// File 'aws/credentials/endpointcreds/provider.go', line 105

func NewCredentialsClient(cfg aws.Config, handlers request.Handlers, endpoint string, options ...func(*Provider)) *credentials.Credentials { return credentials.NewCredentials(NewProviderClient(cfg, handlers, endpoint, options...)) }

func NewProviderClient(cfg aws.Config, handlers request.Handlers, endpoint string, options ...func(*Provider)) credentials.Provider

NewProviderClient returns a credentials Provider for retrieving AWS credentials from arbitrary endpoint.



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
// File 'aws/credentials/endpointcreds/provider.go', line 79

func NewProviderClient(cfg aws.Config, handlers request.Handlers, endpoint string, options ...func(*Provider)) credentials.Provider { p := &Provider{ Client: client.New( cfg, metadata.ClientInfo{ ServiceName: "CredentialsEndpoint", Endpoint: endpoint, }, handlers, ), } p.Client.Handlers.Unmarshal.PushBack(unmarshalHandler) p.Client.Handlers.UnmarshalError.PushBack(unmarshalError) p.Client.Handlers.Validate.Clear() p.Client.Handlers.Validate.PushBack(validateEndpointHandler) for _, option := range options { option(p) } return p }