Auth: support JWT Authentication (#29995)

This commit is contained in:
Vladimir Kochnev
2021-03-31 15:40:44 +00:00
committed by GitHub
parent 1446d094b8
commit 39a3b0d0b0
22 changed files with 1444 additions and 4 deletions

View File

@@ -44,6 +44,7 @@ func init() {
type ContextHandler struct {
Cfg *setting.Cfg `inject:""`
AuthTokenService models.UserTokenService `inject:""`
JWTAuthService models.JWTService `inject:""`
RemoteCache *remotecache.RemoteCache `inject:""`
RenderService rendering.Service `inject:""`
SQLStore *sqlstore.SQLStore `inject:""`
@@ -92,6 +93,7 @@ func (h *ContextHandler) Middleware(c *macaron.Context) {
case h.initContextWithBasicAuth(ctx, orgID):
case h.initContextWithAuthProxy(ctx, orgID):
case h.initContextWithToken(ctx, orgID):
case h.initContextWithJWT(ctx, orgID):
case h.initContextWithAnonymousUser(ctx):
}