Documentation
¶
Index ¶
- func DefaultAuthenticate(d *Daemon, w http.ResponseWriter, r *http.Request) (bool, string, string, error)
- func TokenAuthenticate(d *Daemon, w http.ResponseWriter, r *http.Request) (bool, string, string, error)
- type APIEndpoint
- type APIEndpointAction
- type Authenticator
- type Daemon
- func (d *Daemon) Authorizer() auth.Authorizer
- func (d *Daemon) OIDCVerifier() *oidc.Verifier
- func (d *Daemon) ReloadConfig(init bool, newCfg api.SystemConfig) (_err error)
- func (d *Daemon) ServerCert() *incusTLS.CertInfo
- func (d *Daemon) Start() error
- func (d *Daemon) Stop(ctx context.Context) error
- func (d *Daemon) TrustedFingerprints() []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultAuthenticate ¶
func DefaultAuthenticate(d *Daemon, w http.ResponseWriter, r *http.Request) (bool, string, string, error)
DefaultAuthenticate validates an incoming http Request It will check over what protocol it came, what type of request it is and will validate the TLS certificate.
This does not perform authorization, only validates authentication. Returns whether trusted or not, the username (or certificate fingerprint) of the trusted client, and the type of client that has been authenticated (unix or tls).
func TokenAuthenticate ¶
func TokenAuthenticate(d *Daemon, w http.ResponseWriter, r *http.Request) (bool, string, string, error)
TokenAuthenticate attempts normal authentication, and falls back to token-based authentication. If using token-based authentication, the request will be assumed to be coming from the migration worker.
Types ¶
type APIEndpoint ¶
type APIEndpoint struct {
Path string // Path pattern for this endpoint.
Get APIEndpointAction
Head APIEndpointAction
Put APIEndpointAction
Post APIEndpointAction
Delete APIEndpointAction
Patch APIEndpointAction
}
APIEndpoint represents a URL in our API.
type APIEndpointAction ¶
type APIEndpointAction struct {
Handler func(d *Daemon, r *http.Request) response.Response
AccessHandler func(d *Daemon, r *http.Request) response.Response
Authenticator Authenticator
AllowUntrusted bool
}
APIEndpointAction represents an action on an API endpoint.
type Authenticator ¶
type Daemon ¶
type Daemon struct {
ShutdownCtx context.Context // Canceled when shutdown starts.
ShutdownCancel context.CancelFunc // Cancels the shutdownCtx to indicate shutdown starting.
ShutdownDoneCh chan error // Receives the result of the d.Stop() function and tells the daemon to end.
// contains filtered or unexported fields
}
func (*Daemon) Authorizer ¶
func (d *Daemon) Authorizer() auth.Authorizer
func (*Daemon) OIDCVerifier ¶
func (*Daemon) ReloadConfig ¶
func (d *Daemon) ReloadConfig(init bool, newCfg api.SystemConfig) (_err error)