Skip to content

feat: add --client-id and --client-secret flags to login command#451

Open
A-d-i-t-y wants to merge 1 commit into
microcks:masterfrom
A-d-i-t-y:feat/login-client-id-secret-flags
Open

feat: add --client-id and --client-secret flags to login command#451
A-d-i-t-y wants to merge 1 commit into
microcks:masterfrom
A-d-i-t-y:feat/login-client-id-secret-flags

Conversation

@A-d-i-t-y
Copy link
Copy Markdown

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

  • cmd/login.go — added --client-id and --client-secret flags

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 <aaaditya1909@gmail.com>
@A-d-i-t-y
Copy link
Copy Markdown
Author

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!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant