Documentation
¶
Index ¶
- type ChallengeResult
- type Client
- func (c *Client) CreateACMEChallenge(ctx context.Context, digest string) (*ChallengeResult, error)
- func (c *Client) DeleteACMEChallenge(ctx context.Context, id string) error
- func (c *Client) DeviceID() string
- func (c *Client) Enroll(ctx context.Context) (*EnrollResult, error)
- func (c *Client) GetDeviceInfo(ctx context.Context) (*DeviceInfo, error)
- func (c *Client) Health(ctx context.Context) error
- func (c *Client) Ready(ctx context.Context) error
- func (c *Client) RequestNexusToken(ctx context.Context, stage int, sessionNonce string) (string, error)
- func (c *Client) SetHostname(ctx context.Context, hostname string) error
- func (c *Client) VerifyToken(ctx context.Context, token string) (*VerifyResult, error)
- type DeviceInfo
- type EnrollResult
- type Option
- type VerifyResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChallengeResult ¶
ChallengeResult is returned from POST /acme/challenges.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an HTTP client for the namek server API.
func (*Client) CreateACMEChallenge ¶
CreateACMEChallenge calls POST /api/v1/acme/challenges (authenticated).
func (*Client) DeleteACMEChallenge ¶
DeleteACMEChallenge calls DELETE /api/v1/acme/challenges/:id (authenticated).
func (*Client) Enroll ¶
func (c *Client) Enroll(ctx context.Context) (*EnrollResult, error)
Enroll performs the 2-phase enrollment flow.
func (*Client) GetDeviceInfo ¶
func (c *Client) GetDeviceInfo(ctx context.Context) (*DeviceInfo, error)
GetDeviceInfo calls GET /api/v1/devices/me (authenticated).
func (*Client) RequestNexusToken ¶
func (c *Client) RequestNexusToken(ctx context.Context, stage int, sessionNonce string) (string, error)
RequestNexusToken calls POST /api/v1/tokens/nexus (authenticated).
func (*Client) SetHostname ¶
SetHostname calls PATCH /api/v1/devices/me/hostname (authenticated).
func (*Client) VerifyToken ¶
VerifyToken calls POST /api/v1/tokens/verify (no auth).
type DeviceInfo ¶
type DeviceInfo struct {
DeviceID string `json:"device_id"`
Hostname string `json:"hostname"`
CustomHostname *string `json:"custom_hostname"`
Status string `json:"status"`
IdentityClass string `json:"identity_class"`
NexusEndpoints []string `json:"nexus_endpoints"`
}
DeviceInfo is returned from GET /devices/me.
type EnrollResult ¶
type EnrollResult struct {
DeviceID string `json:"device_id"`
Hostname string `json:"hostname"`
IdentityClass string `json:"identity_class"`
NexusEndpoints []string `json:"nexus_endpoints"`
Reenrolled bool `json:"reenrolled,omitempty"`
}
EnrollResult is returned after successful enrollment.
type Option ¶
type Option func(*Client)
Option configures a Client.
func WithDeviceID ¶
WithDeviceID restores a previously-enrolled device ID, allowing the client to make authenticated requests without re-enrolling.
func WithHTTPClient ¶
WithHTTPClient sets a custom HTTP client.
func WithInsecureSkipVerify ¶
func WithInsecureSkipVerify() Option
WithInsecureSkipVerify disables TLS certificate verification. Must be applied after WithHTTPClient if both are used.
type VerifyResult ¶
VerifyResult is returned from POST /tokens/verify.