-
Notifications
You must be signed in to change notification settings - Fork 185
Conversation
According to the JWT spec base64 padding characters are stripped. Fixes kubernetes-client#65
Hey @hanikesn , Would you mind updating your branch? Would love to see this get merged in. |
@hanikesn are you still interested in updating this PR? |
@@ -87,11 +87,11 @@ def _raise_exception(st): | |||
|
|||
TEST_OIDC_TOKEN = "test-oidc-token" | |||
TEST_OIDC_INFO = "{\"name\": \"test\"}" | |||
TEST_OIDC_BASE = _base64(TEST_OIDC_TOKEN) + "." + _base64(TEST_OIDC_INFO) | |||
TEST_OIDC_BASE = _base64(TEST_OIDC_TOKEN).strip('=') + "." + _base64(TEST_OIDC_INFO).strip('=') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the length of the changed lines in this file is what makes the travis job complain. I get this output when I test the styleguide locally:
$ pycodestyle config/kube_config*
config/kube_config_test.py:90:80: E501 line too long (95 > 79 characters)
config/kube_config_test.py:94:80: E501 line too long (98 > 79 characters)
I will take another look this weekend. |
Eagerly waiting for this fix to be merged so that kube-ops-view can pull it in and then we can have our monitoring working for OIDC clusters. |
is this stale? OIDC is still broken with the k8s python client.. |
@hanikesn this fix works for me. I would love to see this merged |
Could you use autopep8 on aggressive level 2 to prepare your code? That should let you pass the Travis CI. @hanikesn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this PR is kind of old, let's try this...
@@ -87,11 +87,11 @@ def _raise_exception(st): | |||
|
|||
TEST_OIDC_TOKEN = "test-oidc-token" | |||
TEST_OIDC_INFO = "{\"name\": \"test\"}" | |||
TEST_OIDC_BASE = _base64(TEST_OIDC_TOKEN) + "." + _base64(TEST_OIDC_INFO) | |||
TEST_OIDC_BASE = _base64(TEST_OIDC_TOKEN).strip('=') + "." + _base64(TEST_OIDC_INFO).strip('=') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TEST_OIDC_BASE = _base64(TEST_OIDC_TOKEN).strip('=') + "." + _base64(TEST_OIDC_INFO).strip('=') | |
TEST_OIDC_BASE = _base64(TEST_OIDC_TOKEN).strip( | |
'=') + "." + _base64(TEST_OIDC_INFO).strip('=') |
TEST_OIDC_LOGIN = TEST_OIDC_BASE + "." + TEST_CLIENT_CERT_BASE64 | ||
TEST_OIDC_TOKEN = "Bearer %s" % TEST_OIDC_LOGIN | ||
TEST_OIDC_EXP = "{\"name\": \"test\",\"exp\": 536457600}" | ||
TEST_OIDC_EXP_BASE = _base64(TEST_OIDC_TOKEN) + "." + _base64(TEST_OIDC_EXP) | ||
TEST_OIDC_EXP_BASE = _base64(TEST_OIDC_TOKEN).strip('=') + "." + _base64(TEST_OIDC_EXP).strip('=') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TEST_OIDC_EXP_BASE = _base64(TEST_OIDC_TOKEN).strip('=') + "." + _base64(TEST_OIDC_EXP).strip('=') | |
TEST_OIDC_EXP_BASE = _base64(TEST_OIDC_TOKEN).strip( | |
'=') + "." + _base64(TEST_OIDC_EXP).strip('=') |
/assign |
/check-cla |
@wwade This one was abandoned I think. The other one is still open. |
Closing in favor of #79. Thanks for the fix! |
According to the JWT spec base64 padding characters are stripped.
Fixes #65
Tested only with python 3.