Documentation ¶
Index ¶
- Constants
- Variables
- func Auth(next http.Handler) http.Handler
- func AuthDirective(ctx context.Context, obj interface{}, next graphql.Resolver) (interface{}, error)
- func GenTrackingID(next http.Handler) http.Handler
- func GenerateToken(jwtPayload models.JWTPayload, customExpTimeInMinute int) (string, error)
- func GetClaimsFromJWTTokenCtx(ctx context.Context) (*models.Claims, error)
Constants ¶
View Source
const ( ENV_SECRET string = "SECRET" NO_AUTH string = "unauthorized access" ClaimsKey string = "jwt_claims" )
View Source
const (
ErrAccessDenied string = "access denied"
)
Variables ¶
View Source
var SecretKey []byte
View Source
var (
// TrackingCtxKey is the context.Context key to store the tracking id for a request.
TrackingCtxKey = &contextKey{"tracking_id"}
)
Functions ¶
func AuthDirective ¶
func GenerateToken ¶
func GenerateToken(jwtPayload models.JWTPayload, customExpTimeInMinute int) (string, error)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.