app

package
v0.0.0-...-2b17ca9 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValidDeviceID

func IsValidDeviceID(ID string) bool

IsValidDeviceID validates the given identifier for string length and characters used

Validation is based on the RFC952 for hostnames.

Types

type DeviceAuth

type DeviceAuth struct {
	DeviceID   string
	Key        *repository.Key
	ServiceAcc string
}

DeviceAuth contains authorization information for device with DeviceID. Information is extracted from request's OAuth2 JWT Payload

type TokenVendor

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

func NewTokenVendor

func NewTokenVendor(ctx context.Context, repo repository.PubKeyRepository, v *oauth.TokenVerifier, ts *tokensource.GCPTokenSource, acceptedAudience, defaultSAName string) (*TokenVendor, error)

func (*TokenVendor) ConfigurePublicKey

func (tv *TokenVendor) ConfigurePublicKey(ctx context.Context, deviceID string, opts repository.KeyOptions) error

func (*TokenVendor) GetOAuth2Token

func (tv *TokenVendor) GetOAuth2Token(ctx context.Context, jwtk string) (*tokensource.TokenResponse, error)

func (*TokenVendor) PublishPublicKey

func (tv *TokenVendor) PublishPublicKey(ctx context.Context, deviceID, publicKey string) error

func (*TokenVendor) ReadPublicKey

func (tv *TokenVendor) ReadPublicKey(ctx context.Context, deviceID string) (string, error)

func (*TokenVendor) ValidateJWT

func (tv *TokenVendor) ValidateJWT(ctx context.Context, jwtk string) (*DeviceAuth, error)

func (*TokenVendor) VerifyToken

func (tv *TokenVendor) VerifyToken(ctx context.Context, token oauth.Token, robots bool) error

Jump to

Keyboard shortcuts

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