package
0.11.1
Repository: https://github.com/cosmotek/api-commons.git
Documentation: pkg.go.dev

# Functions

FromContext retreives the AuthToken from gRPC request context for use in the rpc method.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Sign creates and signs a JWT token using the provided AuthToken and rsaKey []byte slice, returning the JWT token string or an error.
Verify takes in a JWT token string and rsaKey []byte and validates it.
VerifyIgnoringExpiry parses and returns the AuthToken (claims) for an expired token, but only if the token is valid in all other ways.
WithAuthToken returns the provided context with an AuthToken attached.

# Constants

AdminUser is a user logged-in via Email, who has access to everything in the system.
No description provided by the author
No description provided by the author
OrgUser is a user logged-in via Email, and only has access to public data as well as data owned by the user's org.
No description provided by the author
ServiceUser is a API/Machine consumer, and has the same rights as a OrgUser.
User is a user logged-in via SMS, and only has access to public and personally owned data.

# Variables

ErrTokenExpired is returned by the Verify function and is used when attempted to refresh tokens.
No description provided by the author

# Structs

AuthToken is a object used to create/carry JWT claims in tokens, request context etc.

# Type aliases

Role is a system identifier used to determine permissions that an actor has within the application.
SubjectType is type (and set of constants) used to identify the type of actor/user identifier included in a AuthToken.