1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-04-09 21:47:17 +00:00

[PR #10196/b86e4af1 backport][stable-10] gitlab_*_access_token: handle revoked field in group and project access tokens (#10205)

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

fix(gitlab): handle `revoked` field in group and project access tokens

(cherry picked from commit b86e4af103)

Co-authored-by: Massimo Gengarelli <massimo.gengarelli@proton.me>
This commit is contained in:
patchback[bot] 2025-06-06 06:27:22 +02:00 committed by GitHub
parent 9717bac816
commit ae3236389e
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