Documentation
¶
Index ¶
- type Account
- type AwsCredentials
- type Client
- type ClientMock
- type ConsolemeCredentialErrorMessageType
- type ConsolemeCredentialRequestType
- type ConsolemeCredentialResponseType
- type CredentialProcess
- type HTTPClient
- type RefreshableProvider
- type Time
- func (t Time) Add(d time.Duration) time.Time
- func (t Time) Format(layout string) string
- func (t Time) MarshalJSON() ([]byte, error)
- func (t Time) String() string
- func (t Time) Time() time.Time
- func (t Time) UTC() time.Time
- func (t Time) Unix() int64
- func (t *Time) UnmarshalJSON(s []byte) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AwsCredentials ¶
type AwsCredentials struct { AccessKeyId string `json:"AccessKeyId"` SecretAccessKey string `json:"SecretAccessKey"` SessionToken string `json:"SessionToken"` Expiration Time `json:"Expiration"` RoleArn string `json:"RoleArn"` }
func GetCredentials ¶
func GetCredentials(role string, ipRestrict bool, assumeRole []string) (*AwsCredentials, error)
GetCredentials requests credentials from ConsoleMe then follows the provided chain of roles to assume. Roles are assumed in the order in which they appear in the assumeRole slice.
func GetCredentialsC ¶
func GetCredentialsC(client *Client, role string, ipRestrict bool, assumeRole []string) (*AwsCredentials, error)
GetCredentialsC uses the provided Client to request credentials from ConsoleMe then follows the provided chain of roles to assume. Roles are assumed in the order in which they appear in the assumeRole slice.
type Client ¶
type Client struct { Httpc HTTPClient Host string }
Client represents a ConsoleMe client.
func GetTestClient ¶ added in v0.1.17
func NewClientWithJwtAuth ¶
func NewClientWithJwtAuth(hostname string, httpc HTTPClient) (*Client, error)
NewClientWithJwtAuth takes a ConsoleMe hostname and *http.Client, and returns a ConsoleMe client that will talk to that ConsoleMe instance
func NewClientWithMtls ¶
func NewClientWithMtls(hostname string, httpc HTTPClient) (*Client, error)
NewClientWithMtls takes a ConsoleMe hostname and *http.Client, and returns a ConsoleMe client that will talk to that ConsoleMe instance for AWS Credentials.
func (*Client) GetRoleCredentials ¶
func (c *Client) GetRoleCredentials(role string, ipRestrict bool) (*AwsCredentials, error)
type ClientMock ¶ added in v0.1.17
type ConsolemeCredentialResponseType ¶
type ConsolemeCredentialResponseType struct {
Credentials *AwsCredentials `json:"Credentials"`
}
type CredentialProcess ¶
type HTTPClient ¶
HTTPClient is the interface we expect HTTP clients to implement.
type RefreshableProvider ¶ added in v0.1.17
type RefreshableProvider struct { Expiration Time LastRefreshed Time Region string Role string RoleArn string NoIpRestrict bool AssumeChain []string // contains filtered or unexported fields }
func NewRefreshableProvider ¶ added in v0.1.17
func NewRefreshableProvider(client *Client, role, region string, assumeChain []string, noIpRestrict bool) (*RefreshableProvider, error)
NewRefreshableProvider creates an AWS credential provider that will automatically refresh credentials when they are close to expiring
func (*RefreshableProvider) AutoRefresh ¶ added in v0.1.17
func (rp *RefreshableProvider) AutoRefresh()
func (*RefreshableProvider) IsExpired ¶ added in v0.1.17
func (rp *RefreshableProvider) IsExpired() bool
IsExpired always returns false because we should never have expired credentials
func (*RefreshableProvider) Retrieve ¶ added in v0.1.17
func (rp *RefreshableProvider) Retrieve() (credentials.Value, error)
Retrieve returns the AWS credentials from the provider
type Time ¶ added in v0.1.17
func (Time) Format ¶ added in v0.1.17
Format returns t as a timestamp string with the provided layout.
func (Time) MarshalJSON ¶ added in v0.1.17
MarshalJSON is used to convert the timestamp to JSON
func (Time) Unix ¶ added in v0.1.17
Unix returns t as a Unix time, the number of seconds elapsed since January 1, 1970 UTC. The result does not depend on the location associated with t.
func (*Time) UnmarshalJSON ¶ added in v0.1.17
UnmarshalJSON is used to convert the timestamp from JSON