mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-09 13:37:15 +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:
parent
9717bac816
commit
ae3236389e
6 changed files with 118 additions and 18 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue