rest

package
v2.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTokenAuthFilter

func NewTokenAuthFilter(
	findServiceAccountByTokenFn func(
		ctx context.Context,
		token string,
	) (api.ServiceAccount, error),
	findSessionFn func(ctx context.Context, token string) (api.Session, error),
	findEventByTokenFn func(
		ctx context.Context,
		token string,
	) (api.Event, error),
	config *TokenAuthFilterConfig,
) restmachinery.Filter

NewTokenAuthFilter returns an implementation of the restmachinery.Filter interface that decorates an http.HandlerFunc to carry out request authentication by extracting an opaque bearer token form the HTTP Authorization header and using that token to locate an established Session.

Types

type AuthnEndpoints added in v2.3.0

type AuthnEndpoints struct {
	AuthFilter restmachinery.Filter
	Service    api.PrincipalsService
}

func (*AuthnEndpoints) Register added in v2.3.0

func (a *AuthnEndpoints) Register(router *mux.Router)

type EventsEndpoints

type EventsEndpoints struct {
	AuthFilter               restmachinery.Filter
	EventSchemaLoader        gojsonschema.JSONLoader
	SourceStateSchemaLoader  gojsonschema.JSONLoader
	EventSummarySchemaLoader gojsonschema.JSONLoader
	Service                  api.EventsService
}

func (*EventsEndpoints) Register

func (e *EventsEndpoints) Register(router *mux.Router)

type JobsEndpoints

type JobsEndpoints struct {
	AuthFilter            restmachinery.Filter
	JobSchemaLoader       gojsonschema.JSONLoader
	JobStatusSchemaLoader gojsonschema.JSONLoader
	Service               api.JobsService
}

JobsEndpoints implements restmachinery.Endpoints to provide Job-related URL --> action mappings to a restmachinery.Server.

func (*JobsEndpoints) Register

func (j *JobsEndpoints) Register(router *mux.Router)

Register is invoked by restmachinery.Server to register Job-related URL --> action mappings to a restmachinery.Server.

type LogsEndpoints

type LogsEndpoints struct {
	AuthFilter restmachinery.Filter
	Service    api.LogsService
}

LogsEndpoints implements restmachinery.Endpoints to provide log-related URL --> action mappings to a restmachinery.Server.

func (*LogsEndpoints) Register

func (l *LogsEndpoints) Register(router *mux.Router)

Register is invoked by restmachinery.Server to register log-related URL --> action mappings to a restmachinery.Server.

type PingResponse

type PingResponse struct {
	Version string
	Commit  string
}

PingResponse represents the response object returned by the ping endpoint

func (PingResponse) MarshalJSON

func (p PingResponse) MarshalJSON() ([]byte, error)

MarshalJSON amends PingResponse instances with type metadata.

type ProjectRoleAssignmentsEndpoints

type ProjectRoleAssignmentsEndpoints struct {
	AuthFilter                        restmachinery.Filter
	ProjectRoleAssignmentSchemaLoader gojsonschema.JSONLoader
	Service                           api.ProjectRoleAssignmentsService
}

ProjectRoleAssignmentsEndpoints implements restmachinery.Endpoints to provide ProjectRoleAssignment-related URL --> action mappings to a restmachinery.Server.

func (*ProjectRoleAssignmentsEndpoints) Register

func (p *ProjectRoleAssignmentsEndpoints) Register(router *mux.Router)

type ProjectsEndpoints

type ProjectsEndpoints struct {
	AuthFilter          restmachinery.Filter
	ProjectSchemaLoader gojsonschema.JSONLoader
	Service             api.ProjectsService
}

ProjectsEndpoints implements restmachinery.Endpoints to provide Project-related URL --> action mappings to a restmachinery.Server.

func (*ProjectsEndpoints) Register

func (p *ProjectsEndpoints) Register(router *mux.Router)

Register is invoked by restmachinery.Server to register Project-related URL --> action mappings to a restmachinery.Server.

type RoleAssignmentsEndpoints

type RoleAssignmentsEndpoints struct {
	AuthFilter                 restmachinery.Filter
	RoleAssignmentSchemaLoader gojsonschema.JSONLoader
	Service                    api.RoleAssignmentsService
}

RoleAssignmentsEndpoints implements restmachinery.Endpoints to provide RoleAssignments-related URL --> action mappings to a restmachinery.Server.

func (*RoleAssignmentsEndpoints) Register

func (r *RoleAssignmentsEndpoints) Register(router *mux.Router)

type SecretsEndpoints

type SecretsEndpoints struct {
	AuthFilter         restmachinery.Filter
	SecretSchemaLoader gojsonschema.JSONLoader
	Service            api.SecretsService
}

func (*SecretsEndpoints) Register

func (s *SecretsEndpoints) Register(router *mux.Router)

type ServiceAccountEndpoints

type ServiceAccountEndpoints struct {
	AuthFilter                 restmachinery.Filter
	ServiceAccountSchemaLoader gojsonschema.JSONLoader
	Service                    api.ServiceAccountsService
}

func (*ServiceAccountEndpoints) Register

func (s *ServiceAccountEndpoints) Register(router *mux.Router)

type SessionsEndpoints

type SessionsEndpoints struct {
	AuthFilter restmachinery.Filter
	Service    api.SessionsService
}

SessionsEndpoints implements restmachinery.Endpoints to provide Session-related URL --> action mappings to a restmachinery.Server.

func (*SessionsEndpoints) Register

func (s *SessionsEndpoints) Register(router *mux.Router)

Register is invoked by restmachinery.Server to register Session-related URL --> action mappings to a restmachinery.Server.

type SubstrateEndpoints

type SubstrateEndpoints struct {
	AuthFilter restmachinery.Filter
	Service    api.SubstrateService
}

SubstrateEndpoints implements restmachinery.Endpoints to provide Substrate-related URL --> action mappings to a restmachinery.Server.

func (*SubstrateEndpoints) Register

func (s *SubstrateEndpoints) Register(router *mux.Router)

Register is invoked by restmachinery.Server to register Project-related URL --> action mappings to a restmachinery.Server.

type SystemEndpoints

type SystemEndpoints struct {
	DatabaseClient *mongo.Client
	WriterFactory  queue.WriterFactory
}

SystemEndpoints implements restmachinery.Endpoints to provide System-related URL --> action mappings to a restmachinery.Server.

func (*SystemEndpoints) Register

func (h *SystemEndpoints) Register(router *mux.Router)

Register is invoked by restmachinery.Server to register System-related URL --> action mappings to a restmachinery.Server.

type TokenAuthFilterConfig

type TokenAuthFilterConfig struct {
	// RootUserEnabled indicates whether the TokenAuthFilter should permit the
	// "root" user to authenticate using a password.
	RootUserEnabled bool
	// ThirdPartyAuthEnabled indicates whether the TokenAuthFilter service should
	// permit User authentication via third-parties.
	ThirdPartyAuthEnabled bool
	// FindUserFn is a function for locating a User. This field is applicable only
	// when the value of the ThirdPartyAuthEnabled field is true.
	FindUserFn func(ctx context.Context, id string) (api.User, error)
	// HashedSchedulerToken is a secure hash of the token used by the scheduler
	// component.
	HashedSchedulerToken string
	// HashedObserverToken is a secure hash of the token used by the observer
	// component.
	HashedObserverToken string
}

TokenAuthFilterConfig encapsulates several configuration options for the TokenAuthFilter.

type UsersEndpoints

type UsersEndpoints struct {
	AuthFilter restmachinery.Filter
	Service    api.UsersService
}

func (*UsersEndpoints) Register

func (u *UsersEndpoints) Register(router *mux.Router)

type WorkersEndpoints

type WorkersEndpoints struct {
	AuthFilter               restmachinery.Filter
	WorkerStatusSchemaLoader gojsonschema.JSONLoader
	Service                  api.WorkersService
}

WorkersEndpoints implements restmachinery.Endpoints to provide Worker-related URL --> action mappings to a restmachinery.Server.

func (*WorkersEndpoints) Register

func (w *WorkersEndpoints) Register(router *mux.Router)

Register is invoked by restmachinery.Server to register Worker-related URL --> action mappings to a restmachinery.Server.

Jump to

Keyboard shortcuts

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