auth

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInterrupted = errors.New("interrupted")
View Source
var RefreshAccessToken = refreshAccessToken

RefreshAccessToken exchanges a refresh token for a new access token. It is a package-level variable so tests can replace it with a stub without needing to manipulate the internal clientIds map.

Functions

func ReadToken

func ReadToken(f fs.File) (string, error)

func ReadTokenFromStdin

func ReadTokenFromStdin() (string, error)

Types

type Claims

type Claims struct {
	Audience string    `json:"aud"`
	OrgName  string    `json:"orgName"`
	OrgId    string    `json:"orgId"`
	Email    string    `json:"email"`
	Expiry   time.Time `json:"exp"`
}

type LoginOpts

type LoginOpts struct {
	BaseURL string
	APIURL  string
	Org     string
}

type Token

type Token struct {
	Token        string
	Claims       Claims
	RefreshToken string `json:"refresh_token,omitempty"`
	AuthBaseURL  string `json:"auth_base_url,omitempty"`
}

func ParseToken

func ParseToken(token string) (*Token, error)

func TokenFromOAuth

func TokenFromOAuth(ctx context.Context, opts LoginOpts) (*Token, error)

Jump to

Keyboard shortcuts

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