Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
shared-libs
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor 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
Pi-Lab
shared-libs
Commits
5ab1bc1c
Commit
5ab1bc1c
authored
2 years ago
by
istmxrein
Browse files
Options
Downloads
Patches
Plain Diff
update lib and add function to check access for cube id
parent
3e6e67dd
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pilab/auth.py
+10
-0
10 additions, 0 deletions
pilab/auth.py
setup.py
+1
-1
1 addition, 1 deletion
setup.py
with
11 additions
and
1 deletion
pilab/auth.py
+
10
−
0
View file @
5ab1bc1c
...
@@ -53,3 +53,13 @@ async def verify_user(cube_id: int, x_forwarded_preferred_username: Optional[str
...
@@ -53,3 +53,13 @@ async def verify_user(cube_id: int, x_forwarded_preferred_username: Optional[str
return
True
return
True
raise
HTTPException
(
status_code
=
401
,
detail
=
"
Unauthorized
"
)
raise
HTTPException
(
status_code
=
401
,
detail
=
"
Unauthorized
"
)
def
verify_user_pi
(
cube_id
:
int
,
username
:
str
,
admin
:
bool
):
if
admin
:
return
True
elif
username
is
not
None
and
CUBE_ACCESS_LIST
.
get
(
cube_id
)
is
not
None
:
if
username
in
CUBE_ACCESS_LIST
.
get
(
cube_id
):
return
True
return
False
This diff is collapsed.
Click to expand it.
setup.py
+
1
−
1
View file @
5ab1bc1c
...
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
...
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
setup
(
setup
(
name
=
'
pilab
'
,
name
=
'
pilab
'
,
version
=
'
0.
2
.0
'
,
version
=
'
0.
3
.0
'
,
description
=
'
Shared-Libs for the pi-lab microservices
'
,
description
=
'
Shared-Libs for the pi-lab microservices
'
,
url
=
'
https://code.fbi.h-da.de/api/v4/projects/27896/packages/pypi/pilab
'
,
url
=
'
https://code.fbi.h-da.de/api/v4/projects/27896/packages/pypi/pilab
'
,
author
=
'
Max Reinheimer
'
,
author
=
'
Max Reinheimer
'
,
...
...
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