Documentation
¶
Index ¶
- Constants
- func APIURL() string
- func CheckDestination(stored, current string) error
- func Revoke(ctx context.Context, credential *Credential) error
- type ActAsSession
- type Credential
- type OAuth
- type SecretStore
- type Store
- func (s Store) ActAsPath() string
- func (s Store) ClearActAs(ctx context.Context) (*ActAsSession, error)
- func (s Store) Delete() error
- func (s Store) Load() (*Credential, []byte, error)
- func (s Store) LoadActAs() (*ActAsSession, []byte, error)
- func (s Store) LockActAs(ctx context.Context) (func(), error)
- func (s Store) Read(apiURL string) (*Credential, error)
- func (s Store) Save(credential Credential, expected []byte) error
- func (s Store) SaveActAs(session ActAsSession, expected []byte) error
Constants ¶
View Source
const ClientID = "bruin-cli"
View Source
const DefaultAPIURL = "https://cloud.getbruin.com/api/v1"
Variables ¶
This section is empty.
Functions ¶
func CheckDestination ¶
Types ¶
type ActAsSession ¶ added in v0.11.818
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 SecretStore ¶
type Store ¶
type Store struct {
Path string
Open func() (SecretStore, error)
}
func DefaultStore ¶
func (Store) ClearActAs ¶ added in v0.11.818
func (s Store) ClearActAs(ctx context.Context) (*ActAsSession, error)
ClearActAs removes the session file even when it is corrupt, returning an empty session in that case.
func (Store) LoadActAs ¶ added in v0.11.818
func (s Store) LoadActAs() (*ActAsSession, []byte, error)
LoadActAs also returns the raw file so a later save can detect concurrent changes.
Click to show internal directories.
Click to hide internal directories.