/claim #2
Implements persistent credential storage for the Permify CLI as described in #2.
What this PR does:
~/.permify/credentials - Stores endpoint, API token, certificate path, and certificate key in a YAML file with restrictive permissions (0600 file, 0700 directory) for securityconfigure command - Now prompts for API token, certificate path, and certificate key alongside the existing URL prompt. Pre-fills values from previously stored credentials for convenienceNew() function now reads stored credentials and automatically configures:
os.UserHomeDir() as fallback for home directory resolution (Windows USERPROFILE, macOS/Linux HOME)Files changed:
| File | Change |
|---|---|
core/client/credentials.go |
New: credential storage with YAML serialization, OS-aware path resolution |
core/client/credentials_test.go |
New: 4 unit tests for credential operations |
core/client/grpc.go |
Updated: loads stored credentials, builds TLS/token dial options |
core/cli/configure.go |
Updated: prompts for token + certs, stores credentials before connecting |
cmd/permctl/permctl.go |
Updated: cross-platform home directory resolution |
Credential file format (~/.permify/credentials):
endpoint: localhost:3478
token: your-api-token
cert_path: /path/to/cert.pem
cert_key: /path/to/key.pem
Closes #2
buildingvibes
@buildingvibes
Permify.co
@Permify