Add new API endpoint to revoke STS tokens (#21072)

This commit is contained in:
Taran Pelkey
2025-03-31 14:51:24 -04:00
committed by GitHub
parent e88d494775
commit 53d40e41bc
11 changed files with 555 additions and 205 deletions

View File

@@ -662,6 +662,16 @@ func (sys *IAMSys) SetPolicy(ctx context.Context, policyName string, p policy.Po
return updatedAt, nil
}
// RevokeTokens - revokes all STS tokens, or those of specified type, for a user
// If `tokenRevokeType` is empty, all tokens are revoked.
func (sys *IAMSys) RevokeTokens(ctx context.Context, accessKey, tokenRevokeType string) error {
if !sys.Initialized() {
return errServerNotInitialized
}
return sys.store.RevokeTokens(ctx, accessKey, tokenRevokeType)
}
// DeleteUser - delete user (only for long-term users not STS users).
func (sys *IAMSys) DeleteUser(ctx context.Context, accessKey string, notifyPeers bool) error {
if !sys.Initialized() {