Skip to content

Store Permify CLI credentials by profile#27

Open
mdp28 wants to merge 1 commit into
Permify:mainfrom
mdp28:permify-cli-2-credentials-storage
Open

Store Permify CLI credentials by profile#27
mdp28 wants to merge 1 commit into
Permify:mainfrom
mdp28:permify-cli-2-credentials-storage

Conversation

@mdp28
Copy link
Copy Markdown

@mdp28 mdp28 commented May 15, 2026

/claim #2

Summary

  • Adds profile-aware credential storage at ~/.permify/credentials (Windows: %USERPROFILE%\.permify\credentials) for endpoint, bearer token, client cert path, and client cert key path.
  • Keeps tenant/profile data in the normal CLI config while keeping credentials out of that file.
  • Updates configure to collect and persist connection credentials, then validates the connection with those values.
  • Updates command clients to create gRPC clients from the active profile, including bearer metadata, TLS endpoints, and optional mTLS client cert/key support.
  • Adds focused tests for credential persistence/loading, legacy field compatibility, config secret separation, endpoint parsing, token metadata, TLS/mTLS option setup, and empty endpoint validation.

Verification

  • git diff --check passed.
  • Local Go toolchain was unavailable on this Windows environment, and repeated portable Go downloads from go.dev reset before completion, so I could not run gofmt/go test ./... locally here.

Notes

  • This follows the maintainer guidance in Endpoint, Token, Cert Path, and Cert Key Storage for CLI Tool #2 to use ~/.permify/credentials / C:\Users\USERNAME\.permify\credentials for endpoint, token, certificate path, and certificate key.
  • The credential file is written with 0600 mode on Unix-like systems and stored per profile so existing --profile workflows remain supported.

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