Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PMCV force field correction web
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Vladimír Višňovský
PMCV force field correction web
Commits
e8f18e92
Commit
e8f18e92
authored
3 years ago
by
Vladimír Višňovský
Browse files
Options
Downloads
Patches
Plain Diff
Delete modules.py
parent
b3339582
No related branches found
No related tags found
2 merge requests
!8
Development
,
!7
Remodule (v1.0 -> v1.1)
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/pmcff/login/modules.py
+0
-40
0 additions, 40 deletions
app/pmcff/login/modules.py
with
0 additions
and
40 deletions
app/pmcff/login/modules.py
deleted
100644 → 0
+
0
−
40
View file @
b3339582
import
os
import
requests
from
__main__
import
login_manager
sys
.
path
.
insert
(
1
,
"
/app
"
)
from
user
import
User
sys
.
path
.
insert
(
1
,
"
/app/pmcff
"
)
from
db
import
get_connection
# Flask-Login helper to retrieve a user from db
@login_manager.user_loader
def
load_user
(
user_id
):
connection
=
get_connection
(
DATABASE
)
return
User
.
get
(
connection
,
user_id
)
def
get_provider_cfg
():
return
requests
.
get
(
DISCOVERY_URL
).
json
()
def
remove_deployment
(
user_id
):
os
.
system
(
f
'
kubectl delete -f /srv/
{
user_id
}
'
)
def
get_response
(
code
):
provider_cfg
=
get_provider_cfg
()
token_endpoint
=
provider_cfg
[
"
token_endpoint
"
]
client_auth
=
requests
.
auth
.
HTTPBasicAuth
(
CLIENT_ID
,
CLIENT_SECRET
)
post_data
=
{
"
grant_type
"
:
"
authorization_code
"
,
"
code
"
:
code
,
"
redirect_uri
"
:
REDIRECT_URI
}
headers
=
{
"
Content-Type
"
:
"
application/x-www-form-urlencoded
"
}
response
=
requests
.
post
(
token_endpoint
,
auth
=
client_auth
,
headers
=
headers
,
data
=
post_data
)
return
response
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