auth

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2021 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultEnv = "prod"
View Source
const SCloudHome = "SCLOUD_HOME"
View Source
const (

	// use ScloudTestDone to indicate the scloud test command is done when using testhook-dryrun flag
	ScloudTestDone = "Test Command is done\n"
)

Variables

This section is empty.

Functions

func Abspath

func Abspath(p string) string

Returns an absolute path. If the given path is not absolute it looks for the environment variable SCLOUD HOME and is joined with that. If the environment variable is not defined, the path is joined with the path to the home dir

func DeviceFlow added in v1.11.1

func DeviceFlow(profile map[string]string, cmd *cobra.Command) (*idp.Context, error)

func FromToml

func FromToml(ctx *idp.Context, t *toml.Tree) error

func GetClient

func GetClient() (*sdk.Client, error)

func GetClientID added in v1.8.0

func GetClientID(cmd *cobra.Command) (string, error)

Return client id

func GetClientSystemTenant

func GetClientSystemTenant() (*sdk.Client, error)

func GetContext added in v1.7.0

func GetContext(cmd *cobra.Command) *idp.Context

Returns the context from .scloud_context

func GetCurrentContext added in v1.8.0

func GetCurrentContext(clientID string) *idp.Context

Returns the cached authorization context associated with the given clientID.

func GetEnvironmentName added in v1.7.0

func GetEnvironmentName() string

Returns the name of the selected environment.

func GetEnvironmentProfile added in v1.7.0

func GetEnvironmentProfile() (map[string]string, error)

func GetFlow added in v1.7.0

func GetFlow(kind string) (func(map[string]string, *cobra.Command) (*idp.Context, error), error)

Return the correct flow function

func GetProfile

func GetProfile(name string) (map[string]string, error)

Returns the named application profile.

func GetProfileName added in v1.7.0

func GetProfileName() string

Returns the name of the selected app profile.

func Login

func Login(cmd *cobra.Command, authFlow func(map[string]string, *cobra.Command) (*idp.Context, error)) (*idp.Context, error)

Authenticate, using the selected app profile.

func LoginSetUp added in v1.7.0

func LoginSetUp() error

func PkceFlow added in v1.7.0

func PkceFlow(profile map[string]string, cmd *cobra.Command) (*idp.Context, error)

func RefreshFlow added in v1.7.0

func RefreshFlow(profile map[string]string, cmd *cobra.Command) (*idp.Context, error)

func SetContext added in v1.7.0

func SetContext(cmd *cobra.Command, context map[string]interface{})

Set context in .scloud_context

func ToMap added in v1.8.0

func ToMap(ctx *idp.Context) map[string]interface{}

Types

type Cfg

type Cfg struct {
	Profiles     map[string]map[string]string `yaml:"profiles"`
	Environments map[string]*Environment      `yaml:"environments"`
}

type Environment

type Environment struct {
	APIService Service    `yaml:"api-service"`
	AppService Service    `yaml:"app-service"`
	IdpService IdpService `yaml:"idp-service"`
	Profile    string     `yaml:"profile"`
}

func GetEnvironment

func GetEnvironment(name string) (*Environment, error)

type GlogWrapper

type GlogWrapper struct {
}

GlogWrapper is used to wrap glog.info() in a Print() function usable by splunk-cloud-sdk-go

func (*GlogWrapper) Print

func (gw *GlogWrapper) Print(v ...interface{})

type IdpService

type IdpService struct {
	Host   string `yaml:"host"`
	Port   string `yaml:"port"`
	Scheme string `yaml:"scheme"`
	Server string `yaml:"server"`
}

type ScloudTesExecCancledError

type ScloudTesExecCancledError struct {
}

func (ScloudTesExecCancledError) Error

func (ste ScloudTesExecCancledError) Error() string

type Service

type Service struct {
	Host   string `yaml:"host"`
	Port   string `yaml:"port"`
	Scheme string `yaml:"scheme"`
}

Directories

Path Synopsis
Package statik contains static assets.
Package statik contains static assets.

Jump to

Keyboard shortcuts

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