Documentation
¶
Overview ¶
Package app wires the drive server: the core services over control.db, the HTTP server, and the plugs manager that runs it.
Index ¶
- func ParseTTL(s string) (time.Duration, error)
- func Run(ctx context.Context, cfg config.Config, log zerolog.Logger, opts Options) error
- type Options
- type Services
- func (s *Services) Close() error
- func (s *Services) CreateToken(ctx context.Context, email string, scope core.Scope, name string, ...) (secret string, token core.Token, bypassed string, err error)
- func (s *Services) HTTP(baseURL string, trustedProxies []netip.Prefix) httpapi.Services
- func (s *Services) WriteAccounts(ctx context.Context, w io.Writer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Services ¶
type Services struct {
Policies *core.Policies
Accounts *core.Accounts
Tokens *core.Tokens
Documents *core.Documents
Sessions *core.Sessions
SignIn *core.SignIn
Sweeper *core.Sweeper
Outbox core.OutboxStore
// contains filtered or unexported fields
}
Services are the core services over one control.db.
func OpenServices ¶
func (*Services) CreateToken ¶
func (s *Services) CreateToken(ctx context.Context, email string, scope core.Scope, name string, ttl time.Duration) (secret string, token core.Token, bypassed string, err error)
CreateToken mints a token for email, creating the account when the email matches a policy. A zero ttl means the token never expires.
Minting is an operator action, so it creates the account even when the policy sets sign_up: false. That setting only governs self sign-up. When it did so, bypassed names the policy; otherwise bypassed is empty.
Click to show internal directories.
Click to hide internal directories.