Documentation
¶
Index ¶
- func IsValidDeviceID(ID string) bool
- type DeviceAuth
- type TokenVendor
- func (tv *TokenVendor) ConfigurePublicKey(ctx context.Context, deviceID string, opts repository.KeyOptions) error
- func (tv *TokenVendor) GetOAuth2Token(ctx context.Context, jwtk string) (*tokensource.TokenResponse, error)
- func (tv *TokenVendor) PublishPublicKey(ctx context.Context, deviceID, publicKey string) error
- func (tv *TokenVendor) ReadPublicKey(ctx context.Context, deviceID string) (string, error)
- func (tv *TokenVendor) ValidateJWT(ctx context.Context, jwtk string) (*DeviceAuth, error)
- func (tv *TokenVendor) VerifyToken(ctx context.Context, token oauth.Token, robots bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsValidDeviceID ¶
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 (*TokenVendor) ValidateJWT ¶
func (tv *TokenVendor) ValidateJWT(ctx context.Context, jwtk string) (*DeviceAuth, error)
func (*TokenVendor) VerifyToken ¶
Click to show internal directories.
Click to hide internal directories.