deviceauth

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package deviceauth is a library for obtaining credentials on an IoT device for authenticating with some of the cloud services like StateService and CommandQueueService.

Index

Constants

View Source
const DeviceAccessTokenMetadataKey = "heatpump-device-access-token"

DeviceAccessTokenMetadataKey is the gRPC metadata key used to provide a device access token identity secret to the server.

Variables

This section is empty.

Functions

func LoadTLSCredentials

func LoadTLSCredentials(flags *Flags) (credentials.TransportCredentials, error)

LoadTLSCredentials returns the standard transport credentials for connecting to a TLS server.

Types

type Client

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

func NewClient

func NewClient(ctx context.Context, flags *Flags) (*Client, error)

func (*Client) AddDeviceAuthTokenToContext

func (c *Client) AddDeviceAuthTokenToContext(ctx context.Context) (context.Context, error)

AddDeviceAuthTokenToContext returns a new context with a device auth token in the metadata.

func (*Client) GracefulStop

func (c *Client) GracefulStop()

GracefulStop attempts to gracefully shut down the server.

type Flags

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

func RegisterFlagsWithPrefix

func RegisterFlagsWithPrefix(fs *flag.FlagSet, prefix string) *Flags

RegisterFlagsWithPrefix registers a set of flags for obtaining configuration information.

Jump to

Keyboard shortcuts

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