auth

package
v0.0.0-...-e8c0a84 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package auth resolves credentials for the Marmot SDK.

Index

Constants

View Source
const K8sSATokenPath = "/var/run/secrets/kubernetes.io/serviceaccount/token" //nolint:gosec

Variables

This section is empty.

Functions

func ConfigDir

func ConfigDir() (string, error)

ConfigDir returns the Marmot CLI config directory (MARMOT_CONFIG_DIR or ~/.config/marmot).

Types

type Credential

type Credential interface {
	Token() string
	Scheme() Scheme
	Source() string
	AuthInfo() runtime.ClientAuthInfoWriter
}

Credential signs requests to the Marmot API.

func APIKey

func APIKey(token string) Credential

func Bearer

func Bearer(token string) Credential

func CachedToken

func CachedToken(context string) Credential

CachedToken returns the OAuth token written by `marmot login` for the named context, or nil if missing or expired.

func WorkloadCredential

func WorkloadCredential() Credential

WorkloadCredential returns an in-cluster Kubernetes service-account credential, or nil if none is available.

type Scheme

type Scheme string
const (
	SchemeAPIKey Scheme = "X-API-Key" //nolint:gosec // HTTP header name, not a credential
	SchemeBearer Scheme = "Bearer"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL