MCPcopy
hub / github.com/minio/minio-go / NewSTSClientGrants

Function NewSTSClientGrants

pkg/credentials/sts_client_grants.go:93–101  ·  view source on GitHub ↗

NewSTSClientGrants returns a pointer to a new Credentials object wrapping the STSClientGrants.

(stsEndpoint string, getClientGrantsTokenExpiry func() (*ClientGrantsToken, error))

Source from the content-addressed store, hash-verified

91// NewSTSClientGrants returns a pointer to a new
92// Credentials object wrapping the STSClientGrants.
93func NewSTSClientGrants(stsEndpoint string, getClientGrantsTokenExpiry func() (*ClientGrantsToken, error)) (*Credentials, error) {
94 if getClientGrantsTokenExpiry == nil {
95 return nil, errors.New("Client grants access token and expiry retrieval function should be defined")
96 }
97 return New(&STSClientGrants{
98 STSEndpoint: stsEndpoint,
99 GetClientGrantsTokenExpiry: getClientGrantsTokenExpiry,
100 }), nil
101}
102
103func getClientGrantsCredentials(clnt *http.Client, endpoint string,
104 getClientGrantsTokenExpiry func() (*ClientGrantsToken, error),

Callers

nothing calls this directly

Calls 1

NewFunction · 0.70

Tested by

no test coverage detected