accounts

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateToken

func GenerateToken(opts *TokenProviderOptions, name string, expiresIn int64) (string, error)

GenerateToken generate a token for the account with the specified name. expiresIn specify the duration before the token will expire; by default: no expiration.

func Login

func Login(opts *TokenProviderOptions, user, pass string) (string, error)

Login do a login with username and password credentials and returns the auth token.

Types

type TokenProvider

type TokenProvider interface {
	CreateSession(username, password string) (string, error)
	CreateTokenForAccount(name string) (string, error)
	SetAuthToken(token string)
}

TokenProvider defines an interface for interaction with an Argo CD server.

func NewTokenProvider

func NewTokenProvider(opts *TokenProviderOptions) (TokenProvider, error)

NewTokenProvider creates a new ArgoCD token provider from a set of config options.

type TokenProviderOptions

type TokenProviderOptions struct {
	ServerUrl   string
	UserAgent   string
	AuthToken   string
	DebugClient bool
}

TokenProviderOptions hold url, auth token for the API client.

Jump to

Keyboard shortcuts

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