-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Gateway] Add support for gateway token renewal #985
[Gateway] Add support for gateway token renewal #985
Conversation
Codecov ReportBase: 72.52% // Head: 72.59% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #985 +/- ##
==========================================
+ Coverage 72.52% 72.59% +0.06%
==========================================
Files 64 64
Lines 8205 8239 +34
Branches 1375 1378 +3
==========================================
+ Hits 5951 5981 +30
- Misses 1840 1844 +4
Partials 414 414
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Thank you Steve! |
This pull request adds the ability for operators to configure a callable to perform authorization token renewal for the token used to access a Gateway server.
The callable class is specified via the
GatewayClient.gateway_token_renewer_class
configurable trait (or envJUPYTER_GATEWAY_TOKEN_RENEWER_CLASS
). The specified class name, once instantiated, must be a subclass (i.e., instance of)jupyter_server.gateway.gateway_client.GatewayTokenRenewerBase
, which is an abstract base class requiring the implementation of a single method -get_token()
:GatewayTokenRenewerBase
derives fromLoggingConfigurable
and, as a result, can support its own configurable traits that may be necessary to perform token renewal. In addition, the instance'sself.parent
attribute contains the current instance ofGatewayClient
, where other attributes are accessible. (Note:auth_header_key
,auth_scheme
, andauth_token
also reside onGatewayClient
, but are provided as parameters for convenience.)The gateway tests have been extended to demonstrate the configuration of a custom token renewer with configurable traits.