Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( BadDocumentErr = fmt.Errorf("failed to add document") MissingPathErr = fmt.Errorf("missing path configuration") )
View Source
var AuthFailedErr = errors.New("authentication failed")
Functions ¶
Types ¶
type AuthConfig ¶
type Authenticator ¶
type Authenticator interface {
Authenticate(req events.LambdaFunctionURLRequest) error
}
type Config ¶
type Config struct {
Workspace string `json:"workspace"`
Collection string `json:"collection"`
WrapPayloadInArray bool `json:"wrap"`
Auth AuthConfig `json:"auth"`
}
type FailAuthenticator ¶
type FailAuthenticator struct{}
func (*FailAuthenticator) Authenticate ¶
func (a *FailAuthenticator) Authenticate(_ events.LambdaFunctionURLRequest) error
type Handler ¶
type Handler struct {
// Rockset *rockset.RockClient
Rockset Rockset
// Workspace is the default workspace to use if not specified in the path
Workspace string
// Configs is a map of endpoint configurations
Configs Configs
// Debug is a flag to enable debug logging
Debug bool
}
func (Handler) AuthenticatorForRequest ¶
func (h Handler) AuthenticatorForRequest(path string) Authenticator
func (Handler) HandlePayload ¶
type HeaderAuthenticator ¶
func (*HeaderAuthenticator) Authenticate ¶
func (a *HeaderAuthenticator) Authenticate(req events.LambdaFunctionURLRequest) error
type NoopAuthenticator ¶
type NoopAuthenticator struct{}
func (*NoopAuthenticator) Authenticate ¶
func (a *NoopAuthenticator) Authenticate(_ events.LambdaFunctionURLRequest) error
type Rockset ¶
type Rockset interface {
AddDocumentsRaw(ctx context.Context, workspace, collection string, body json.RawMessage) ([]openapi.DocumentStatus, error)
}
type SignatureAuthenticator ¶
type SignatureAuthenticator struct {
SigningSecret string
// Header is the name of the header that contains the signature, defaults to "X-Signature" if left empty.
Header string
}
SignatureAuthenticator implements SHA256 HMAC signature verification
func (*SignatureAuthenticator) Authenticate ¶
func (a *SignatureAuthenticator) Authenticate(req events.LambdaFunctionURLRequest) error
Click to show internal directories.
Click to hide internal directories.