service

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2023 License: BSD-3-Clause Imports: 50 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultZedFormat = "zson"

DefaultZedFormat is the default Zed format that the server will assume if the value for a request's "Accept" or "Content-Type" headers are not set or set to "*/*".

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth0Authenticator

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

func NewAuthenticator

func NewAuthenticator(ctx context.Context, logger *zap.Logger, registerer prometheus.Registerer, config AuthConfig) (*Auth0Authenticator, error)

NewAuthenticator returns an Auth0Authenticator that checks for a JWT signed by a key referenced in the JWKS file, has the required audience and issuer claims, and contains claims for a brim tenant and user id.

func (*Auth0Authenticator) MethodResponse

func (a *Auth0Authenticator) MethodResponse() api.AuthMethodResponse

func (*Auth0Authenticator) Middleware

func (a *Auth0Authenticator) Middleware(next func(*Core, *ResponseWriter, *Request)) func(*Core, *ResponseWriter, *Request)

type AuthConfig

type AuthConfig struct {
	Enabled  bool
	JWKSPath string

	// Audience, ClientID, and Domain are sent in the /auth/method response so API
	// clients can interact with the right Auth0 tenant (production, testing, etc.)
	// to obtain tokens.
	Audience string
	ClientID string
	Domain   string
}

func (*AuthConfig) SetFlags

func (c *AuthConfig) SetFlags(fs *flag.FlagSet)

type Config

type Config struct {
	Auth                  AuthConfig
	CORSAllowedOrigins    []string
	DefaultResponseFormat string
	Root                  *storage.URI
	RootContent           io.ReadSeeker
	Version               string
	Logger                *zap.Logger
}

type Core

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

func NewCore

func NewCore(ctx context.Context, conf Config) (*Core, error)

func (*Core) Registry

func (c *Core) Registry() *prometheus.Registry

func (*Core) ServeHTTP

func (c *Core) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Core) Shutdown

func (c *Core) Shutdown()

type Request

type Request struct {
	*http.Request
	Logger *zap.Logger
}

func (*Request) BoolFromQuery

func (r *Request) BoolFromQuery(w *ResponseWriter, param string) (bool, bool)

func (*Request) CommitID

func (r *Request) CommitID(w *ResponseWriter) (ksuid.KSUID, bool)

func (*Request) ID added in v1.10.0

func (r *Request) ID() string

func (*Request) JournalIDFromQuery

func (r *Request) JournalIDFromQuery(w *ResponseWriter, param string) (journal.ID, bool)

func (*Request) PoolID

func (r *Request) PoolID(w *ResponseWriter, root *lake.Root) (ksuid.KSUID, bool)

func (*Request) StringFromPath

func (r *Request) StringFromPath(w *ResponseWriter, arg string) (string, bool)

func (*Request) TagFromPath

func (r *Request) TagFromPath(w *ResponseWriter, arg string) (ksuid.KSUID, bool)

func (*Request) Unmarshal

func (r *Request) Unmarshal(w *ResponseWriter, body interface{}, templates ...interface{}) bool

type ResponseWriter

type ResponseWriter struct {
	http.ResponseWriter
	Format string
	Logger *zap.Logger
	// contains filtered or unexported fields
}

func (*ResponseWriter) ContentType

func (w *ResponseWriter) ContentType() string

func (*ResponseWriter) Error

func (w *ResponseWriter) Error(err error)

func (*ResponseWriter) Marshal

func (w *ResponseWriter) Marshal(body interface{}) bool

func (*ResponseWriter) Respond

func (w *ResponseWriter) Respond(status int, body interface{}) bool

func (*ResponseWriter) Write

func (w *ResponseWriter) Write(b []byte) (int, error)

func (*ResponseWriter) ZioWriter

func (w *ResponseWriter) ZioWriter() zio.WriteCloser

Directories

Path Synopsis
Package zqe provides a mechanism to create or wrap errors with information that will aid in reporting them to users and returning them to api callers.
Package zqe provides a mechanism to create or wrap errors with information that will aid in reporting them to users and returning them to api callers.

Jump to

Keyboard shortcuts

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