Documentation ¶
Index ¶
Constants ¶
const ApproveRequestMethod = "approveRequest"
ApproveRequestMethod approves a provisioning request. This does not add the device until a provisioning request is made
const GetRequestsMethod = "getRequests"
GetRequestsMethod returns a list of provisioning requests This is an in-memory list that is cleared when the service restarts
const ManageProvisioningCap = "manageIdProv"
ManageProvisioningCap is the capability to manage provisioning via the Hub
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.
const ProvisionRequestPath = "/idprov/request"
ProvisionRequestPath to request provisioning through the HTTP endpoint
const ProvisioningServerType = "idprov"
ProvisioningServerType defines the discovery type for the provisioning this will be published as _provisioning._hiveot._tcp
const RejectRequestMethod = "rejectRequest"
RejectRequestMethod rejects a provisioning request
const ServiceName = "idprov"
ServiceName is the name of the agent connecting to the Hub
const SubmitRequestMethod = "submitRequest"
SubmitRequestMethod submits a provisioning request
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApproveRequestArgs ¶
type GetRequestsArgs ¶
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"` }