File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -1584,6 +1584,21 @@ def _update_server_extensions(self, change):
15841584 """
15851585 ).tag (config = True )
15861586
1587+ @default ('authenticate_prometheus' )
1588+ def _default_authenticate_prometheus (self ):
1589+ """ Authenticate Prometheus by default, unless auth is disabled. """
1590+ auth = bool (self .password ) or bool (self .token )
1591+ if auth is False :
1592+ self .log .info (_ ("Authentication of /metrics is OFF, since other authentication is disabled." ))
1593+ return auth
1594+
1595+ @observe ('authenticate_prometheus' )
1596+ def _update_authenticate_prometheus (self , change ):
1597+ newauth = change ['new' ]
1598+ if self .authenticate_prometheus is True and newauth is False :
1599+ self .log .info (_ ("Authentication of /metrics is being turned OFF." ))
1600+ self .authenticate_prometheus = newauth
1601+
15871602 # Since use of terminals is also a function of whether the terminado package is
15881603 # available, this variable holds the "final indication" of whether terminal functionality
15891604 # should be considered (particularly during shutdown/cleanup). It is enabled only
You can’t perform that action at this time.
0 commit comments