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
ad289b39
Commit
ad289b39
authored
2 years ago
by
Christian Boettcher
Browse files
Options
Downloads
Patches
Plain Diff
change import to already installed package
parent
9ae8e4c5
No related branches found
No related tags found
No related merge requests found
Pipeline
#131126
failed
2 years ago
Stage: build
Stage: deploy
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
plugins/__init__.py
+0
-0
0 additions, 0 deletions
plugins/__init__.py
plugins/unity_integration.py
+2
-4
2 additions, 4 deletions
plugins/unity_integration.py
with
2 additions
and
4 deletions
plugins/__init__.py
0 → 100644
+
0
−
0
View file @
ad289b39
This diff is collapsed.
Click to expand it.
plugins/unity_integration.py
+
2
−
4
View file @
ad289b39
import
os
,
random
,
string
import
os
,
random
,
string
from
authlib.integrations.flask_client
import
OAuth
from
authlib.integrations.flask_client
import
OAuth
from
flask
import
url_for
,
redirect
from
flask
import
url_for
,
redirect
,
current_app
as
app
from
flask_login
import
login_user
from
flask_login
import
login_user
from
flask_appbuilder
import
expose
,
BaseView
as
AppBuilderBaseView
from
flask_appbuilder
import
expose
,
BaseView
as
AppBuilderBaseView
from
airflow.utils.airflow_flask_app
import
get_airflow_app
from
airflow.plugins_manager
import
AirflowPlugin
from
airflow.plugins_manager
import
AirflowPlugin
import
logging
import
logging
import
os
import
os
...
@@ -15,7 +14,6 @@ FAB_ADMIN_ROLE = "Admin"
...
@@ -15,7 +14,6 @@ FAB_ADMIN_ROLE = "Admin"
FAB_VIEWER_ROLE
=
"
Viewer
"
FAB_VIEWER_ROLE
=
"
Viewer
"
FAB_PUBLIC_ROLE
=
"
Public
"
# The "Public" role is given no permissions
FAB_PUBLIC_ROLE
=
"
Public
"
# The "Public" role is given no permissions
app
=
get_airflow_app
()
oauth
=
OAuth
(
app
)
oauth
=
OAuth
(
app
)
oauth
.
register
(
oauth
.
register
(
name
=
'
unity
'
,
name
=
'
unity
'
,
...
@@ -53,7 +51,7 @@ class UnityIntegrationAuthView(AppBuilderBaseView):
...
@@ -53,7 +51,7 @@ class UnityIntegrationAuthView(AppBuilderBaseView):
# check airflow user backend
# check airflow user backend
# check if user already exists, if not create it (with long random password)
# check if user already exists, if not create it (with long random password)
sec_manager
=
app
.
appbuilder
.
sm
sec_manager
=
app
.
appbuilder
.
sm
fab_user
=
sec_manager
.
find_user
(
'
username
'
)
fab_user
=
sec_manager
.
find_user
(
username
=
persistent_identifier
)
if
fab_user
is
None
:
# TODO check if None is the rioght thing to compare to
if
fab_user
is
None
:
# TODO check if None is the rioght thing to compare to
characters
=
string
.
ascii_letters
+
string
.
digits
+
string
.
punctuation
characters
=
string
.
ascii_letters
+
string
.
digits
+
string
.
punctuation
fab_user
=
sec_manager
.
add_user
(
fab_user
=
sec_manager
.
add_user
(
...
...
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