idprovapi

package
v0.0.0-...-147f0cf Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const ApproveRequestMethod = "approveRequest"

ApproveRequestMethod approves a provisioning request. This does not add the device until a provisioning request is made

View Source
const GetRequestsMethod = "getRequests"

GetRequestsMethod returns a list of provisioning requests This is an in-memory list that is cleared when the service restarts

View Source
const ManageProvisioningCap = "manageIdProv"

ManageProvisioningCap is the capability to manage provisioning via the Hub

View Source
const PreApproveClientsMethod = "preApproveClients"

PreApproveClientsMethod uploads a list of pre-approved devices or services This list remains active until the service restarts. Devices are not added until the request is received and accepted.

View Source
const ProvisionRequestPath = "/idprov/request"

ProvisionRequestPath to request provisioning through the HTTP endpoint

View Source
const ProvisioningServerType = "idprov"

ProvisioningServerType defines the discovery type for the provisioning this will be published as _provisioning._hiveot._tcp

View Source
const RejectRequestMethod = "rejectRequest"

RejectRequestMethod rejects a provisioning request

View Source
const ServiceName = "idprov"

ServiceName is the name of the agent connecting to the Hub

View Source
const SubmitRequestMethod = "submitRequest"

SubmitRequestMethod submits a provisioning request

Variables

This section is empty.

Functions

This section is empty.

Types

type ApproveRequestArgs

type ApproveRequestArgs struct {
	// ClientID of an approved device or service
	ClientID string `json:"clientID"`
	// ClientType to assign to the approval
	ClientType string `json:"clientType"`
}

type GetRequestsArgs

type GetRequestsArgs struct {
	// include accepted,pending and/or rejected requests
	Approved bool `json:"approved,omitempty"`
	Pending  bool `json:"pending,omitempty"`
	Rejected bool `json:"rejected,omitempty"`
}

type GetRequestsResp

type GetRequestsResp struct {
	Requests []ProvisionStatus `json:"requests"`
}

type PreApproveClientsArgs

type PreApproveClientsArgs struct {
	Approvals []PreApprovedClient `json:"approvals,omitempty"`
}

type PreApprovedClient

type PreApprovedClient struct {
	// ClientID of a pre-approved device or service
	ClientID string `json:"clientID,omitempty"`
	// client is a device or service
	ClientType string `json:"clientType"`
	// Optional MAC for extra checking
	MAC string `json:"mac"`
	// Device or service public key used to issue tokens
	PubKey string `json:"pubKey"`
}

type ProvisionRequestArgs

type ProvisionRequestArgs struct {
	// ClientID of the device or service under which it will connect and publish events
	ClientID string `json:"clientID,omitempty"`
	// MAC address of the device
	MAC string `json:"mac"`
	// The device or service public key
	PubKey string `json:"pubKey,omitempty"`
}

ProvisionRequestArgs arguments to request provisioning

type ProvisionRequestResp

type ProvisionRequestResp struct {
	// The current status
	Status ProvisionStatus `json:"status"`
	// Token when approved.
	// This has a short lifespan and must be refresh immediately after connecting to the hub.
	Token string `json:"token,omitempty"`
}

ProvisionRequestResp holds the response to the request

type ProvisionStatus

type ProvisionStatus struct {
	// ClientID is the unique ID of the device or service on the local network.
	ClientID string `json:"clientID,omitempty"`

	// ClientType is either ClientTypeDevice or ClientTypeService
	ClientType string `json:"clientType"`

	// PubKey holds the device's public key
	PubKey string `json:"pubKey"`

	// MAC contains the device's MAC address either for pre-approval or when issuing a token
	MAC string `json:"mac"`

	// the request is pending. Wait retrySec seconds before retrying
	Pending bool `json:"pending,omitempty"`

	// timestamp in msec since epoc when the request was approved.
	ApprovedMSE int64 `json:"approvedMSE,omitempty"`

	// timestamp in msec since epoc when the request was received. Used to expire requests.
	ReceivedMSE int64 `json:"receivedMSE,omitempty"`

	// timestamp in msec since epoc when the request was rejected.
	RejectedMSE int64 `json:"rejectedMSE,omitempty"`

	// Optional delay for retrying the request in seconds in case status is pending
	RetrySec int `json:"retrySec,omitempty"`
}

ProvisionStatus holds the status of a provisioning request

type RejectRequestArgs

type RejectRequestArgs struct {
	// ClientID of an rejected device or service
	ClientID string `json:"clientID,omitempty"`
}

type SubmitRequestArgs

type SubmitRequestArgs struct {
	// ClientID of the device or service
	ClientID string `json:"clientID,omitempty"`
	// client is a device or service (default is ClientTypeDevice)
	ClientType string `json:"clientType"`
	// Optional MAC if available
	MAC string `json:"mac"`
	// Device or service public key used to issue tokens (required)
	PubKey string `json:"pubKey"`
}

Jump to

Keyboard shortcuts

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