@@ -93,6 +93,9 @@ type STSWebIdentity struct {
9393
9494 // roleSessionName is the identifier for the assumed role session.
9595 roleSessionName string
96+
97+ // Optional, used for token revokation
98+ TokenRevokeType string
9699}
97100
98101// NewSTSWebIdentity returns a pointer to a new
@@ -135,7 +138,7 @@ func WithPolicy(policy string) func(*STSWebIdentity) {
135138}
136139
137140func getWebIdentityCredentials (clnt * http.Client , endpoint , roleARN , roleSessionName string , policy string ,
138- getWebIDTokenExpiry func () (* WebIdentityToken , error ),
141+ getWebIDTokenExpiry func () (* WebIdentityToken , error ), tokenRevokeType string ,
139142) (AssumeRoleWithWebIdentityResponse , error ) {
140143 idToken , err := getWebIDTokenExpiry ()
141144 if err != nil {
@@ -168,6 +171,9 @@ func getWebIdentityCredentials(clnt *http.Client, endpoint, roleARN, roleSession
168171 v .Set ("Policy" , policy )
169172 }
170173 v .Set ("Version" , STSVersion )
174+ if tokenRevokeType != "" {
175+ v .Set ("TokenRevokeType" , tokenRevokeType )
176+ }
171177
172178 u , err := url .Parse (endpoint )
173179 if err != nil {
@@ -236,7 +242,7 @@ func (m *STSWebIdentity) RetrieveWithCredContext(cc *CredContext) (Value, error)
236242 return Value {}, errors .New ("STS endpoint unknown" )
237243 }
238244
239- a , err := getWebIdentityCredentials (client , stsEndpoint , m .RoleARN , m .roleSessionName , m .Policy , m .GetWebIDTokenExpiry )
245+ a , err := getWebIdentityCredentials (client , stsEndpoint , m .RoleARN , m .roleSessionName , m .Policy , m .GetWebIDTokenExpiry , m . TokenRevokeType )
240246 if err != nil {
241247 return Value {}, err
242248 }
0 commit comments