server

package
v0.0.0-...-f0fd134 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: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearExpiredTokens

func ClearExpiredTokens(pgDB *sql.DB)

func JSONError

func JSONError(w http.ResponseWriter, err interface{}, code int)

Types

type BldrClient

type BldrClient struct {
	SignInURL    *url.URL
	ClientID     string
	ClientSecret string
}

BldrClient holds the config for the bldr oauth2 client.

type ErrorResponse

type ErrorResponse struct {
	ErrorCode int    `json:"error_code"`
	ErrorDesc string `json:"error"`
}

type IdTokenValidator

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

func (*IdTokenValidator) ValidateIdToken

type RefreshToken

type RefreshToken struct {
	RefreshToken string `json:"refresh_token"`
	GrantType    string `json:"grant_type"`
}

type Server

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

Server holds the server state

func New

func New(
	l logger.Logger,
	migrationConfig *migration.Config,
	oidcCfg oidc.Config,
	bldrClient *BldrClient,
	signInURL *url.URL,
	serviceCerts *certs.ServiceCerts,
	persistent bool) (*Server, error)

New returns a new instance of the server

func NewInMemory

func NewInMemory(
	l logger.Logger,
	remainingDuration time.Duration,
	oidcCfg oidc.Config,
	signInURL *url.URL,
	bldrClient *BldrClient,
	serviceCerts *certs.ServiceCerts,
	persistent bool) (*Server, error)

NewInMemory instantiates a memory-backed instance of the server, to be used for testing.

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(addr string) error

ListenAndServe starts a listener, and serves requests using Server's embedded http.ServeMux. Only ever returns with non-nil error.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Server) StartGRPCServer

func (s *Server) StartGRPCServer(addr string) error

func (*Server) StartSignalHandler

func (s *Server) StartSignalHandler() error

Jump to

Keyboard shortcuts

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