Documentation
¶
Overview ¶
Package enrollment defines single-machine installation invitations.
Index ¶
- Variables
- func GatewayURL(value string) (string, error)
- func Hash(secret string) string
- func InstallCommand(link string, windows bool, mode string) string
- func Message(ticket string, r Redemption) []byte
- func PowerShellQuote(s string) string
- func Script(invitation Invitation, link string) (string, error)
- func ShellQuote(s string) string
- func SystemName(name string) string
- func SystemTicket(ticket string) string
- type Invitation
- type Link
- type Redemption
- type Request
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrPendingInvitation = errors.New("name has an existing invitation")
ErrPendingInvitation identifies a name reservation that force may retract.
Functions ¶
func GatewayURL ¶
func Message ¶
func Message(ticket string, r Redemption) []byte
func PowerShellQuote ¶
func ShellQuote ¶
func SystemName ¶ added in v0.5.0
func SystemTicket ¶ added in v0.5.0
SystemTicket derives a separate companion ticket without storing either installation URL in the gateway database.
Types ¶
type Invitation ¶
type Invitation struct {
UserID string `json:"userId,omitempty"`
ID string `json:"id"`
Name string `json:"name"`
AutoName bool `json:"autoName,omitempty"` // Hostname selected and signed by the target installer.
Gateway string `json:"gateway"`
ServiceMode string `json:"serviceMode,omitempty"`
// HybridID links independently enrolled User and System contexts. The
// companion uses a separate ticket, credential, identity, and profile.
HybridID string `json:"hybridId,omitempty"`
HybridRole string `json:"hybridRole,omitempty"`
Asset update.Asset `json:"asset"` // Selected binary; first candidate until architecture selection.
Assets []update.Asset `json:"assets,omitempty"` // Pinned candidates for architecture-detecting installers.
Version string `json:"version"`
ExpiresAt time.Time `json:"expiresAt"`
CreatedAt time.Time `json:"createdAt"`
RedeemedID string `json:"redeemedId,omitempty"`
ReplaceID string `json:"replaceId,omitempty"` // Existing identity reserved by a same-name invitation.
Revoked bool `json:"revoked"`
}
func (Invitation) Candidates ¶
func (i Invitation) Candidates() []update.Asset
func (Invitation) ResolveName ¶
func (i Invitation) ResolveName(hostname string) (string, error)
ResolveName runs on the target. The resolved name is persisted with the pending enrollment so a retry cannot rename the machine if its hostname changes.
type Link ¶
type Link struct {
Invitation
URL string `json:"url"`
Command string `json:"command"`
}
type Redemption ¶
type Request ¶
type Request struct {
Name string `json:"name"`
AutoName bool `json:"autoName,omitempty"`
OS string `json:"os"`
Arch string `json:"arch,omitempty"`
TTLSeconds int `json:"ttlSeconds,omitempty"`
Gateway string `json:"gateway"`
ServiceMode string `json:"serviceMode,omitempty"`
Force bool `json:"force,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.