Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnauthenticated = errors.New("meldbase server: unauthenticated") ErrForbidden = errors.New("meldbase server: forbidden") )
Functions ¶
This section is empty.
Types ¶
type Authenticator ¶
type Authorizer ¶
type Authorizer interface {
AuthorizeQuery(context.Context, Principal, string, meldbase.QuerySpec) (QueryPolicy, error)
AuthorizeInsert(context.Context, Principal, string, meldbase.Document) (InsertPolicy, error)
AuthorizeUpdate(context.Context, Principal, string, meldbase.QuerySpec, meldbase.MutationSpec) (UpdatePolicy, error)
AuthorizeDelete(context.Context, Principal, string, meldbase.QuerySpec) (DeletePolicy, error)
}
type Config ¶
type Config struct {
DB *meldbase.DB
Authenticator Authenticator
Authorizer Authorizer
PublicRealtimeURL string
OriginPatterns []string
AllowedHTTPOrigins []string
TicketTTL time.Duration
ResumeTokenKey []byte
ResumeTokenTTL time.Duration
MaxBodyBytes int
MaxSubscriptionsPerConnection int
QueryLimits meldbase.QueryLimits
}
type DeletePolicy ¶
type DeletePolicy struct {
QueryPolicy
MaxAffected int
}
type InsertPolicy ¶
type QueryPolicy ¶
type UpdatePolicy ¶
type UpdatePolicy struct {
QueryPolicy
AllowAllUpdatePaths bool
AllowedUpdatePaths map[string]struct{}
MaxAffected int
}
Click to show internal directories.
Click to hide internal directories.