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

feat(#1089): kubernetes client config with auth token #1091

Conversation

valisol
Copy link
Contributor

@valisol valisol commented Jan 9, 2024

  • Allow configuration with new oauthToken
  • Update Tests
  • Update Documentation

@bbortt
Copy link
Collaborator

bbortt commented Jan 9, 2024

the dependency version we're using is quite old..

<k8s.client.version>1.4.34</k8s.client.version>
<k8s.model.version>1.0.65</k8s.model.version>

version 6 of the fabric8 client is out by now, I think. would you mind checking if the upgrade would cause big troubles? maybe we can just update the numbers without any big migrations.

I am not sure if a this-old-client is even useful with "modern" kubernetes platforms, that's why I am asking.

link to pom.xml.

@christophd
Copy link
Member

christophd commented Jan 9, 2024

yes we need to update to new fabric8 client version, but unfortunately this is not an easy task as it brings lots of breaking changes in the client API.

@valisol valisol force-pushed the issue/1089/kubernetes-client-config-auth-token branch 2 times, most recently from bac3aef to 1288dcd Compare January 9, 2024 13:51
@valisol valisol force-pushed the issue/1089/kubernetes-client-config-auth-token branch 3 times, most recently from 0f9392a to a1cb6ac Compare January 10, 2024 07:48
@bbortt bbortt linked an issue Jan 10, 2024 that may be closed by this pull request
@valisol valisol force-pushed the issue/1089/kubernetes-client-config-auth-token branch 2 times, most recently from 01329c0 to 1f8f18d Compare January 10, 2024 11:11
- Allow configuration with new oauthToken
- Add restrictions to allow config only with oauthToken or username and password
- Update Tests
- Update Documentation
@bbortt bbortt force-pushed the issue/1089/kubernetes-client-config-auth-token branch from 1f8f18d to 6b3e0cf Compare January 10, 2024 18:58
@bbortt
Copy link
Collaborator

bbortt commented Jan 10, 2024

awesome job @valisol! I've allowed myself to do some "contributor stuff" (things I wouldn't expect a first-time contributor to do), like updating all copyrights and most noteable; centralizing the rules in a CredentialValidator. I've then unit-tested the validation according to the following rules (see javadoc):

Validates the given credentials based on the following rules. Returns {@code true} if and only if none of the following conditions are met:

  • username is set AND oauthToken is set
  • password is set AND oauthToken is set
  • username is not set AND password is set

All other combinations are valid. This makes it also compatible with the existing API, removing the need to specify an empty password.

@bbortt bbortt merged commit cad790d into citrusframework:main Jan 10, 2024
1 check passed
@bbortt bbortt deleted the issue/1089/kubernetes-client-config-auth-token branch January 11, 2024 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kubernetes client: allow config with authentication token
3 participants