Skip to content
This repository has been archived by the owner on Mar 13, 2022. It is now read-only.

Ensure no base64 incorrect padding errors occur in PY3 #132

Closed
wants to merge 1 commit into from

Conversation

ralphje
Copy link

@ralphje ralphje commented Apr 30, 2019

Using a Kubernetes oid token configuration with Python 3, I encountered incorrect padding errors when the library attempted to decode the base64 string. Looking into the code base, I noticed that == is added to avoid this error in Python 2, but is mysteriously omitted from the Python 3 call.

I'm not sure why this is, especially since Python 3 has the exact same behaviour regarding insufficient padding as Python 2. Since the trick with adding == still works in Python 3, I have simply copied this from the Python 2 implementation and added a comment why this magic constant works.

@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please sign in with your organization's credentials at https://identity.linuxfoundation.org/projects/cncf to be authorized.
  • If you have done the above and are still having issues with the CLA being reported as unsigned, please log a ticket with the Linux Foundation Helpdesk: https://support.linuxfoundation.org/
  • Should you encounter any issues with the Linux Foundation Helpdesk, send a message to the backup e-mail support address at: [email protected]

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Apr 30, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ralphje
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: mbohlool

If they are not already assigned, you can assign the PR to them by writing /assign @mbohlool in a comment when ready.

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Apr 30, 2019
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Apr 30, 2019
@codecov-io
Copy link

Codecov Report

Merging #132 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #132   +/-   ##
=======================================
  Coverage   92.84%   92.84%           
=======================================
  Files          13       13           
  Lines        1328     1328           
=======================================
  Hits         1233     1233           
  Misses         95       95
Impacted Files Coverage Δ
config/kube_config.py 86.37% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1d5231c...792bb5e. Read the comment docs.

@ralphje
Copy link
Author

ralphje commented May 1, 2019

Appears to duplicate #79, though my fix was a more simple approach.

@ralphje ralphje closed this May 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants