-
Notifications
You must be signed in to change notification settings - Fork 61
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
Formatter #51
base: master
Are you sure you want to change the base?
Formatter #51
Conversation
There has not been any activity to this pull request in the last 30 days. It will automatically be closed after 7 more days. Remove the |
@martin-helmich can I have a review please ? :) With this addition, it is possible to the password generator for more helm charts that require special formatted secrets like url formatted secrets. I think this is a very nice addition |
Hey Daniel, thanks for your contribution 👍 and my apologies for the delay! 🙄🙏 TBH, I was already having mixed feelings before concerning the multitude of different annotations. Configuring the secret generation via annotation is already tedious and only provides limited extensibility. In #35, we've added the possibility to define generated secrets as Custom Resources, which gives us way more possibilities to define their exact properties in a structured and well-defined way. I'm thinking if instead, we could possibly extend the CR definition to accept templated expressions (maybe feature-freezing the generation by annotation entirely, in favour of the CR-based generation): apiVersion: secretgenerator.mittwald.de/v1alpha1
kind: StringSecret
metadata:
name: example-pw
spec:
forceRegenerate: false
data:
user: testuser
fields:
- fieldName: password
encoding: base64
length: 32
dataTemplates:
- fieldName: loginUri
template: >
http://{{ .data.user | base64decode | urlquery }}:{{.data.password | base64decode | urlquery}}@localhost/ Any thoughts are welcome. 🙂 |
There has not been any activity to this pull request in the last 30 days. It will automatically be closed after 7 more days. Remove the |
This flake file allowes you to enter a working dev environment with "nix shell". It includes the very old operator-sdk, helm, kind, etc
Allows the user to specify a template which is rendered with go template engine. The generated values are added to the Secret. This allows secretgenerator to create passwords in special syntax like url's
@martin-helmich I rewrote the patch to use the new CRD. I think the new solution is quite elegant and allows even one template to use the output of a previous template. |
ae687ff
to
1ce3af2
Compare
Either codeclimate complains about the number of arguments or similarity in code. Go error handling is a mess and therefore lots of ducplated code. If codeclimate would distingish between internal and external api, things would be easier
:( this codeclimate is the most annoying code checker i have seen so far. so creating a config file and adjusting one test somehow changes the complete behavior ? |
@poelzi Don't worry about code climate. I think I'm going to remove it from this repo anyways. As you say, it is quite annoying and not that useful for us. I'm sorry that you had to deal with it. |
There has not been any activity to this pull request in the last 30 days. It will automatically be closed after 7 more days. Remove the |
There has not been any activity to this pull request in the last 30 days. It will automatically be closed after 7 more days. Remove the |
This PR adds the possibility to format secret values according to rules defined
in the new
format.secret-generator.v1.mittwald.de/
annotation prefix.This allows secret-generator to generate specially formatted values containing the
newly generated secret.
Some charts or software require the username and password to be formatting in
form of a uri. With this addition, it is now possible to use the secret generator with
nearly every chart out there.