controller

package
v0.0.0-...-7a1a403 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2018 License: BSD-2-Clause Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

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

Controller manages the connection to the Brickchain HASS Controller

func NewController

func NewController(url string, version string) *Controller

NewController returns a new instance of Controller

func (*Controller) Register

func (c *Controller) Register(ourURL, binding, secret string) error

Register registers to the Brickchain HASS Controller which sends back what public key and mandate roles to trust

func (*Controller) Verify

func (c *Controller) Verify(req *http.Request) bool

Verify checks if an http request has the Authorization header with a mandate-token that matches the realm and mandate roles that the Brickchain HASS Controller told us about

type TunnelRegistrationRequest

type TunnelRegistrationRequest struct {
	Version string `json:"version"`
	Binding string `json:"binding"`
	Secret  string `json:"secret"`
	URL     string `json:"url"`
}

TunnelRegistrationRequest is the message we send to the Brickchain HASS Controller in order to tell it about our existence

type TunnelRegistrationResponse

type TunnelRegistrationResponse struct {
	RealmKey *jose.JsonWebKey `json:"realmKey"`
	Roles    []string         `json:"roles"`
}

TunnelRegistrationResponse is the response we get from the Brickchain HASS Controller that contains the public key of the realm that we should trust and which mandate roles are allowed to talk to us

Jump to

Keyboard shortcuts

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