utils

package
v0.2.12 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidServiceName = fmt.Errorf("invalid name")
)
View Source
var (
	Scopes = []string{
		"openid",
		"profile",
		"offline_access",
	}
)

Auth Vars

Functions

func CheckErr added in v0.0.30

func CheckErr(err error)

func ClientLogin added in v0.0.26

func ClientLogin(ctx context.Context, clientId string, clientSecret string) error

func GetGrpcTrailer

func GetGrpcTrailer() grpc.CallOption

func GetSupportedRuntimes

func GetSupportedRuntimes() []string

func IsValidName

func IsValidName(s string) bool

func IsValidRuntime added in v0.0.32

func IsValidRuntime(runtime string) bool

func NewAnonymousConnection

func NewAnonymousConnection() (*grpc.ClientConn, error)

func NewApiConnection

func NewApiConnection(ctx context.Context, cfg *ApiConnectionConfig) (*grpc.ClientConn, error)

func NewApiConnectionByEnv

func NewApiConnectionByEnv(ctx context.Context, envType clienv.NucleusEnv) (*grpc.ClientConn, error)

func NewAuthenticatedConnection

func NewAuthenticatedConnection(accessToken string) (*grpc.ClientConn, error)

func OAuthLogin added in v0.0.30

func OAuthLogin(ctx context.Context) error

func PromptToProceed

func PromptToProceed(cmd *cobra.Command, environmentName string, yesPromptFlagName string) error

func RenderLoginErrorPage added in v0.0.30

func RenderLoginErrorPage(wr io.Writer, data LoginPageErrorData) error

func RenderLoginSuccessPage added in v0.0.30

func RenderLoginSuccessPage(wr io.Writer, data LoginPageData) error

Types

type ApiConnectionConfig

type ApiConnectionConfig struct {
	AuthBaseUrl  string
	AuthClientId string
	ApiAudience  string
}

func GetApiConnectionConfigByEnv

func GetApiConnectionConfigByEnv(envType clienv.NucleusEnv) *ApiConnectionConfig

type LoginPageData added in v0.0.30

type LoginPageData struct {
	Title string
}

type LoginPageErrorData added in v0.0.30

type LoginPageErrorData struct {
	Title string

	ErrorCode        string
	ErrorDescription string
}

Jump to

Keyboard shortcuts

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