Skip to content

Commit a1c8c17

Browse files
author
blair drummond
committed
change authenticate_prometheus default
1 parent 8cd9a5f commit a1c8c17

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

notebook/notebookapp.py

+14
Original file line numberDiff line numberDiff line change
@@ -1584,6 +1584,20 @@ 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+
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+
15871601
# Since use of terminals is also a function of whether the terminado package is
15881602
# available, this variable holds the "final indication" of whether terminal functionality
15891603
# should be considered (particularly during shutdown/cleanup). It is enabled only

0 commit comments

Comments
 (0)