Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authorization #8

Closed
MarkHerhold opened this issue Aug 6, 2016 · 5 comments
Closed

Authorization #8

MarkHerhold opened this issue Aug 6, 2016 · 5 comments

Comments

@MarkHerhold
Copy link
Contributor

How does this module handle Authorization? Is it expected that the end-user will pass them in as headers?

@silasbw
Copy link
Contributor

silasbw commented Aug 8, 2016

#9 implements client certificate authentication, and facilitates setting Authorization:

const k8 = new K8Api({
  url: 'https://my-k8-api-server.com',
  request: {
     auth: { bearer: 'my-k8-token' }
  }
});

Will those options work for you?

@MarkHerhold
Copy link
Contributor Author

I'm using Kubernetes hosted on Google Cloud Platofrm, which uses Basic auth, that is, base64 of username:password so you may want to consider letting users provide different methods or just the raw Authentication header.

GCP also puts a self-signed cert on their clusters which is causing me a different set of issues.

@MarkHerhold
Copy link
Contributor Author

@silasbw I slightly misstated the situation with GCP

GCP has a self-signed cert on their cluster which must be added to the list of cas (the ca property in the https client). This required for the client to trust the certificate.

In addition to basic auth in my previous comment, GCP also supports cert/key auth called "Client certificate authentication " which can be set via the https cert and key properties.

http://kubernetes.io/docs/admin/authentication/

I would recommend devising a way to support all of these upfront. Due to the number of options, I think it would be reasonable to allow the user to pass an object straight through that would override the https connection options already set by this module, but this choice is up to you. 👍

@silasbw
Copy link
Contributor

silasbw commented Aug 8, 2016

@MarkHerhold I updated #9 and I think it supports your case. I tested with this example https://github.com/godaddy/kubernetes-client/pull/9/files#diff-04c6e90faac2675aa89e2176d2eec7d8R170 on GCP.

@MarkHerhold
Copy link
Contributor Author

Excellent, going to give it a shot! Thanks!

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

No branches or pull requests

2 participants