identity

package
v0.0.0-...-89602ce Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2020 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const CLIENT_CERT_SN_KEY = "x-magma-client-cert-serial"

Variables

This section is empty.

Functions

func GetClientNetworkID

func GetClientNetworkID(ctx context.Context) (string, error)

GetClientNetworkID looks up the Gateway caller retrieved from GRPC/HTTP Context (if present) where it's set by the middleware and returns the NetworkID associated to the gateway. For use by all Gateway facing cloud services.

func GetStreamGatewayId

func GetStreamGatewayId(stream grpc.ServerStream) (*protos.Identity_Gateway, error)

GetStreamGatewayId returns a valid, non nil Gateway identity based on the stream's metadata CTX or error if no GW Identity can be found/verified

func IsGateway

func IsGateway(id *protos.Identity) bool

IsGateway Checks if it's an Identity of Gateway and returns true if it is

func IsOperator

func IsOperator(id *protos.Identity) bool

IsOperator Checks if it's an Identity of Operator and returns true if it is

func NewGateway

func NewGateway(hwId, networkId, logicalId string) *protos.Identity

NewGateway returns Gateway identity corresponding to given hardware network & logical gateway IDs

func NewGatewayWildcard

func NewGatewayWildcard() *protos.Identity

NewGatewayWildcard returns Network Wildcard identity see protos/identity_helper.go

func NewNetwork

func NewNetwork(networkId string) *protos.Identity

NewNetwork returns Network identity corresponding to given networkId see protos/identity_helper.go

func NewNetworkWildcard

func NewNetworkWildcard() *protos.Identity

NewNetworkWildcard returns Network Wildcard identity see protos/identity_helper.go

func NewOperator

func NewOperator(opId string) *protos.Identity

NewOperator returns Operator identity corresponding to given opId see protos/identity_helper.go

func NewOperatorWildcard

func NewOperatorWildcard() *protos.Identity

NewOperatorWildcard returns Operator Wildcard identity see protos/identity_helper.go

Types

This section is empty.

Jump to

Keyboard shortcuts

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