1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-04-02 02:16:23 +00:00

gitlab_*_access_token: handle revoked field in group and project access tokens (#10196)

fix(gitlab): handle `revoked` field in group and project access tokens
This commit is contained in:
Massimo Gengarelli 2025-06-06 06:16:54 +02:00 committed by GitHub
parent 97e386f85b
commit b86e4af103
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 118 additions and 18 deletions

View file

@ -183,7 +183,7 @@ class GitLabProjectAccessToken(object):
@param name of the access token
'''
def find_access_token(self, project, name):
access_tokens = project.access_tokens.list(all=True)
access_tokens = [x for x in project.access_tokens.list(all=True) if not getattr(x, 'revoked', False)]
for access_token in access_tokens:
if (access_token.name == name):
self.access_token_object = access_token