Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Data Logistics Service
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eFlows4HPC WP2
Data Logistics Service
Commits
9836a576
Commit
9836a576
authored
2 years ago
by
Christian Boettcher
Browse files
Options
Downloads
Patches
Plain Diff
dont do async with flask
parent
400f0690
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#131349
passed
2 years ago
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
plugins/unity_integration.py
+7
-4
7 additions, 4 deletions
plugins/unity_integration.py
with
7 additions
and
4 deletions
plugins/unity_integration.py
+
7
−
4
View file @
9836a576
import
os
,
random
,
string
,
logging
import
os
,
random
,
string
,
logging
from
authlib.integrations.flask_client
import
OAuth
from
authlib.integrations.flask_client
import
OAuth
from
flask
import
url_for
,
redirect
,
current_app
as
app
,
Blueprint
from
flask
import
url_for
,
redirect
,
current_app
as
app
,
Blueprint
,
abort
from
flask_login
import
login_user
from
flask_login
import
login_user
from
flask_appbuilder
import
BaseView
as
AppBuilderBaseView
from
flask_appbuilder
import
BaseView
as
AppBuilderBaseView
from
airflow.plugins_manager
import
AirflowPlugin
from
airflow.plugins_manager
import
AirflowPlugin
...
@@ -35,9 +35,12 @@ class UnityIntegrationView(AppBuilderBaseView):
...
@@ -35,9 +35,12 @@ class UnityIntegrationView(AppBuilderBaseView):
return
oauth
.
unity
.
authorize_redirect
(
redirect_uri
)
return
oauth
.
unity
.
authorize_redirect
(
redirect_uri
)
@unity.route
(
'
/authorize
'
)
@unity.route
(
'
/authorize
'
)
async
def
authorize
():
def
authorize
():
token
=
await
oauth
.
unity
.
authorize_access_token
()
try
:
user
=
await
oauth
.
unity
.
userinfo
(
token
=
token
)
token
=
oauth
.
unity
.
authorize_access_token
()
except
:
abort
(
403
)
user
=
oauth
.
unity
.
userinfo
(
token
=
token
)
# get relevant data from token
# get relevant data from token
email
=
user
[
'
email
'
]
email
=
user
[
'
email
'
]
persistent_identifier
=
user
[
"
sub
"
]
persistent_identifier
=
user
[
"
sub
"
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment