Documentation ¶
Index ¶
- func AuthMiddleware(optional bool, next http.Handler) http.HandlerFunc
- func AuthzStash(database database.DB, next http.Handler) http.HandlerFunc
- func GenerateJWT(UserId int, email string) (string, error)
- func GetPayload(tokenStr []byte) (*idtoken.Payload, error)
- func Login(tokenStr []byte, db database.DB) (*string, error)
- type ContextKey
- type ContextVal
- type CustomClaims
- type GoogleData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthMiddleware ¶
func AuthMiddleware(optional bool, next http.Handler) http.HandlerFunc
Authn middleware
func AuthzStash ¶
Authz middleware that allows access either if user owns this stash, or the stash is public. Takes in stash from the url path.
func GenerateJWT ¶
Generate Jwt to be used for urlstash
func GetPayload ¶
Function for extracting payload from google identity's jwt
Types ¶
type ContextVal ¶
func ParseJWT ¶
func ParseJWT(tokenStr string) (*ContextVal, error)
type CustomClaims ¶
type CustomClaims struct { UserId int `json:"uid"` jwt.RegisteredClaims }
Custom jwt claims for urlstash
Click to show internal directories.
Click to hide internal directories.