types

package
v0.3.13 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProjectOutputStatusInProgress indicates that the transformation is ongoing
	ProjectOutputStatusInProgress = "transforming"
	// ProjectOutputStatusDoneSuccess indicates that the transformation completed successfully
	ProjectOutputStatusDoneSuccess = "done"
	// ProjectOutputStatusDoneError indicates an error like if the transformation was cancelled or the timeout expired
	ProjectOutputStatusDoneError = "error"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudEvent added in v0.3.0

type CloudEvent struct {
	SpecVersion     string                 `json:"specversion"`
	Type            string                 `json:"type"`
	Source          string                 `json:"source"`
	Id              string                 `json:"id"`
	Subject         string                 `json:"subject"`
	Time            string                 `json:"time"`
	DataContentType string                 `json:"datacontenttype"`
	Data            map[string]interface{} `json:"data"`
}

CloudEvent contains the data associated with an event in the Cloud Event spec

type ConfigT added in v0.3.0

type ConfigT struct {
	VersionLong                  bool     `mapstructure:"version-long"`
	SecureCookies                bool     `mapstructure:"secure-cookies"`
	AuthEnabled                  bool     `mapstructure:"auth-enabled"`
	EnableLocalExecution         bool     `mapstructure:"enable-local-execution"`
	CleanStartup                 bool     `mapstructure:"clean-startup"`
	CleanUpAfterTransform        bool     `mapstructure:"clean-up-after-transform"`
	CloudEventsEnabled           bool     `mapstructure:"cloud-events-enabled"`
	Port                         int      `mapstructure:"port"`
	CookieMaxAge                 int      `mapstructure:"cookie-max-age"`
	MaxUploadSize                int64    `mapstructure:"max-upload-size"`
	PlanTimeoutSeconds           int64    `mapstructure:"plan-timeout-seconds"`
	TransformTimeoutSeconds      int64    `mapstructure:"transform-timeout-seconds"`
	LogLevel                     string   `mapstructure:"log-level"`
	LogFile                      string   `mapstructure:"log-file"`
	CorsAllowOrigin              string   `mapstructure:"cors-allow-origin"`
	DataDir                      string   `mapstructure:"data-dir"`
	StaticFilesDir               string   `mapstructure:"static-files-dir"`
	SessionSecret                string   `mapstructure:"session-secret"`
	CurrentHost                  string   `mapstructure:"current-host"`
	AuthServer                   string   `mapstructure:"auth-server"`
	AuthServerBasePath           string   `mapstructure:"auth-server-base-path"`
	AuthServerLoginPath          string   `mapstructure:"auth-server-login-path"`
	AuthServerTimeout            int      `mapstructure:"auth-server-timeout"`
	AuthServerRealm              string   `mapstructure:"auth-server-realm"`
	OIDCDiscoveryEndpointPath    string   `mapstructure:"oidc-discovery-endpoint-path"`
	UMAConfigurationEndpointPath string   `mapstructure:"uma-configuration-endpoint-path"`
	M2kClientClientId            string   `mapstructure:"m2k-client-client-id"`
	M2kClientClientSecret        string   `mapstructure:"m2k-client-client-secret"`
	M2kClientIdNotClientId       string   `mapstructure:"m2k-client-id-not-client-id"`
	M2kServerClientId            string   `mapstructure:"m2k-server-client-id"`
	M2kServerClientSecret        string   `mapstructure:"m2k-server-client-secret"`
	DefaultResourceId            string   `mapstructure:"default-resource-id"`
	Host                         string   `mapstructure:"host"`
	CertPath                     string   `mapstructure:"https-cert"`
	KeyPath                      string   `mapstructure:"https-key"`
	CloudEventsEndpoint          string   `mapstructure:"cloud-events-endpoint"`
	CloudEventsAccessToken       string   `mapstructure:"cloud-events-access-token"`
	CloudEventsSpecVersion       string   `mapstructure:"cloud-events-spec-version"`
	CloudEventsType              string   `mapstructure:"cloud-events-type"`
	CloudEventsSubject           string   `mapstructure:"cloud-events-subject"`
	OIDCInfo                     OIDCInfo `mapstructure:"-"`
	UMAInfo                      UMAInfo  `mapstructure:"-"`
}

ConfigT hold the entire configuration for starting the server

func (ConfigT) M2kClientBasicAuth added in v0.3.0

func (c ConfigT) M2kClientBasicAuth() string

M2kClientBasicAuth returns the encoded basic auth using client id and secret

func (ConfigT) M2kServerBasicAuth added in v0.3.0

func (c ConfigT) M2kServerBasicAuth() string

M2kServerBasicAuth returns the encoded basic auth using server id and secret

func (ConfigT) String added in v0.3.0

func (c ConfigT) String() string

type ErrorDoesNotExist added in v0.3.0

type ErrorDoesNotExist struct{ Id string }

ErrorDoesNotExist is returned when the object does not exist

func (ErrorDoesNotExist) Error added in v0.3.0

func (e ErrorDoesNotExist) Error() string

type ErrorIdAlreadyInUse added in v0.3.0

type ErrorIdAlreadyInUse struct{ Id string }

ErrorIdAlreadyInUse is returned when the Id is already in use.

func (ErrorIdAlreadyInUse) Error added in v0.3.0

func (e ErrorIdAlreadyInUse) Error() string

type ErrorOngoing added in v0.3.0

type ErrorOngoing struct{ Id string }

ErrorOngoing is returned when the plan/transformation is ongoing.

func (ErrorOngoing) Error added in v0.3.0

func (e ErrorOngoing) Error() string

type ErrorSessionDoesNotExist added in v0.3.0

type ErrorSessionDoesNotExist struct{}

ErrorSessionDoesNotExist is returned when the session doesn't exist

func (ErrorSessionDoesNotExist) Error added in v0.3.0

type ErrorTokenExpired added in v0.3.0

type ErrorTokenExpired struct{ Exp int64 }

ErrorTokenExpired is returned when the token has expired

func (ErrorTokenExpired) Error added in v0.3.0

func (e ErrorTokenExpired) Error() string

type ErrorTokenUnverifiable added in v0.3.0

type ErrorTokenUnverifiable struct{}

ErrorTokenUnverifiable is returned when the token cannot be verified

func (ErrorTokenUnverifiable) Error added in v0.3.0

func (e ErrorTokenUnverifiable) Error() string

type ErrorValidation added in v0.3.0

type ErrorValidation struct{ Reason string }

ErrorValidation is returned when the request fails validation.

func (ErrorValidation) Error added in v0.3.0

func (e ErrorValidation) Error() string

type Metadata added in v0.3.0

type Metadata struct {
	Id          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Timestamp   string `json:"timestamp"`
}

Metadata is generic metadata applicable to a wide variety of types

type OIDCInfo added in v0.3.0

type OIDCInfo struct {
	Issuer                                                    string            `json:"issuer"`
	AuthorizationEndpoint                                     string            `json:"authorization_endpoint"`
	TokenEndpoint                                             string            `json:"token_endpoint"`
	IntrospectionEndpoint                                     string            `json:"introspection_endpoint"`
	UserinfoEndpoint                                          string            `json:"userinfo_endpoint"`
	EndSessionEndpoint                                        string            `json:"end_session_endpoint"`
	JwksURI                                                   string            `json:"jwks_uri"`
	CheckSessionIframe                                        string            `json:"check_session_iframe"`
	GrantTypesSupported                                       []string          `json:"grant_types_supported,omitempty"`
	ResponseTypesSupported                                    []string          `json:"response_types_supported,omitempty"`
	SubjectTypesSupported                                     []string          `json:"subject_types_supported,omitempty"`
	IdTokenSigningAlgValuesSupported                          []string          `json:"id_token_signing_alg_values_supported,omitempty"`
	IdTokenEncryptionAlgValuesSupported                       []string          `json:"id_token_encryption_alg_values_supported,omitempty"`
	IdTokenEncryptionEncValuesSupported                       []string          `json:"id_token_encryption_enc_values_supported,omitempty"`
	UserinfoSigningAlgValuesSupported                         []string          `json:"userinfo_signing_alg_values_supported,omitempty"`
	RequestObjectSigningAlgValuesSupported                    []string          `json:"request_object_signing_alg_values_supported,omitempty"`
	RequestObjectEncryptionAlgValuesSupported                 []string          `json:"request_object_encryption_alg_values_supported,omitempty"`
	RequestObjectEncryptionEncValuesSupported                 []string          `json:"request_object_encryption_enc_values_supported,omitempty"`
	ResponseModesSupported                                    []string          `json:"response_modes_supported,omitempty"`
	RegistrationEndpoint                                      string            `json:"registration_endpoint"`
	TokenEndpointAuthMethodsSupported                         []string          `json:"token_endpoint_auth_methods_supported,omitempty"`
	TokenEndpointAuthSigningAlgValuesSupported                []string          `json:"token_endpoint_auth_signing_alg_values_supported,omitempty"`
	IntrospectionEndpointAuthMethodsSupported                 []string          `json:"introspection_endpoint_auth_methods_supported,omitempty"`
	IntrospectionEndpointAuthSigningAlgValuesSupported        []string          `json:"introspection_endpoint_auth_signing_alg_values_supported,omitempty"`
	AuthorizationSigningAlgValuesSupported                    []string          `json:"authorization_signing_alg_values_supported,omitempty"`
	AuthorizationEncryptionAlgValuesSupported                 []string          `json:"authorization_encryption_alg_values_supported,omitempty"`
	AuthorizationEncryptionEncValuesSupported                 []string          `json:"authorization_encryption_enc_values_supported,omitempty"`
	ClaimsSupported                                           []string          `json:"claims_supported,omitempty"`
	ClaimTypesSupported                                       []string          `json:"claim_types_supported,omitempty"`
	ClaimsParameterSupported                                  bool              `json:"claims_parameter_supported"`
	ScopesSupported                                           []string          `json:"scopes_supported,omitempty"`
	RequestParameterSupported                                 bool              `json:"request_parameter_supported"`
	RequestUriParameterSupported                              bool              `json:"request_uri_parameter_supported"`
	RequireRequestUriRegistration                             bool              `json:"require_request_uri_registration"`
	CodeChallengeMethodsSupported                             []string          `json:"code_challenge_methods_supported,omitempty"`
	TlsClientCertificateBoundAccessTokens                     bool              `json:"tls_client_certificate_bound_access_tokens"`
	RevocationEndpoint                                        string            `json:"revocation_endpoint"`
	RevocationEndpointAuthMethodsSupported                    []string          `json:"revocation_endpoint_auth_methods_supported,omitempty"`
	RevocationEndpointAuthSigningAlgValuesSupported           []string          `json:"revocation_endpoint_auth_signing_alg_values_supported,omitempty"`
	BackchannelLogoutSupported                                bool              `json:"backchannel_logout_supported"`
	BackchannelLogoutSessionSupported                         bool              `json:"backchannel_logout_session_supported"`
	DeviceAuthorizationEndpoint                               string            `json:"device_authorization_endpoint"`
	BackchannelTokenDeliveryModesSupported                    []string          `json:"backchannel_token_delivery_modes_supported,omitempty"`
	BackchannelAuthenticationEndpoint                         string            `json:"backchannel_authentication_endpoint"`
	BackchannelAuthenticationRequestSigningAlgValuesSupported []string          `json:"backchannel_authentication_request_signing_alg_values_supported,omitempty"`
	RequirePushedAuthorizationRequests                        bool              `json:"require_pushed_authorization_requests"`
	PushedAuthorizationRequestEndpoint                        string            `json:"pushed_authorization_request_endpoint"`
	MtlsEndpointAliases                                       map[string]string `json:"mtls_endpoint_aliases"`
}

OIDCInfo contains the info returned by the OIDC discovery endpoint

type PermRequest added in v0.3.0

type PermRequest struct {
	ResourceId     string   `json:"resource_id"`
	ResourceScopes []string `json:"resource_scopes"`
}

PermRequest contains the permission request used in the UMA grant flow

type PermTicket added in v0.3.0

type PermTicket struct {
	Ticket string `json:"ticket"`
}

PermTicket contains the ticket used in the UMA grant flow

type Project added in v0.3.0

type Project struct {
	Metadata
	Inputs  map[string]ProjectInput  `json:"inputs,omitempty"`
	Outputs map[string]ProjectOutput `json:"outputs,omitempty"`
	Status  map[ProjectStatus]bool   `json:"status,omitempty"`
}

Project holds information about a project

type ProjectInput added in v0.3.0

type ProjectInput struct {
	Metadata
	Type           ProjectInputType `json:"type"`
	NormalizedName string           `json:"normalized_name"`
}

ProjectInput holds information about a single input of a project

type ProjectInputType added in v0.3.0

type ProjectInputType string

ProjectInputType is the type of the project input

const (
	// ProjectInputSources is the type for project inputs that are folders containing source code
	ProjectInputSources ProjectInputType = ProjectInputType(ProjectStatusInputSources)
	// ProjectInputCustomizations is the type for project inputs that are folders containing customization files
	ProjectInputCustomizations ProjectInputType = ProjectInputType(ProjectStatusInputCustomizations)
	// ProjectInputConfigs is the type for project inputs that are config files
	ProjectInputConfigs ProjectInputType = ProjectInputType(ProjectStatusInputConfigs)
	// ProjectInputReference is the type for project inputs that are references to workspace level inputs
	ProjectInputReference ProjectInputType = ProjectInputType(ProjectStatusInputReference)
)

func ParseProjectInputType added in v0.3.0

func ParseProjectInputType(s string) (ProjectInputType, error)

ParseProjectInputType parses the string and returns a project input type if valid

type ProjectOutput added in v0.3.0

type ProjectOutput struct {
	Metadata
	Status ProjectOutputStatus `json:"status"`
}

ProjectOutput holds information about a single output of a project

type ProjectOutputStatus added in v0.3.0

type ProjectOutputStatus string

ProjectOutputStatus is the status of a project output

type ProjectStatus added in v0.3.0

type ProjectStatus string

ProjectStatus stores the current project status

const (
	// ProjectStatusRemoteInputSources indicates the project has a remlote git source
	ProjectStatusRemoteInputSources ProjectStatus = "remote"
	// ProjectStatusInputSources indicates the project has source folder uploaded
	ProjectStatusInputSources ProjectStatus = "sources"
	// ProjectStatusInputCustomizations indicates the project has customizations folder uploaded
	ProjectStatusInputCustomizations ProjectStatus = "customizations"
	// ProjectStatusInputConfigs indicates the project has configs
	ProjectStatusInputConfigs ProjectStatus = "configs"
	// ProjectStatusInputReference indicates the project has references to workspace level inputs
	ProjectStatusInputReference ProjectStatus = "reference"
	// ProjectStatusPlanning indicates the project is currently generating a plan
	ProjectStatusPlanning ProjectStatus = "planning"
	// ProjectStatusPlan indicates the project has a plan
	ProjectStatusPlan ProjectStatus = "plan"
	// ProjectStatusStalePlan indicates that the inputs have changed after the plan was last generated
	ProjectStatusStalePlan ProjectStatus = "stale_plan"
	// ProjectStatusPlanError indicates that an error occurred during planning
	ProjectStatusPlanError ProjectStatus = "plan_error"
	// ProjectStatusOutputs indicates the project has project artifacts generated
	ProjectStatusOutputs ProjectStatus = "outputs"
)

type QAServerMetadata added in v0.3.0

type QAServerMetadata struct {
	Host  string `json:"host" yaml:"host"`
	Port  int    `json:"port" yaml:"port"`
	Debug bool   `json:"debug" yaml:"debug"`
}

QAServerMetadata stores serializable runtime REST access information

type Role added in v0.3.0

type Role struct {
	Metadata
	Rules []RoleRule
}

Role contains all the information about a RBAC role

func FromAuthServerRole added in v0.3.0

func FromAuthServerRole(r gocloak.Role) Role

FromAuthServerRole converts an authz server role to a role

func (Role) GetRulesAsAttrs added in v0.3.0

func (r Role) GetRulesAsAttrs() map[string][]string

GetRulesAsAttrs flattens and returns the rules of the role as a map suitable for creating an authz server role

func (Role) ToAuthServerRole added in v0.3.0

func (r Role) ToAuthServerRole() (gocloak.Role, error)

ToAuthServerRole converts the role to an authz server role

type RoleRule added in v0.3.0

type RoleRule struct {
	Resources []string
	Verbs     []string
}

RoleRule contains the list of resources and the verbs allowed on those resources

type Tokens added in v0.3.0

type Tokens struct {
	AccessToken  string `json:"access_token"`
	IdToken      string `json:"id_token"`
	RefreshToken string `json:"refresh_token"`
}

Tokens contains all the tokens returned during login

type UMAInfo added in v0.3.0

type UMAInfo struct {
	Issuer                                     string   `json:"issuer"`
	AuthorizationEndpoint                      string   `json:"authorization_endpoint"`
	TokenEndpoint                              string   `json:"token_endpoint"`
	IntrospectionEndpoint                      string   `json:"introspection_endpoint"`
	EndSessionEndpoint                         string   `json:"end_session_endpoint"`
	JwksURI                                    string   `json:"jwks_uri"`
	GrantTypesSupported                        []string `json:"grant_types_supported,omitempty"`
	ResponseTypesSupported                     []string `json:"response_types_supported,omitempty"`
	ResponseModesSupported                     []string `json:"response_modes_supported,omitempty"`
	RegistrationEndpoint                       string   `json:"registration_endpoint"`
	TokenEndpointAuthMethodsSupported          []string `json:"token_endpoint_auth_methods_supported,omitempty"`
	TokenEndpointAuthSigningAlgValuesSupported []string `json:"token_endpoint_auth_signing_alg_values_supported,omitempty"`
	ScopesSupported                            []string `json:"scopes_supported,omitempty"`
	ResourceRegistrationEndpoint               string   `json:"resource_registration_endpoint"`
	PermissionEndpoint                         string   `json:"permission_endpoint"`
	PolicyEndpoint                             string   `json:"policy_endpoint"`
}

UMAInfo contains the info returned by the UMA well-known endpoint

type UserInfo added in v0.3.0

type UserInfo gocloak.UserInfo

UserInfo holds all the identifying information about the user

type Workspace added in v0.3.0

type Workspace struct {
	Metadata
	ProjectIds []string                `json:"project_ids,omitempty"`
	Inputs     map[string]ProjectInput `json:"inputs,omitempty"`
}

Workspace holds information about a workspace

Jump to

Keyboard shortcuts

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