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
fix: Switch to discovery api for mode spaces #481
fix: Switch to discovery api for mode spaces #481
Conversation
Signed-off-by: Junda Yang <youngyjd@gmail.com>
Signed-off-by: Junda Yang <youngyjd@gmail.com>
e981b8d
to
467e961
Compare
# Spaces | ||
params = {'auth': HTTPBasicAuth(conf.get_string(MODE_ACCESS_TOKEN), | ||
conf.get_string(MODE_PASSWORD_TOKEN))} | ||
# mode_bearer_token must be provided in the conf |
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.
Is this different from the normal api token? If so, could you document it in the config?
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.
Mode provides two kind of authentication. discovery api requires bearer token while the main api requires user password. see
amundsendatabuilder/databuilder/extractor/dashboard/mode_analytics/mode_dashboard_utils.py
Line 57 in c0557a5
def get_auth_params(conf: ConfigTree, discover_auth: bool = False) -> Dict[str, Any]: |
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.
lgtm, thanks for the change to new mode API
I think we should eventually change all the existing mode API to use the new discovery API |
Getting spaces from Mode main API always hang and sometimes errorred out. We were suggested by Mode to integrate to the new Discovery API for getting Mode spaces