Repository navigation
Conversation
Previously client credentials could only be provided via environment
variables (MICROCKS_CLIENT_ID, MICROCKS_CLIENT_SECRET). This made it
inconvenient in CI/CD environments where injecting env vars is not
always possible.
Now credentials can be passed directly as CLI flags:
microcks login http://localhost:8080 \
--username admin \
--password secret \
--client-id my-client \
--client-secret my-secret
Environment variables are still supported as fallback.
Signed-off-by: Aditya <[email protected]>
|
Hi @Harsh4902 @Vaishnav88sk @lbroudoux, I have raised this PR to add --client-id and --client-secret flags to the login command. Previously credentials could only be provided via environment variables which is inconvenient in many CI/CD setups. This change adds flag support with environment variables as fallback — no breaking changes. Would love your feedback! |
|
@A-d-i-t-y From onwards, please create an issue first, and illustrate the actual problem with reproduction steps (if suitable). |
|
Before merge, I’d like two small follow-ups:
One note to keep in mind in the docs/help: passing secrets via CLI flags is convenient, but it is also more visible in shell history/process lists. |
|
@A-d-i-t-y Thanks for proposing a more convenient way to provide Keycloak client credentials during login. We’re closing this implementation because the CLI already exposes the inherited --keycloakClientId and --keycloakClientSecret options. Adding another pair of flags would duplicate the existing interface and make credential precedence harder to understand. Passing secrets directly on the command line can also expose them through shell history or process listings. |
Summary
Adds --client-id and --client-secret flags to the login command
so client credentials can be passed directly without requiring
environment variables.
Problem
Currently the login command only reads client credentials from
environment variables:
MICROCKS_CLIENT_ID=my-client
MICROCKS_CLIENT_SECRET=my-secret
microcks login http://localhost:8080 --username admin --password secret
This is inconvenient in CI/CD environments where injecting env vars
is not always possible or desirable.
Solution
Added two new flags with environment variables as fallback:
microcks login http://localhost:8080
--username admin
--password secret
--client-id my-client
--client-secret my-secret
If flags are not provided, environment variables are still used
as fallback — no breaking changes.
Files Changed