Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DQSegDB Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
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
Duncan Macleod
DQSegDB Server
Commits
0b7d7070
Unverified
Commit
0b7d7070
authored
1 year ago
by
Duncan Macleod
Browse files
Options
Downloads
Patches
Plain Diff
LDBDWAuth: support multiple scitoken issuers
and add igwn-test and CIT local issuer to list of supported issuers
parent
2f449cef
Branches
main
No related tags found
No related merge requests found
Pipeline
#598469
passed
1 year ago
Stage: Syntax check
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Constants.py
+5
-1
5 additions, 1 deletion
src/Constants.py
src/LDBDWAuth.py
+12
-1
12 additions, 1 deletion
src/LDBDWAuth.py
with
17 additions
and
2 deletions
src/Constants.py
+
5
−
1
View file @
0b7d7070
...
@@ -65,7 +65,11 @@ class ConstantsHandle():
...
@@ -65,7 +65,11 @@ class ConstantsHandle():
########################
########################
# SciTokens constants #
# SciTokens constants #
######################
######################
scitokens_issuer
=
'
https://cilogon.org/igwn
'
scitokens_issuer
=
[
'
https://cilogon.org/igwn
'
,
'
https://test.cilogon.org/igwn
'
,
'
https://osdf.igwn.org/cit
'
,
]
scitokens_audience
=
'
https://segments.ligo.org
'
scitokens_audience
=
'
https://segments.ligo.org
'
scitokens_cache_dir
=
'
/var/cache/httpd
'
scitokens_cache_dir
=
'
/var/cache/httpd
'
...
...
This diff is collapsed.
Click to expand it.
src/LDBDWAuth.py
+
12
−
1
View file @
0b7d7070
...
@@ -219,12 +219,23 @@ class GridmapAuthorization:
...
@@ -219,12 +219,23 @@ class GridmapAuthorization:
# Return.
# Return.
return
r
return
r
class
MultiIssuerEnforcer
(
scitokens
.
Enforcer
):
def
__init__
(
self
,
issuer
,
**
kwargs
):
if
not
isinstance
(
issuer
,
(
tuple
,
list
)):
issuer
=
[
issuer
]
super
().
__init__
(
issuer
,
**
kwargs
)
def
_validate_iss
(
self
,
value
):
return
value
in
self
.
_issuer
class
SciTokensAuthorization
():
class
SciTokensAuthorization
():
def
__init__
(
self
):
def
__init__
(
self
):
self
.
admin
=
Admin
.
AdminHandle
()
self
.
admin
=
Admin
.
AdminHandle
()
self
.
constant
=
Constants
.
ConstantsHandle
()
self
.
constant
=
Constants
.
ConstantsHandle
()
os
.
environ
[
'
XDG_CACHE_HOME
'
]
=
self
.
constant
.
scitokens_cache_dir
os
.
environ
[
'
XDG_CACHE_HOME
'
]
=
self
.
constant
.
scitokens_cache_dir
self
.
token_enforcer
=
scitokens
.
Enforcer
(
self
.
constant
.
scitokens_issuer
,
audience
=
self
.
constant
.
scitokens_audience
)
self
.
token_enforcer
=
MultiIssuer
Enforcer
(
self
.
constant
.
scitokens_issuer
,
audience
=
self
.
constant
.
scitokens_audience
)
def
check_authorization_scitoken
(
self
,
environ
,
req_method
,
full_uri
,
authorise
):
def
check_authorization_scitoken
(
self
,
environ
,
req_method
,
full_uri
,
authorise
):
"""
Check authorization with a Bearer token.
"""
Check authorization with a Bearer token.
...
...
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