mirror of
https://github.com/openshift/community.okd.git
synced 2026-07-29 19:04:32 +00:00
Fix Failed Token Delete with PEP8 Indent (#242)
Co-authored-by: carter <me@halecarter.com>
This commit is contained in:
2
changelogs/fragments/242-fix-failed-token-deletion.yml
Normal file
2
changelogs/fragments/242-fix-failed-token-deletion.yml
Normal 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).
|
||||||
@@ -224,8 +224,10 @@ def get_oauthaccesstoken_objectname_from_token(token_name):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
sha256Prefix = "sha256~"
|
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(
|
b64encoded = urlsafe_b64encode(hashlib.sha256(content.encode()).digest()).rstrip(
|
||||||
b"="
|
b"="
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user