Skip to content

Persist token/cert config for CLI client#29

Open
TheDerbiedOne wants to merge 2 commits into
Permify:mainfrom
TheDerbiedOne:feat/bounty-2-credential-storage
Open

Persist token/cert config for CLI client#29
TheDerbiedOne wants to merge 2 commits into
Permify:mainfrom
TheDerbiedOne:feat/bounty-2-credential-storage

Conversation

@TheDerbiedOne
Copy link
Copy Markdown

Fixes #2

What

Adds persistent credential/config storage via the existing CLI config YAML:

  • endpoint
  • bearer token (optional)
  • TLS client cert path (optional)
  • TLS client cert key path (optional)

How

  • Extends core/config.CoreConfig YAML fields for token, cert_path, cert_key.
  • Updates permctl configure to prompt for token/cert paths and persist them.
  • Updates core/client.New to:
    • use TLS when endpoint is https://
    • optionally attach authorization: Bearer <token> using grpc.WithPerRPCCredentials (TLS-only)
    • optionally present a client cert (mTLS) when both cert path + key are provided

Safety

  • Token is only sent over TLS; non-https:// endpoints error at client creation.
  • No credentials embedded in code; config schema + client wiring only.

@TheDerbiedOne
Copy link
Copy Markdown
Author

Update: adjusted implementation to follow maintainer note — connection credentials (endpoint/token/cert paths) are now stored in (0600), and the client loads from that file. Main profile YAML no longer persists token/cert paths.

@TheDerbiedOne
Copy link
Copy Markdown
Author

Follow-up: credentials file path is ~/.permify/credentials (written with 0600 perms). Sorry the prior comment dropped the path due to shell quoting.

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

2 participants