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

Make secret key for basic-auth string customizable #69

Open
manuelottlik opened this issue Jan 16, 2022 · 2 comments
Open

Make secret key for basic-auth string customizable #69

manuelottlik opened this issue Jan 16, 2022 · 2 comments

Comments

@manuelottlik
Copy link

Is your feature request related to a problem? Please describe.
I would like to use the secret generator for generating a basic auth secret, but I am using Traefik as an ingress controller. Traefik requires the secret key for the basic auth string to be users, so I cannot use a generated secret from the controller.

Describe the solution you'd like
I would like an annotation that allows me to adjust the secret key, so I could have users: instead of the current default auth: key. Probably something like secret-generator.v1.mittwald.de/httpwd-secretkey.

Describe alternatives you've considered
Right now I am copying the content of the generated secret manually to another secret.

Additional context
The feature could probably be implemented similar to the optional username other than admin that can be provided via the annotation.

@martin-helmich
Copy link
Member

PRs are always welcome. 🙂

In general, I would prefer phasing out the annotation-driven secret generation in favour of the CR-based approach, which is easier extendable. Maybe the CR could be extended as follows:

 apiVersion: "secretgenerator.mittwald.de/v1alpha1"
 kind: "BasicAuth"
 metadata:
   name: "example-auth"
   namespace: "default"
 spec:
   length: "40"
   username: "testuser"
   encoding: "base64"
   forceRegenerate: false
+  authField: "users" # default to "auth" if omitted
+  usernameField: "username"  # default to "username" if omitted (alternatively, don't include username at all if omitted)
+  passwordField: "password"  # default to "password" if omitted (alternatively, don't include password at all if omitted)
   data:
     example: "data"

@manuelottlik
Copy link
Author

Would love to contribute to the project, but I can't write go code :/

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

No branches or pull requests

2 participants