enrollment

package
v0.1.0-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProofMessage

func ProofMessage(request *antiflockv1.EnrollNodeRequest) ([]byte, error)

ProofMessage returns the exact digest signed by the enrolling endpoint. It uses only fields present in the canonical EnrollNodeRequest.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(database *storage.DB, authority *identity.Authority, auditService *audit.Service, tokenTTL time.Duration) *Service

func (*Service) Approve

func (service *Service) Approve(ctx context.Context, actorID string, request *antiflockv1.ApproveEnrollmentRequest) (model.Node, error)

func (*Service) CreateScopedToken

func (service *Service) CreateScopedToken(ctx context.Context, actorID, operationID string, scope TokenScope) (Token, error)

func (*Service) CreateToken

func (service *Service) CreateToken(ctx context.Context, actorID string) (Token, error)

func (*Service) Deny

func (*Service) Enroll

func (*Service) SetStatus

func (service *Service) SetStatus(ctx context.Context, actorID, nodeID string, status model.NodeStatus) error

func (*Service) SetStatusWithReason

func (service *Service) SetStatusWithReason(ctx context.Context, actorID, nodeID string, status model.NodeStatus, operationID, reasonCode string) error

func (*Service) UpdateMetadata

func (service *Service) UpdateMetadata(ctx context.Context, actorID, nodeID, name string, tags []string) error

func (*Service) UpdateMetadataWithOperation

func (service *Service) UpdateMetadataWithOperation(ctx context.Context, actorID, nodeID, name string, tags []string, operationID string) error

type Token

type Token struct {
	ID         string     `json:"id"`
	TokenValue string     `json:"tokenValue"`
	Scope      TokenScope `json:"scope"`
	ExpiresAt  time.Time  `json:"expiresAt"`
}

type TokenScope

type TokenScope struct {
	AllowedNodeType antiflockv1.NodeType `json:"allowedNodeType"`
	ApprovedTags    []string             `json:"approvedTags"`
}

func (TokenScope) Validate

func (scope TokenScope) Validate() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL