Documentation
¶
Index ¶
- Variables
- func GinMiddleware(logger *zap.Logger, jwtService *service_jwt.Service) gin.HandlerFunc
- func NewContext(ctx context.Context, s *Subject) context.Context
- func RemoveAuthCookie(w http.ResponseWriter)
- func SetAuthCookieForUser(c *gin.Context, userID string, jwtService *service_jwt.Service) error
- func UserID(ctx context.Context) (string, error)
- type Subject
- type SubjectType
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnauthenticated = fmt.Errorf("unauthenticated") ErrForbidden = fmt.Errorf("forbidden") )
Functions ¶
func GinMiddleware ¶
func GinMiddleware(logger *zap.Logger, jwtService *service_jwt.Service) gin.HandlerFunc
func RemoveAuthCookie ¶
func RemoveAuthCookie(w http.ResponseWriter)
func SetAuthCookieForUser ¶
Types ¶
type SubjectType ¶
type SubjectType string
const ( SubjectUndefined SubjectType = "" SubjectUser SubjectType = "user" SubjectCI SubjectType = "ci" SubjectMutagen SubjectType = "mutagen" SubjectAnonymous SubjectType = "anonymous" )
func (SubjectType) String ¶
func (st SubjectType) String() string
Click to show internal directories.
Click to hide internal directories.