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

Function NewSTSWebIdentity

pkg/credentials/sts_web_identity.go:103–115  ·  view source on GitHub ↗

NewSTSWebIdentity returns a pointer to a new Credentials object wrapping the STSWebIdentity.

(stsEndpoint string, getWebIDTokenExpiry func() (*WebIdentityToken, error), opts ...func(*STSWebIdentity))

Source from the content-addressed store, hash-verified

101// NewSTSWebIdentity returns a pointer to a new
102// Credentials object wrapping the STSWebIdentity.
103func NewSTSWebIdentity(stsEndpoint string, getWebIDTokenExpiry func() (*WebIdentityToken, error), opts ...func(*STSWebIdentity)) (*Credentials, error) {
104 if getWebIDTokenExpiry == nil {
105 return nil, errors.New("Web ID token and expiry retrieval function should be defined")
106 }
107 i := &STSWebIdentity{
108 STSEndpoint: stsEndpoint,
109 GetWebIDTokenExpiry: getWebIDTokenExpiry,
110 }
111 for _, o := range opts {
112 o(i)
113 }
114 return New(i), nil
115}
116
117// NewKubernetesIdentity returns a pointer to a new
118// Credentials object using the Kubernetes service account

Callers 1

NewKubernetesIdentityFunction · 0.85

Calls 1

NewFunction · 0.70

Tested by

no test coverage detected