server

package
v0.0.0-...-bad12e4 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAllowed

func IsAllowed(filePath, dashboardName string) (bool, error)

IsAllowed loads the allowed list file and checks if the dashboard exists.

Types

type Config

type Config struct {
	Region           string        `mapstructure:"SKPR_COGNITO_TO_DASHBOARD_REGION"`
	ClientID         string        `mapstructure:"SKPR_COGNITO_TO_DASHBOARD_CLIENT_ID"`
	Host             string        `mapstructure:"SKPR_COGNITO_TO_DASHBOARD_HOST"`
	Scope            []string      `mapstructure:"SKPR_COGNITO_TO_DASHBOARD_SCOPE"`
	Callback         string        `mapstructure:"SKPR_COGNITO_TO_DASHBOARD_CALLBACK"`
	IdentityPool     string        `mapstructure:"SKPR_COGNITO_TO_DASHBOARD_IDENTITY_POOL"`
	IdentityProvider string        `mapstructure:"SKPR_COGNITO_TO_DASHBOARD_IDENTITY_PROVIDER"`
	SessionDuration  int           `mapstructure:"SKPR_COGNITO_TO_DASHBOARD_SESSION_DURATION"`
	StorageRetention time.Duration `mapstructure:"SKPR_COGNITO_TO_DASHBOARD_STORAGE_RETENTION"`
	AllowedListPath  string        `mapstructure:"SKPR_COGNITO_TO_DASHBOARD_ALLOWED_LIST_PATH"`
}

func LoadConfig

func LoadConfig(path string) (Config, error)

LoadConfig reads configuration from file or environment variables.

func (Config) Validate

func (c Config) Validate() error

Validate validates the config.

type DashboardServer

type DashboardServer struct {
	// contains filtered or unexported fields
}

func NewDashboardServer

func NewDashboardServer(ctx context.Context, config Config, cognito credentials.CognitoClient, storage StorageClient) *DashboardServer

func (*DashboardServer) Callback

func (s *DashboardServer) Callback(c *gin.Context)

func (*DashboardServer) GoTo

func (s *DashboardServer) GoTo(c *gin.Context)

func (*DashboardServer) Readyz

func (s *DashboardServer) Readyz(c *gin.Context)

type StorageClient

type StorageClient interface {
	Set(string, interface{}, time.Duration)
	Get(string) (interface{}, bool)
}

Jump to

Keyboard shortcuts

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