-
Notifications
You must be signed in to change notification settings - Fork 10
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
Support insights device authorization flow #288
Conversation
0a2d272
to
850ccc3
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #288 +/- ##
==========================================
- Coverage 93.73% 93.30% -0.44%
==========================================
Files 67 68 +1
Lines 2827 2927 +100
==========================================
+ Hits 2650 2731 +81
- Misses 177 196 +19 ☔ View full report in Codecov by Sentry. |
4d6ea94
to
b77e48c
Compare
Additional logging for Insights login and publishing. Normal output, additional Info (with -v) and Debugging (with -vv).
|
Adding support for staging sso server for the Device authorization workflow. SSO server defaults to
|
c2c9091
to
2580ce0
Compare
deaf91d
to
79b65f1
Compare
With the upcoming elimination of the basic auth authentication to Insights, we are adding support for the device authorization flow. - Remove the insight add_login cli command - Add support for the insights login cli command - Add utilities to read and write the insight's user JWT authentication token - Remove the add_login cli command tests
- Add the insights device authorization workflow - updated the insights login command to request an authorization workflow and wait for the user to login/authorize out-of-band. - fixed an issue with writing the auth token to file.
- When publishing reports to Insights, use the user's JWT authentication token for Authorization. - Properly detect missing, corrupt, invalid and expired token cases.
- Removing all references to the insights login config file and related username/password handling logic and tests.
- Updated the man page to describe the login device authorization flow and the new qpc insights login subcommands.
…shing - Improved logging for Insights login authorization and report publishing - Added both logger.info (-v) and more detailed logger.debug (-vv) messages depicting target Insights SSO and Console server as well as response errors.
- Configurable via poetry run qpc insights config --sso-host <value> - Defaults to sso.redhat.com - Can be updated to the staging sso.stage.redhat.com - Used by the device auth workflow
- Tests the new device auth workflow with insights login - Tests for Insights Auth request_auth - Tests for Insights Auth wait_for_authorization
- Support device auth workflow token timeout from the SSO server. These errors should result in the same exception we trigger upon expiration timeout checks.
- While these have not changed for a long time, it is always a good idea to fetch the device_authorization_endpoint and token_endpoint from the Keycloak OpenID well-known configuration json.
- Preferring to do a patch.object on sys.argv instead of overwriting the argument list. - Using get defaults instead of or for expires_in and interval. - Rebasing with main/updated rst manpage generation
79b65f1
to
9b29ecb
Compare
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.
👍
feat(insights): Add support for device authorization
New Insights login usage:
Insights publishing error messages:
When never logged in:
Other error messages:
Draft, things still to be done:
Other changes that will be required:
Relates to JIRA: DISCOVERY-459
https://issues.redhat.com/browse/DISCOVERY-459