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(auth): allow optional basic authentication #95

Merged
merged 4 commits into from
Oct 25, 2023

Conversation

tthvo
Copy link
Member

@tthvo tthvo commented Oct 19, 2023

Fixes #4

What's new

Added some options for authentication (i.e. Basic Authentication) that are enabled on demand.

References

Ref: cryostatio/cryostat-operator#206 (comment)

Note: I added an additional enabled to make it more explicit to the user but let me know what u think.

How to test

Create a secret (username: user and password: pass):

cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Secret                          
metadata:
  name: basic-auth
type: Opaque
data:
  basic-auth: dXNlcjpkNzRmZjBlZThkYTNiOTgwNmIxOGM4NzdkYmYyOWJiZGU1MGI1YmQ4ZTRkYWQ3YTNhNzI1MDAwZmViODJlOGYxCg==
EOF

Create a chart release:

helm install cryostat charts/cryostat/ \
--set authentication.basicAuth.enabled=true \
--set authentication.basicAuth.secretName=basic-auth \
--set authentication.basicAuth.filename=basic-auth

@tthvo tthvo added feat New feature or request safe-to-test labels Oct 19, 2023
@tthvo tthvo requested review from a team and ebaron October 19, 2023 21:35
@tthvo
Copy link
Member Author

tthvo commented Oct 19, 2023

Ahh upgrade tests failed:

Error: UPGRADE FAILED: template: cryostat/templates/deployment.yaml:96:28: executing "cryostat/templates/deployment.yaml" at <.Values.authentication.basicAuth.enabled>: nil pointer evaluating interface {}.basicAuth

@tthvo
Copy link
Member Author

tthvo commented Oct 19, 2023

Nicee! Fixed now^^

Copy link
Member

@andrewazores andrewazores left a comment

Choose a reason for hiding this comment

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

LGTM other than that minor docs comment

Copy link
Member

@ebaron ebaron left a comment

Choose a reason for hiding this comment

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

Looks awesome, thanks a lot @tthvo! This will be great for 2.4.

@ebaron ebaron merged commit e6be8ea into cryostatio:main Oct 25, 2023
4 checks passed
mergify bot pushed a commit that referenced this pull request Oct 25, 2023
* feat(values): add authentication value parameters

* feat(auth): implement basic authentication

* fix(values): handle nullable cases

* docs(readme): update to mention unset auth case

(cherry picked from commit e6be8ea)
@tthvo tthvo deleted the basic-auth branch October 25, 2023 23:00
@tthvo
Copy link
Member Author

tthvo commented Oct 25, 2023

Yay I am very glad to help^^

tthvo added a commit to tthvo/cryostat-helm that referenced this pull request Oct 26, 2023
* feat(values): add authentication value parameters

* feat(auth): implement basic authentication

* fix(values): handle nullable cases

* docs(readme): update to mention unset auth case

(cherry picked from commit e6be8ea)
ebaron pushed a commit that referenced this pull request Oct 27, 2023
* feat(values): add authentication value parameters

* feat(auth): implement basic authentication

* fix(values): handle nullable cases

* docs(readme): update to mention unset auth case

(cherry picked from commit e6be8ea)
ebaron pushed a commit that referenced this pull request Oct 27, 2023
* feat(values): add authentication value parameters

* feat(auth): implement basic authentication

* fix(values): handle nullable cases

* docs(readme): update to mention unset auth case

(cherry picked from commit e6be8ea)

Co-authored-by: Thuan Vo <thuan.votann@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport feat New feature or request safe-to-test
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add optional Basic Authentication for Cryostat
3 participants