@@ -93,6 +93,9 @@ type STSWebIdentity struct {
93
93
94
94
// roleSessionName is the identifier for the assumed role session.
95
95
roleSessionName string
96
+
97
+ // Optional, used for token revokation
98
+ TokenRevokeType string
96
99
}
97
100
98
101
// NewSTSWebIdentity returns a pointer to a new
@@ -135,7 +138,7 @@ func WithPolicy(policy string) func(*STSWebIdentity) {
135
138
}
136
139
137
140
func getWebIdentityCredentials (clnt * http.Client , endpoint , roleARN , roleSessionName string , policy string ,
138
- getWebIDTokenExpiry func () (* WebIdentityToken , error ),
141
+ getWebIDTokenExpiry func () (* WebIdentityToken , error ), tokenRevokeType string ,
139
142
) (AssumeRoleWithWebIdentityResponse , error ) {
140
143
idToken , err := getWebIDTokenExpiry ()
141
144
if err != nil {
@@ -168,6 +171,9 @@ func getWebIdentityCredentials(clnt *http.Client, endpoint, roleARN, roleSession
168
171
v .Set ("Policy" , policy )
169
172
}
170
173
v .Set ("Version" , STSVersion )
174
+ if tokenRevokeType != "" {
175
+ v .Set ("TokenRevokeType" , tokenRevokeType )
176
+ }
171
177
172
178
u , err := url .Parse (endpoint )
173
179
if err != nil {
@@ -236,7 +242,7 @@ func (m *STSWebIdentity) RetrieveWithCredContext(cc *CredContext) (Value, error)
236
242
return Value {}, errors .New ("STS endpoint unknown" )
237
243
}
238
244
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 )
240
246
if err != nil {
241
247
return Value {}, err
242
248
}
0 commit comments