Skip to content

feat: store and reuse CLI credentials#41

Open
Deivid00007 wants to merge 1 commit into
Permify:mainfrom
Deivid00007:bounty/permify-cli-2-stored-credentials
Open

feat: store and reuse CLI credentials#41
Deivid00007 wants to merge 1 commit into
Permify:mainfrom
Deivid00007:bounty/permify-cli-2-stored-credentials

Conversation

@Deivid00007

Copy link
Copy Markdown

Resolves #2

Summary

  • store token, cert path, and cert key in the CLI config during configure
  • allow client.New to reuse the stored endpoint when no endpoint is passed
  • select TLS transport when the endpoint is secure or a client certificate pair is configured
  • add bearer-token per-RPC credentials when a stored token is available
  • add tests for TLS detection, certificate-pair validation, and token dial options

Test plan

go test ./...

Result:

ok github.com/Permify/permify-cli/core/client
ok github.com/Permify/permify-cli/core/config
all other packages: no test files

Notes

  • The implementation rejects partial certificate configuration; cert path and cert key must be set together.
  • Plain endpoints still use insecure transport unless TLS/cert configuration is present.
  • Token auth is read from stored config and attached to gRPC dial options.

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.

Endpoint, Token, Cert Path, and Cert Key Storage for CLI Tool

1 participant