Documentation
¶
Overview ¶
Package token resolves a Personal Access Token from multiple sources.
Priority order:
- Explicit flag value (--token)
- .devlake.env file (plugin-specific key, e.g. GITLAB_TOKEN=...)
- Plugin-specific environment variable (e.g. $GITLAB_TOKEN)
- Interactive masked prompt (terminal)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ResolveResult ¶
type ResolveResult struct {
Token string
Source string // "flag", "envfile", "environment", "prompt"
EnvFilePath string // non-empty if loaded from envfile (for cleanup)
}
ResolveResult contains the resolved token and its source.
func Resolve ¶
func Resolve(plugin, flagValue, envFilePath, scopeHint string) (*ResolveResult, error)
Resolve attempts to find a PAT using the priority chain. plugin determines which env vars and env file keys to check (e.g. "github", "gitlab", "azure-devops"). scopeHint is displayed in the interactive prompt to guide the user on required scopes. Returns an error only if no token can be obtained.