Skip to content
This repository was archived by the owner on Jan 19, 2018. It is now read-only.

Conversation

kadel
Copy link
Collaborator

@kadel kadel commented Apr 18, 2016

fixes #533

TODO:

  • add docs
  • add tests

params = []

if self.access_token:
params = {"access_token": self.access_token}
Copy link
Collaborator

@surajssd surajssd Apr 19, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra tab given here and why you removing existing value of dict and assigning it only {"access_token": self.access_token}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is wrong you are right :-)

@dustymabe
Copy link
Contributor

while the [WIP] text is in the name I assume you guys are still working on this. let me know when you want review.

surajssd and others added 4 commits April 20, 2016 12:49
Added cert param so that now we can pass client side certs
while making request to API server, this can be passed as
path to file that contains cert and key or it can be a tuple
which has path ti cert and key.

This is part of the effort to add support to authenticate to
server via cert in addition to access_token.
add support for geting certificates and keys from '-data'
@kadel
Copy link
Collaborator Author

kadel commented Apr 20, 2016

#dotests

@kadel kadel changed the title [WIP] Add support for authenticating via client certificate for Openshift Add support for authenticating via client certificate for Openshift Apr 20, 2016
else:
params = {"access_token": self.access_token}
if not params:
params = {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just set params={} in the function declaration. That way {} is the default value given if params isn't provided right? I guess someone could provide params=None though :(

@dustymabe
Copy link
Contributor

Is providing a cert+key in a single file (as mentioned here) a thing? If so are we supporting it with this work?

@dustymabe
Copy link
Contributor

Also, is there any chance we can bundle this bug in as part of this work: #529

if "certificate-authority" in cluster["cluster"]:
# if we are in container translate path to path on host
ca = os.path.join(Utils.getRoot(),
cluster["cluster"].get("certificate-authority").lstrip('/'))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really long line.. can we break it up into two? maybe cluster["cluster"].get("certificate-authority").lstrip('/') on the first and the join on the 2nd.

Copy link
Contributor

@dustymabe dustymabe Apr 20, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"into two" meaning we would need to assignments probably

ca = cluster["cluster"].get("certificate-authority").lstrip('/')
ca = os.path.join(Utils.getRoot(), ca)

Copy link
Collaborator Author

@kadel kadel Apr 21, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now when #705 is merged, I'm going to shorten this by using get_real_abspath

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @kadel and @dustymabe feel free to look at my implementation def cert_file under https://github.com/projectatomic/atomicapp/pull/712/files (specifically, kubebase.py) for how I implemented the base64 encoding / files and such.

@dustymabe
Copy link
Contributor

Great job guys.. Sorry about all the comments :( - we are really close though

Temporary files will be garbage collected. Also added a function
in Utils to remove files.
@cdrage
Copy link
Member

cdrage commented May 16, 2016

@kadel @dustymabe @surajssd

Shout... I forgot to mention that I already implemented this in kubebase.py in my PR...

See https://github.com/projectatomic/atomicapp/pull/712/files

Specifically, kubebase.py functions: _connection() and _certfile()...

@cdrage
Copy link
Member

cdrage commented May 16, 2016

It also includes your issue of base64 encoding (converts files to base64, etc.) as well as cert requests when specifying a certificate.

Originally, i was implementing this for the kubernetes api, but because of how similar both the openshift + kubernetes api http implementations are, the cert passing works for both.

@kadel kadel removed the need_review label May 16, 2016
@dustymabe
Copy link
Contributor

@cdrage so you're saying that #533 is handled by #712?

@cdrage
Copy link
Member

cdrage commented May 20, 2016

@dustymabe yes sir

@surajssd
Copy link
Collaborator

@dustymabe @cdrage is it time to close this PR?

@concaf
Copy link
Contributor

concaf commented Jul 21, 2016

@cdrage since work around this is being done in #743, let's close this? WDYT?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support authenticating via client certificate for Openshift
5 participants