Documentation
¶
Index ¶
- func KeyID(key []byte) string
- type AdminReader
- type Authenticator
- type Credential
- type Details
- type DeviceAuthorizer
- type Endpoint
- type Enrollment
- type Execution
- func (e *Execution) AuthenticateHost(ctx context.Context, tx pgx.Tx, p identity.Principal, machineID string) (bool, error)
- func (e *Execution) Enroll(ctx context.Context, p identity.Principal, in Enrollment, version int64) (ExecutionState, error)
- func (e *Execution) ReadState(ctx context.Context, tx pgx.Tx, userID, machineID string) (ExecutionState, error)
- func (e *Execution) Revoke(ctx context.Context, p identity.Principal, machineID string, version int64) (ExecutionState, error)
- func (e *Execution) Snapshot(ctx context.Context, userID string, executeOnly bool) ([]ExecutionState, error)
- func (e *Execution) State(ctx context.Context, userID, machineID string) (ExecutionState, error)
- func (e *Execution) VerifyDeviceRequest(ctx context.Context, tx pgx.Tx, user, machine string, public []byte) (bool, error)
- type ExecutionState
- type Hello
- type Message
- type Page
- type Postgres
- func (p *Postgres) Active(ctx context.Context, user string) ([]Endpoint, error)
- func (p *Postgres) AdminDeviceOverview(ctx context.Context, filters []byte) ([]byte, error)
- func (p *Postgres) AdminDevices(ctx context.Context, filters []byte, offset, limit int) ([][]byte, error)
- func (p *Postgres) Get(ctx context.Context, user, machine string) (Endpoint, error)
- func (p *Postgres) Page(ctx context.Context, user string, page, size int) (Page, error)
- func (p *Postgres) Register(ctx context.Context, user string, h Hello) (Endpoint, error)
- func (p *Postgres) RegisterDevice(ctx context.Context, user, machine string, r Registration) (Endpoint, error)
- func (p *Postgres) Touch(ctx context.Context, user, machine string, at time.Time) error
- func (p *Postgres) Update(ctx context.Context, user, machine, action string, alias *string) (Endpoint, error)
- func (p *Postgres) WithDeviceAuthorizer(auth DeviceAuthorizer) *Postgres
- func (p *Postgres) WithExecutionRevoker(revoke func(string, string, int64)) *Postgres
- type Profile
- type Registrar
- type Registration
- type Service
- func (s *Service) Observe(ctx context.Context)
- func (s *Service) Ready() bool
- func (s *Service) RegisterAdmin(r chi.Router)
- func (s *Service) RegisterAgent(router chi.Router)
- func (s *Service) Shutdown(ctx context.Context) error
- func (s *Service) WithMaxConnections(n int) *Service
- func (s *Service) WithRuntimeDirectory(handler http.Handler) *Service
- type Store
- type View
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AdminReader ¶
type AdminReader interface {
AdminDevices(context.Context, []byte, int, int) ([][]byte, error)
AdminDeviceOverview(context.Context, []byte) ([]byte, error)
}
AdminReader keeps the administrator inventory separate from per-user device management.
type Authenticator ¶
type Authenticator interface {
Credential(*http.Request) (Credential, bool)
Valid(context.Context, Credential) (bool, error)
}
type Credential ¶
type Details ¶
type Details struct {
ClientType *string `json:"client_type"`
ClientName *string `json:"client_name"`
Channel *string `json:"channel"`
Locale *string `json:"locale"`
SystemLocale *string `json:"system_locale"`
Timezone *string `json:"timezone"`
RuntimeVersion *string `json:"runtime_version"`
EngineVersion *string `json:"engine_version"`
ElectronVersion *string `json:"electron_version"`
}
type DeviceAuthorizer ¶
type DeviceAuthorizer interface {
BindDevice(context.Context, pgx.Tx, identity.Principal, string, string) (bool, error)
ConsumeRuntimeRestore(context.Context, pgx.Tx, identity.Principal) (bool, error)
RevokeRuntimeGrant(context.Context, pgx.Tx, string, string, string) (bool, error)
NotifyGrantRevoked(string)
AuthorizeDevice(context.Context, pgx.Tx, identity.Principal, string) (bool, error)
}
type Enrollment ¶
type Execution ¶
type Execution struct {
// contains filtered or unexported fields
}
func NewExecution ¶
func NewExecution(pool *pgxpool.Pool, auth DeviceAuthorizer) *Execution
func (*Execution) AuthenticateHost ¶
func (*Execution) Enroll ¶
func (e *Execution) Enroll(ctx context.Context, p identity.Principal, in Enrollment, version int64) (ExecutionState, error)
type ExecutionState ¶
type ExecutionState struct {
Protocols map[string][]int
LastSeenAt *time.Time
RuntimeVersion *string
EngineVersion *string
MachineID string
DisplayName string
Platform string
Arch string
PublicKey []byte
KeyID string
RemoteAccessState string
DeploymentMode string
ActiveGrantID string
RegistrationVersion int64
GrantVersion int64
LeaseEpoch int64
}
type Message ¶
type Message struct {
Type string `json:"type"`
ID string `json:"message_id"`
Target string `json:"target"`
Method string `json:"method,omitempty"`
ReplyTo string `json:"reply_to,omitempty"`
Payload json.RawMessage `json:"payload"`
Source string `json:"source,omitempty"`
RoutedAt int64 `json:"routed_at,omitempty"`
}
type Postgres ¶
type Postgres struct {
// contains filtered or unexported fields
}
func NewPostgres ¶
func (*Postgres) AdminDeviceOverview ¶
func (*Postgres) AdminDevices ¶
func (*Postgres) RegisterDevice ¶
func (*Postgres) WithDeviceAuthorizer ¶
func (p *Postgres) WithDeviceAuthorizer(auth DeviceAuthorizer) *Postgres
type Registration ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) RegisterAdmin ¶
func (*Service) RegisterAgent ¶
func (*Service) WithMaxConnections ¶
type Store ¶
type Store interface {
Active(context.Context, string) ([]Endpoint, error)
Page(context.Context, string, int, int) (Page, error)
Get(context.Context, string, string) (Endpoint, error)
Register(context.Context, string, Hello) (Endpoint, error)
Update(context.Context, string, string, string, *string) (Endpoint, error)
Touch(context.Context, string, string, time.Time) error
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.