Documentation
¶
Overview ¶
Package mockserver is a Kapten stand-in for the CLI: a fake auth service (package mockauth) under /auth and the Engine API generated from the CLI's embedded OpenAPI document (package mockengine) under /api, on one listener. Engine requests need an access token the fake auth issued.
The end-to-end tests run the real kapten binary against it, and `kapten-mock` serves it for trying the CLI by hand.
Index ¶
Constants ¶
View Source
const ( ApplicationID = "cli_6d6f636b-0000-4000-8000-000000000001" ApplicationSecret = "kapten_sk_mock" )
Application is the OAuth application the mock accepts in server mode (KAPTEN_CLIENT_ID and KAPTEN_CLIENT_SECRET).
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
// ManualApproval keeps logins pending until their code is approved on
// the /auth/device page or through Auth.Approve.
ManualApproval bool
// TokenTTL is the lifetime of access tokens (default one hour).
TokenTTL time.Duration
// PollInterval is the device poll interval in seconds (default 1).
PollInterval int
}
Options tune the fake auth service.
type Server ¶
type Server struct {
Auth *mockauth.Server
Engine *mockengine.Server
// contains filtered or unexported fields
}
Server is the mock. Call Listen with its base URL before serving it.
Click to show internal directories.
Click to hide internal directories.