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(c/v3-engine): prefix $ for "values" instead of the suffix FromEnv for "keys" #10593

Open
jjangga0214 opened this issue Nov 12, 2024 · 0 comments
Labels
k/enhancement New feature or improve an existing feature

Comments

@jjangga0214
Copy link
Contributor

jjangga0214 commented Nov 12, 2024

Component

c/v3-engine

Is your proposal related to a problem?

The suffix ~FromEnv is used as a convention for environment variables.

For instance, in the example below, value should be refactored to valueFromEnv to use an env var.

kind: AuthConfig
definition:
  mode:
    jwt:
      key:
        fixed:
          key:
+           valueFromEnv: AUTH_SECRET_AS_ENV_VAR
-           value: "raw-value"

But sometimes, there's no ~FromEnv field.
For example, the snippet below does not work, as there is no field like jwkFromEnv.

kind: AuthConfig
definition:
  mode:
    jwt:
      key:
+       jwkFromEnv: JWK_URL_AS_ENV_VAR
-       jwk: "https://hard-coded-url.com"

In such cases, users should report and request a new feature, like #10592.
This is a bottleneck between core developers and consumers.

Describe the solution you'd like

What if we introduce a prefix like $ for values, instead of the suffix FromEnv for keys?
For example, the field jwk is still used, but the value is changed to $JWK_URL_AS_ENV_VAR.
This indicates it should be interpreted as an env var.

kind: AuthConfig
definition:
  mode:
    jwt:
      key:
+       jwk: $JWK_URL_AS_ENV_VAR
-       jwk: "https://hard-coded-url.com"

Of course, jwk is just an example. We can apply the new convention everywhere.

@jjangga0214 jjangga0214 added the k/enhancement New feature or improve an existing feature label Nov 12, 2024
@jjangga0214 jjangga0214 changed the title feat(c/v3-engine): feat(c/v3-engine): prefix $ for **values** instead of the suffix FromEnv for **keys** Nov 12, 2024
@jjangga0214 jjangga0214 changed the title feat(c/v3-engine): prefix $ for **values** instead of the suffix FromEnv for **keys** feat(c/v3-engine): prefix $ for "values" instead of the suffix FromEnv for "keys" Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
k/enhancement New feature or improve an existing feature
Projects
None yet
Development

No branches or pull requests

1 participant