File tree 4 files changed +25
-2
lines changed
4 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,7 @@ type Manager struct {
109
109
HTTPAddress string
110
110
HTTPExclude []conf.AuthInternalUserPermission
111
111
JWTJWKS string
112
+ JWTExclude []conf.AuthInternalUserPermission
112
113
ReadTimeout time.Duration
113
114
RTSPAuthMethods []auth.ValidateMethod
114
115
@@ -255,6 +256,10 @@ func (m *Manager) authenticateHTTP(req *Request) error {
255
256
}
256
257
257
258
func (m * Manager ) authenticateJWT (req * Request ) error {
259
+ if matchesPermission (m .JWTExclude , req ) {
260
+ return nil
261
+ }
262
+
258
263
keyfunc , err := m .pullJWTJWKS ()
259
264
if err != nil {
260
265
return err
Original file line number Diff line number Diff line change @@ -177,6 +177,7 @@ type Conf struct {
177
177
ExternalAuthenticationURL * string `json:"externalAuthenticationURL,omitempty"` // deprecated
178
178
AuthHTTPExclude AuthInternalUserPermissions `json:"authHTTPExclude"`
179
179
AuthJWTJWKS string `json:"authJWTJWKS"`
180
+ AuthJWTExclude AuthInternalUserPermissions `json:"authJWTExclude"`
180
181
181
182
// Control API
182
183
API bool `json:"api"`
@@ -323,6 +324,17 @@ func (conf *Conf) setDefaults() {
323
324
Action : AuthActionPprof ,
324
325
},
325
326
}
327
+ conf .AuthJWTExclude = []AuthInternalUserPermission {
328
+ {
329
+ Action : AuthActionAPI ,
330
+ },
331
+ {
332
+ Action : AuthActionMetrics ,
333
+ },
334
+ {
335
+ Action : AuthActionPprof ,
336
+ },
337
+ }
326
338
327
339
// Control API
328
340
conf .APIAddress = ":9997"
Original file line number Diff line number Diff line change @@ -287,6 +287,7 @@ func (p *Core) createResources(initial bool) error {
287
287
HTTPAddress : p .conf .AuthHTTPAddress ,
288
288
HTTPExclude : p .conf .AuthHTTPExclude ,
289
289
JWTJWKS : p .conf .AuthJWTJWKS ,
290
+ JWTExclude : p .conf .AuthJWTExclude ,
290
291
ReadTimeout : time .Duration (p .conf .ReadTimeout ),
291
292
RTSPAuthMethods : p .conf .RTSPAuthMethods ,
292
293
}
@@ -674,6 +675,7 @@ func (p *Core) closeResources(newConf *conf.Conf, calledByAPI bool) {
674
675
newConf .AuthHTTPAddress != p .conf .AuthHTTPAddress ||
675
676
! reflect .DeepEqual (newConf .AuthHTTPExclude , p .conf .AuthHTTPExclude ) ||
676
677
newConf .AuthJWTJWKS != p .conf .AuthJWTJWKS ||
678
+ ! reflect .DeepEqual (newConf .AuthJWTExclude , p .conf .AuthJWTExclude ) ||
677
679
newConf .ReadTimeout != p .conf .ReadTimeout ||
678
680
! reflect .DeepEqual (newConf .RTSPAuthMethods , p .conf .RTSPAuthMethods )
679
681
if ! closeAuthManager && ! reflect .DeepEqual (newConf .AuthInternalUsers , p .conf .AuthInternalUsers ) {
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ runOnDisconnect:
44
44
# * internal: users are stored in the configuration file
45
45
# * http: an external HTTP URL is contacted to perform authentication
46
46
# * jwt: an external identity server provides authentication through JWTs
47
- authMethod : internal
47
+ authMethod : jwt
48
48
49
49
# Internal authentication.
50
50
# list of users.
@@ -120,7 +120,11 @@ authHTTPExclude:
120
120
# Users are expected to pass the JWT in the Authorization header or as a query parameter.
121
121
# This is the JWKS URL that will be used to pull (once) the public key that allows
122
122
# to validate JWTs.
123
- authJWTJWKS :
123
+ authJWTJWKS : https://localhost:7211/.well-known/openid-configuration/jwks
124
+ # Actions to exclude from JWT-based authentication.
125
+ # Format is the same as the one of user permissions.
126
+ authJWTExclude :
127
+ - action : publish
124
128
125
129
# ##############################################
126
130
# Global settings -> Control API
You can’t perform that action at this time.
0 commit comments