Fix Failed Token Delete with PEP8 Indent (#242)

Co-authored-by: carter <me@halecarter.com>
This commit is contained in:
Carter Hale
2024-08-01 11:59:30 -04:00
committed by GitHub
parent ec8d7e8299
commit 0a266a6716
2 changed files with 6 additions and 2 deletions

View File

@@ -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).

View File

@@ -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"="
)