server

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2022 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, store *store.Store, engine *requests.Engine, config *Config) (*chi.Mux, error)

Types

type AuthConfig added in v0.0.8

type AuthConfig struct {
	ClientID     string   `envconfig:"client_id"`
	ClientSecret string   `envconfig:"client_secret"`
	Issuer       string   `envconfig:"issuer"`
	Scopes       []string `envconfig:"scopes"`
	RedirectURI  string   `envconfig:"redirect_uri"`
}

type Config

type Config struct {
	DevMode     bool       `envconfig:"dev"`
	RedirectURI string     `envconfig:"-"`
	Auth        AuthConfig `envconfig:"auth"`
}

type ContextKey

type ContextKey string

ContextKey is used to store the auth context value in the request context

type Policy

type Policy struct {
	Name   string
	Type   PolicyType
	Module string
}

type PolicyEngine

type PolicyEngine struct {
	Policies map[PolicyType][]Policy
}

func NewPolicyEngine

func NewPolicyEngine() *PolicyEngine

func (PolicyEngine) EvaluateLoginRequest

func (pe PolicyEngine) EvaluateLoginRequest(userInfo oapi.User) (bool, error)

type PolicyType

type PolicyType string
const (
	LoginPolicyType  PolicyType = "login"
	AccessPolicyType PolicyType = "access"
)

type ServerImpl

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

func (*ServerImpl) CreateProject

func (s *ServerImpl) CreateProject(w http.ResponseWriter, r *http.Request)

func (*ServerImpl) CreateRequest

func (s *ServerImpl) CreateRequest(w http.ResponseWriter, r *http.Request)

func (*ServerImpl) CreateService

func (s *ServerImpl) CreateService(w http.ResponseWriter, r *http.Request)

func (*ServerImpl) GetProjectByID

func (s *ServerImpl) GetProjectByID(w http.ResponseWriter, r *http.Request, id uuid.UUID)

func (*ServerImpl) GetProjects

func (s *ServerImpl) GetProjects(w http.ResponseWriter, r *http.Request, params oapi.GetProjectsParams)

func (*ServerImpl) GetRequestByID

func (s *ServerImpl) GetRequestByID(w http.ResponseWriter, r *http.Request, id uuid.UUID)

func (*ServerImpl) GetRequestTemplateSpec added in v0.0.8

func (s *ServerImpl) GetRequestTemplateSpec(w http.ResponseWriter, r *http.Request, id string)

func (*ServerImpl) GetRequestTemplatesForService added in v0.0.8

func (s *ServerImpl) GetRequestTemplatesForService(w http.ResponseWriter, r *http.Request, id uuid.UUID)

func (*ServerImpl) GetRequests

func (s *ServerImpl) GetRequests(w http.ResponseWriter, r *http.Request, params oapi.GetRequestsParams)

func (*ServerImpl) GetServiceByID

func (s *ServerImpl) GetServiceByID(w http.ResponseWriter, r *http.Request, id uuid.UUID)

func (*ServerImpl) GetServices

func (s *ServerImpl) GetServices(w http.ResponseWriter, r *http.Request, params oapi.GetServicesParams)

func (ServerImpl) GetUserInfo

func (s ServerImpl) GetUserInfo(w http.ResponseWriter, r *http.Request)

func (*ServerImpl) GetUsers added in v0.0.8

func (s *ServerImpl) GetUsers(w http.ResponseWriter, r *http.Request)

func (*ServerImpl) ReviewRequest

func (s *ServerImpl) ReviewRequest(w http.ResponseWriter, r *http.Request, id uuid.UUID)

func (*ServerImpl) TriggerRequest added in v0.0.8

func (s *ServerImpl) TriggerRequest(w http.ResponseWriter, r *http.Request, id uuid.UUID)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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