-
Notifications
You must be signed in to change notification settings - Fork 28
enable support of AuthenticationTokens, add Google OAuth Credentials Token Source #12
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
Conversation
CC @Vlatombe |
for me it seems harder to maintain separated plugin for credentials, because using AuthenticationTokens API requires some model classes for converting Credentials to them. Now these models have to be defined here in order to share them between |
cf88c55
to
2cf92df
Compare
2cf92df
to
8eb25cc
Compare
…ombe/kubernetes-credentials-plugin into authentication-tokens
@jglick @Vlatombe build of related kubernetes-plugin changes succeded with custom version from this PR: jenkinsci/kubernetes-plugin#588 |
Do I have to write getter-setter tests for model classes to prevent coverage level decrease? |
I am not the plugin maintainer but: sounds like busy work to me. Useful tests either exercise realistic end-to-end scenarios; or exercise complex blocks of code which do not obviously do what they claim to be doing. Would a plausible innocent-looking but incorrect change make the test fail? If not, it is just noise. |
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 good overall (see my notes). I'll give it a try.
src/main/java/org/jenkinsci/plugins/kubernetes/credentials/FileCredentialsTokenSource.java
Outdated
Show resolved
Hide resolved
src/main/java/org/jenkinsci/plugins/kubernetes/auth/KubernetesAuthKubeconfig.java
Outdated
Show resolved
Hide resolved
.../org/jenkinsci/plugins/kubernetes/credentials/StandardCertificateCredentialsTokenSource.java
Outdated
Show resolved
Hide resolved
src/main/java/org/jenkinsci/plugins/kubernetes/auth/KubernetesAuthCertificate.java
Outdated
Show resolved
Hide resolved
@Vlatombe could you please review / merge? Thanks |
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.
Some minor tweaks but lgtm otherwise.
src/main/java/org/jenkinsci/plugins/kubernetes/auth/KubeConfigBuilder.java
Outdated
Show resolved
Hide resolved
src/main/java/org/jenkinsci/plugins/kubernetes/auth/KubeConfigBuilder.java
Outdated
Show resolved
Hide resolved
@maxlaverse @carlossg are you able to review this? Looks ready to merge to me but I don't have karma on this repo. |
I proposed some changes in dev-dsp#1 to take into account the newly released kubernetes-client-api plugin |
Depend on new kubernetes-client-api and some fixes for TokenSource
Thanks @Vlatombe, I've merged your changes |
Hi ! This plugin provides credentials that can be retrieved with the Regarding the tests coverage I agree with @jglick and couldn't think of sensible tests to add. |
Hi @maxlaverse, For example, I don't see any need in wrapping I found similar setup code in https://github.com/jenkinsci/kubernetes-cli-plugin/blob/master/src/main/java/org/jenkinsci/plugins/kubernetes/cli/kubeconfig/KubeConfigWriter.java, that now can be simplified. |
Hi @dev-dsp !
Well, That being said, if I'm not mistaken I also had a look at your original PR jenkinsci/kubernetes-plugin#580. |
Hello @maxlaverse . There were no known kubeconfig compatibility issues (at least I could not find any), and its structure can not just suddenly change at one time. Btw, possible compatibility issues cause things like continuous integration with functional tests, which we do have here (and in fabric8 pipelines, for sure). When stepping aside of the way with using ConfigBuilder, we would require to pass all the pipeline-related things like Regarding TokenProducer - it is not possible to implement that interface for GoogleRobotCredentials class, since the last one is final: jenkinsci/kubernetes-plugin#580 (comment) |
@maxlaverse any thoughts on that? |
I've given some time to prepare a downstream PR in kubernetes-cli, I'll file a couple of fixes against this PR. |
* Add configuration object to KubernetesAuth methods * Remove password field from KubernetesAuthCertificate * Add support for token producer (which need more context for evaluation) * Move KubernetesAuth implementations to their own package * Move CredentialsTokenSource implementations to their own package * Javadoc
@dev-dsp Could you edit the PR description to refer to the current PR jenkinsci/kubernetes-plugin#588 ? |
Hi @dev-dsp ! I must admit my opinion has shifted since. I understand that the dependency to the @Vlatombe I saw you tried to adapt that other plugin, thanks for that! In the meantime, are you still happy with this PR ? In that case I would merge and release to allow @dev-dsp to make progress with jenkinsci/kubernetes-plugin#580. |
Bump! We would like to use this! Can we somehow help you guys out? |
Complete implementation
Oh sorry. @Vlatombe, I merged that. |
(just a friendly reminder) |
Thank you all! |
Part of work from jenkinsci/kubernetes-plugin#588