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