Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClaimsFromBearerToken ¶ added in v0.17.0
ClaimsFromBearerToken decodes the provided bearer token into either github.com/shellhub-io/shellhub/pkg/api/authorizer.UserClaims or github.com/shellhub-io/shellhub/pkg/api/authorizer.DeviceClaims. It returns the decoded claims and an error if any.
func EncodeDeviceClaims ¶ added in v0.17.0
func EncodeDeviceClaims(claims authorizer.DeviceClaims, privateKey *rsa.PrivateKey) (string, error)
EncodeDeviceClaims encodes the provided device claims into a signed JWT token. It returns the encoded token and an error, if any.
func EncodeUserClaims ¶ added in v0.17.0
func EncodeUserClaims(claims authorizer.UserClaims, privateKey *rsa.PrivateKey) (string, error)
EncodeUserClaims encodes the provided user claims into a signed JWT token. It returns the encoded token and an error, if any.
The token is valid for 72 hours; tenantID is optional.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.