Skip to content

Commit

Permalink
change authenticate_prometheus default
Browse files Browse the repository at this point in the history
  • Loading branch information
blair drummond committed Feb 4, 2021
1 parent 8cd9a5f commit a1c8c17
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions notebook/notebookapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1584,6 +1584,20 @@ def _update_server_extensions(self, change):
"""
).tag(config=True)

@default('authenticate_prometheus')
def _default_authenticate_prometheus(self):
""" Authenticate Prometheus by default, unless auth is disabled. """
return self.password or self.token

@observe('authenticate_prometheus')
def _update_authenticate_prometheus(self, change):
self.authenticate_prometheus = change['new']
if self.authenticate_prometheus:
self.log.info(_("Authentication of /metrics is ON."))
else:
self.log.info(_("Authentication of /metrics is OFF."))


# Since use of terminals is also a function of whether the terminado package is
# available, this variable holds the "final indication" of whether terminal functionality
# should be considered (particularly during shutdown/cleanup). It is enabled only
Expand Down

0 comments on commit a1c8c17

Please sign in to comment.