config

package
v0.0.0-...-81e5c39 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClientID     = "sailpoint-cli"
	RedirectPort = "3000"
	RedirectPath = "/callback"
	RedirectURL  = "http://localhost:" + RedirectPort + RedirectPath
)
View Source
const OAuthSuccessPage = `` /* 904-byte string literal not displayed */

Variables

View Source
var ErrAccessTokenExpired = fmt.Errorf("accesstoken is expired")

Functions

func CacheOAuth

func CacheOAuth(set TokenSet) error

func CachePAT

func CachePAT(set PATSet) error

func CallbackHandler

func CallbackHandler(w http.ResponseWriter, r *http.Request)

func CheckToken

func CheckToken(tokenString string) error

func DeleteOAuthToken

func DeleteOAuthToken() error

func DeleteOAuthTokenExpiry

func DeleteOAuthTokenExpiry() error

func DeletePatToken

func DeletePatToken() error

func DeletePatTokenExpiry

func DeletePatTokenExpiry() error

func DeleteRefreshToken

func DeleteRefreshToken() error

func DeleteRefreshTokenExpiry

func DeleteRefreshTokenExpiry() error

func GetActiveEnvironment

func GetActiveEnvironment() string

func GetAuthToken

func GetAuthToken() (string, error)

func GetAuthType

func GetAuthType() string

func GetAuthorizeUrl

func GetAuthorizeUrl() string

func GetBaseUrl

func GetBaseUrl() string

func GetClientID

func GetClientID(env string) (string, error)

func GetClientSecret

func GetClientSecret(env string) (string, error)

func GetCustomExportTemplatePath

func GetCustomExportTemplatePath() string

func GetCustomReportTemplatePath

func GetCustomReportTemplatePath() string

func GetCustomSearchTemplatePath

func GetCustomSearchTemplatePath() string

func GetDebug

func GetDebug() bool

func GetEnvBaseUrl

func GetEnvBaseUrl(env string) string

func GetEnvTokenUrl

func GetEnvTokenUrl(env string) string

func GetEnvironments

func GetEnvironments() map[string]interface{}

func GetOAuthRefreshExpiry

func GetOAuthRefreshExpiry() (time.Time, error)

func GetOAuthToken

func GetOAuthToken() (string, error)

func GetOAuthTokenExpiry

func GetOAuthTokenExpiry() (time.Time, error)

func GetPatClientID

func GetPatClientID() (string, error)

func GetPatClientSecret

func GetPatClientSecret() (string, error)

func GetPatToken

func GetPatToken() (string, error)

func GetPatTokenExpiry

func GetPatTokenExpiry() (time.Time, error)

func GetRefreshToken

func GetRefreshToken() (string, error)

func GetTenantUrl

func GetTenantUrl() string

func GetTime

func GetTime(inputString string) (time.Time, error)

func GetTokenUrl

func GetTokenUrl() string

func InitAPIClient

func InitAPIClient() (*sailpoint.APIClient, error)

func InitConfig

func InitConfig() error

func PromptForClientID

func PromptForClientID() (string, error)

func PromptForClientSecret

func PromptForClientSecret() (string, error)

func ResetCacheOAuth

func ResetCacheOAuth() error

func ResetCachePAT

func ResetCachePAT() error

func SaveConfig

func SaveConfig() error

func SetActiveEnvironment

func SetActiveEnvironment(activeEnv string)

func SetAuthType

func SetAuthType(AuthType string)

func SetBaseUrl

func SetBaseUrl(baseUrl string)

func SetCustomExportTemplatePath

func SetCustomExportTemplatePath(customsearchtemplatespath string)

func SetCustomReportTemplatePath

func SetCustomReportTemplatePath(customreporttemplatespath string)

func SetCustomSearchTemplatePath

func SetCustomSearchTemplatePath(customsearchtemplatespath string)

func SetDebug

func SetDebug(Debug bool)

func SetOAuthRefreshExpiry

func SetOAuthRefreshExpiry(expiry time.Time) error

func SetOAuthToken

func SetOAuthToken(token string) error

func SetOAuthTokenExpiry

func SetOAuthTokenExpiry(expiry time.Time) error

func SetPatClientID

func SetPatClientID(ClientID string) error

func SetPatClientSecret

func SetPatClientSecret(ClientSecret string) error

func SetPatToken

func SetPatToken(token string) error

func SetPatTokenExpiry

func SetPatTokenExpiry(expiry time.Time) error

func SetRefreshToken

func SetRefreshToken(token string) error

func SetTenantUrl

func SetTenantUrl(tenantUrl string)

func SetTime

func SetTime(inputTime time.Time) string

func TestSecretsStorage

func TestSecretsStorage() bool

func Validate

func Validate() error

Types

type CLIConfig

type CLIConfig struct {

	//Standard Variables
	ExportTemplatesPath string `mapstructure:"exporttemplatespath"`
	SearchTemplatesPath string `mapstructure:"searchtemplatespath"`
	ReportTemplatesPath string `mapstructure:"reporttemplatespath"`

	Debug             bool                   `mapstructure:"debug"`
	AuthType          string                 `mapstructure:"authtype"`
	ActiveEnvironment string                 `mapstructure:"activeenvironment"`
	Environments      map[string]Environment `mapstructure:"environments"`

	//Pipeline Variables
	ClientID     string    `mapstructure:"clientid, omitempty"`
	ClientSecret string    `mapstructure:"clientsecret, omitempty"`
	BaseURL      string    `mapstructure:"base_url, omitempty"`
	AccessToken  string    `mapstructure:"accesstoken"`
	Expiry       time.Time `mapstructure:"expiry"`
}

func GetConfig

func GetConfig() (CLIConfig, error)

type Environment

type Environment struct {
	TenantURL string    `mapstructure:"tenanturl"`
	BaseURL   string    `mapstructure:"baseurl"`
	Pat       PatConfig `mapstructure:"pat"`
	OAuth     Token     `mapstructure:"oauth"`
}

type PATSet

type PATSet struct {
	AccessToken  string
	AccessExpiry time.Time
}

func PATLogin

func PATLogin() (PATSet, error)

type PatConfig

type PatConfig struct {
	ClientID     string    `mapstructure:"clientid"`
	ClientSecret string    `mapstructure:"clientsecret"`
	AccessToken  string    `mapstructure:"accesstoken"`
	Expiry       time.Time `mapstructure:"expiry"`
}

type RefreshResponse

type RefreshResponse struct {
	AccessToken         string `json:"access_token"`
	TokenType           string `json:"token_type"`
	RefreshToken        string `json:"refresh_token"`
	ExpiresIn           int    `json:"expires_in"`
	Scope               string `json:"scope"`
	TenantID            string `json:"tenant_id"`
	Internal            bool   `json:"internal"`
	Pod                 string `json:"pod"`
	StrongAuthSupported bool   `json:"strong_auth_supported"`
	Org                 string `json:"org"`
	ClaimsSupported     bool   `json:"claims_supported"`
	IdentityID          string `json:"identity_id"`
	StrongAuth          bool   `json:"strong_auth"`
	Jti                 string `json:"jti"`
}

type Token

type Token struct {
	AccessToken string    `mapstructure:"accesstoken"`
	Expiry      time.Time `mapstructure:"expiry"`

	RefreshToken  string    `mapstructure:"refreshtoken"`
	RefreshExpiry time.Time `mapstructure:"refreshexpiry"`
}

type TokenResponse

type TokenResponse struct {
	AccessToken string `json:"access_token"`
	ExpiresIn   int    `json:"expires_in"`
}

type TokenSet

type TokenSet struct {
	AccessToken   string
	AccessExpiry  time.Time
	RefreshToken  string
	RefreshExpiry time.Time
}

func OAuthLogin

func OAuthLogin() (TokenSet, error)

func RefreshOAuth

func RefreshOAuth() (TokenSet, error)

Jump to

Keyboard shortcuts

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