Documentation
¶
Overview ¶
Package userconfig persists per-user, non-secret state in a small JSON file at os.UserConfigDir()/pipedrive-mcp/config.json. The keyring stores the API token; this file stores the domain pointer so subsequent server runs don't need PIPEDRIVE_COMPANY_DOMAIN re-supplied on every invocation.
File contents are intentionally minimal. Anything secret stays in the keyring; anything operational stays in env vars. This file is for the "which workspace did I last log in to" pointer, the same role `~/.config/gh/hosts.yml` plays for `gh`.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearDefaultDomainIfMatches ¶
ClearDefaultDomainIfMatches clears DefaultDomain only when it equals domain. Used by `logout` so we don't accidentally clear a different workspace's pointer when the user logs out of one of several stored tokens.
func DefaultPath ¶
DefaultPath returns os.UserConfigDir()/pipedrive-mcp/config.json.
func Save ¶
Save writes f to path atomically (write-then-rename in the same dir) with 0600 perms on the file and 0700 on the parent dir. A kill -9 mid-write would otherwise leave a half-truncated file.
func SetDefaultDomain ¶
SetDefaultDomain reads the file at path, updates DefaultDomain, and writes it back. Convenience for the `login` subcommand.