cloudauth

package
v0.11.765 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const ClientID = "bruin-cli"
View Source
const DefaultAPIURL = "https://cloud.getbruin.com/api/v1"

Variables

This section is empty.

Functions

func APIURL

func APIURL() string

func CheckDestination

func CheckDestination(stored, current string) error

func Revoke

func Revoke(ctx context.Context, credential *Credential) error

Types

type Credential

type Credential struct {
	Token       string    `json:"access_token"`
	TokenType   string    `json:"token_type"`
	TokenID     string    `json:"token_id"`
	Account     string    `json:"account"`
	DefaultTeam string    `json:"default_team"`
	ExpiresAt   time.Time `json:"expires_at"`
	Abilities   []string  `json:"abilities"`
	Teams       []string  `json:"teams"`
	APIURL      string    `json:"-"`
	// contains filtered or unexported fields
}

type OAuth

type OAuth struct {
	APIURL      string
	OpenBrowser func(context.Context, string) error
	Writer      io.Writer
	NoBrowser   bool
}

func (OAuth) Login

func (o OAuth) Login(ctx context.Context, target string) (*Credential, error)

type SecretStore

type SecretStore interface {
	Get(key string) (keyring.Item, error)
	Set(item keyring.Item) error
	Remove(key string) error
}

type Store

type Store struct {
	Path string
	Open func() (SecretStore, error)
}

func DefaultStore

func DefaultStore() (Store, error)

func (Store) Delete

func (s Store) Delete() error

func (Store) Load

func (s Store) Load() (*Credential, []byte, error)

func (Store) Read

func (s Store) Read(apiURL string) (*Credential, error)

func (Store) Save

func (s Store) Save(credential Credential, expected []byte) error

Jump to

Keyboard shortcuts

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