Documentation
¶
Overview ¶
Package auth resolves Taiga credentials: env, session cache, refresh and secret sources.
Index ¶
- Variables
- func JWTExpiry(token string) (time.Time, error)
- func RefreshToken(ctx context.Context, hc *http.Client, baseURL, refresh string) (string, string, error)
- func SessionRef(url, username string) string
- type Check
- type CommandSecret
- type DiagnoseInput
- type EnvPassword
- type FileSecret
- type FirstOf
- type Keyring
- type LoginResult
- type ProjectInput
- type Resolver
- type SecretSource
- type Session
- type Store
Constants ¶
This section is empty.
Variables ¶
var ErrReadOnly = errors.New("session store is read-only")
Functions ¶
func JWTExpiry ¶
JWTExpiry reads the exp claim without verifying the signature (the server verifies it).
func RefreshToken ¶
func RefreshToken(ctx context.Context, hc *http.Client, baseURL, refresh string) (string, string, error)
RefreshToken renews the session; Taiga may rotate the refresh token.
func SessionRef ¶
Types ¶
type Check ¶
type CommandSecret ¶
type CommandSecret struct{ Args []string }
func (CommandSecret) Name ¶
func (CommandSecret) Name() string
type DiagnoseInput ¶
type EnvPassword ¶
func (EnvPassword) Configured ¶
func (e EnvPassword) Configured() bool
func (EnvPassword) Name ¶
func (EnvPassword) Name() string
type FileSecret ¶
type FileSecret struct{ Path string }
func (FileSecret) Name ¶
func (FileSecret) Name() string
func (FileSecret) Put ¶
func (f FileSecret) Put(pw []byte) error
type Keyring ¶
type Keyring struct{ Ref string }
Keyring stores the password in the Secret Service under the given reference. It never invokes Unlock or Prompt: an agent must not wait for desktop interaction.
type LoginResult ¶
type ProjectInput ¶ added in v0.3.0
type ProjectInput struct {
Selected string
Source string
AuthFailed bool
Load func(context.Context) (map[string]any, error)
}
ProjectInput is the selected project and how to read it. Load reads the project object as Taiga answers GET projects/<id> or projects/by_slug; it is not called when the check is skipped.
type Resolver ¶
type Resolver struct {
URL, Username string
Env func(string) string
Store Store
Secret SecretSource
HTTP *http.Client
Now func() time.Time
Warn func(code, message string)
}
func (*Resolver) ForceRefresh ¶
ForceRefresh renews the stored session regardless of its expiry (taiga auth refresh).