Skip to content

Commit

Permalink
Fix Failed Token Delete with PEP8 Indent (#242)
Browse files Browse the repository at this point in the history
Co-authored-by: carter <[email protected]>
  • Loading branch information
HaleCT2 and carter authored Aug 1, 2024
1 parent ec8d7e8 commit 0a266a6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/242-fix-failed-token-deletion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- openshift_auth - fix issue where openshift_auth module sometimes does not delete the auth token. Based on stale PR (https://github.com/openshift/community.okd/pull/194).
6 changes: 4 additions & 2 deletions plugins/modules/openshift_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,10 @@ def get_oauthaccesstoken_objectname_from_token(token_name):
"""

sha256Prefix = "sha256~"
content = token_name.strip(sha256Prefix)

if token_name.startswith(sha256Prefix):
content = token_name[len(sha256Prefix):]
else:
content = token_name
b64encoded = urlsafe_b64encode(hashlib.sha256(content.encode()).digest()).rstrip(
b"="
)
Expand Down

0 comments on commit 0a266a6

Please sign in to comment.