config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigFile                string = "credentials"
	ConfigFolder              string = ".auth0"
	AppName                   string = "auth0-cli"
	EnvSessionBearerToken     string = "AUTH0_SESSION_TOKEN"
	EnvSessionTokenExpiryTime string = "AUTH0_SESSION_EXPIRY"
	EnvSessionTenant          string = "AUTH0_TENANT"
	EnvSessionApiUrl          string = "AUTH0_SESSION_API_URL"
	Auth0ApiVersion           string = "v2"
)

Variables

View Source
var ConfigPath = fmt.Sprintf("%s/%s/%s", HomeDir, ConfigFolder, ConfigFile)
View Source
var HomeDir = os.Getenv("HOME")

Functions

func Auth0ApiBaseUrl

func Auth0ApiBaseUrl(domain string) string

func Auth0ApiOauthUrl

func Auth0ApiOauthUrl(domain string) string

func CheckFileExists

func CheckFileExists(fs FileSystem, filePath string) bool

func CreateConfigFolder

func CreateConfigFolder()

func ReadCredentialsFile

func ReadCredentialsFile(filePath string, tenant string) (*ini.File, error)

func SaveCredentialsFile

func SaveCredentialsFile(config ClientAuth) error

Types

type ClientAuth

type ClientAuth struct {
	ClientID     string
	ClientSecret string
	Tenant       string
	ApiDomain    string
}

func GetCredentials

func GetCredentials(tenant string) (*ClientAuth, error)

type FileSystem

type FileSystem interface {
	Stat(name string) (os.FileInfo, error)
}

type OSFileSystem

type OSFileSystem struct{}

func (OSFileSystem) Stat

func (OSFileSystem) Stat(name string) (os.FileInfo, error)

Jump to

Keyboard shortcuts

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