-
Notifications
You must be signed in to change notification settings - Fork 42
Implement offline access in python #1851
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
Conversation
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1851 +/- ##
==========================================
+ Coverage 76.81% 79.56% +2.74%
==========================================
Files 629 528 -101
Lines 47002 41656 -5346
Branches 755 0 -755
==========================================
- Hits 36105 33143 -2962
+ Misses 10814 8513 -2301
+ Partials 83 0 -83
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I think what is really needed for this PR is the ability to query Keycloak for an offline_access token. Currently we can only do that from the frontend. |
…. Lock OfflineAccessModel to DEFAULT scope
This is now complete |
@@ -19,28 +19,29 @@ | |||
require 'openc3/models/model' | |||
|
|||
module OpenC3 | |||
# Note: This model is locked to the DEFAULT scope |
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 because you really only need 1 offline access token and the DEFAULT scope is always there?
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.
Exactly.
if @scope == 'DEFAULT' | ||
# Periodic Microservice | ||
deploy_periodic_microservice(gem_path, variables, @parent) | ||
end |
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.
I think this makes sense to only be the DEFAULT scope but our 20221210174900_convert_to_multi.rb migration starts the periodic microservice for all scopes. Do we need a migration to stop this for all existing scopes except DEFAULT?
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.
That would be better yes. The extras won't hurt anything, but they are unneeded so we can add a migration to remove them.
@@ -75,14 +75,14 @@ def initialize(url) | |||
end | |||
|
|||
# Load the token from the environment | |||
def token(include_bearer: true) | |||
def token(include_bearer: true, openid_scope: 'openid') |
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.
What is this scope? I assume it has something to do with keycloak? Why does it now have to be configurable?
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.
This is the "scope" of the token. I need to modify it to include "offline_access" to get the offline access token.
|
closes #1304
I don't think this is complete to fully close 1304 but I did the initial port of the offline access stuff.