Documentation
¶
Index ¶
Constants ¶
View Source
const ( AdminRole = "admin" UserRole = "user" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Auth interface { GetAdminToken() (string, error) GetUserToken(userId string) (string, error) GetThingToken(thingId string, userId string) (string, error) GetClaimsUserToken(token string) (*UserAuthClaim, error) GetClaimsThingToken(token string) (*ThingAuthClaim, error) ValidateThingToken(token string) error ValidateUserToken(token string) error }
func New ¶
func New(c ServiceConf) Auth
type ServiceConf ¶
type ThingAuthClaim ¶
type ThingAuthClaim struct { UserId string `json:"UserId"` jwt.StandardClaims }
type UserAuthClaim ¶
type UserAuthClaim struct { Role string `json:"Role"` jwt.StandardClaims }
Click to show internal directories.
Click to hide internal directories.