Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
fts-rest-flask
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
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
File Transfer Service
fts-rest-flask
Commits
3ca291b7
Commit
3ca291b7
authored
2 years ago
by
Mihai Patrascoiu
Browse files
Options
Downloads
Patches
Plain Diff
FTS-1835
: Allow FTS-REST to read and store custom configuration options for TokenProviders
parent
23898c81
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/fts3rest/fts3rest/config/config.py
+12
-0
12 additions, 0 deletions
src/fts3rest/fts3rest/config/config.py
src/fts3rest/fts3rest/lib/openidconnect.py
+3
-0
3 additions, 0 deletions
src/fts3rest/fts3rest/lib/openidconnect.py
with
15 additions
and
0 deletions
src/fts3rest/fts3rest/config/config.py
+
12
−
0
View file @
3ca291b7
...
...
@@ -119,6 +119,18 @@ def fts3_config_load(path="/etc/fts3/fts3restconfig", test=False):
fts3cfg
[
"
fts3.Providers
"
][
provider_url
][
"
client_id
"
]
=
client_id
client_secret
=
parser
.
get
(
"
providers
"
,
option
+
"
_ClientSecret
"
)
fts3cfg
[
"
fts3.Providers
"
][
provider_url
][
"
client_secret
"
]
=
client_secret
# Add custom configuration items for this provider
fts3cfg
[
"
fts3.Providers
"
][
provider_url
][
"
custom
"
]
=
{}
custom_options_filter
=
filter
(
lambda
op
:
provider_name
+
"
_
"
in
op
and
"
_Client
"
not
in
op
,
parser
.
options
(
"
providers
"
),
)
for
item
in
list
(
custom_options_filter
):
fts3cfg
[
"
fts3.Providers
"
][
provider_url
][
"
custom
"
][
item
.
lstrip
(
provider_name
+
"
_
"
)
]
=
parser
.
get
(
"
providers
"
,
item
)
fts3cfg
[
"
fts3.ValidateAccessTokenOffline
"
]
=
parser
.
getboolean
(
"
fts3
"
,
"
ValidateAccessTokenOffline
"
,
fallback
=
True
)
...
...
This diff is collapsed.
Click to expand it.
src/fts3rest/fts3rest/lib/openidconnect.py
+
3
−
0
View file @
3ca291b7
...
...
@@ -22,6 +22,7 @@ class OIDCmanager:
def
__init__
(
self
):
self
.
clients
=
{}
self
.
clients_config
=
{}
self
.
config
=
None
def
setup
(
self
,
config
):
...
...
@@ -46,6 +47,8 @@ class OIDCmanager:
if
"
introspection_endpoint
"
not
in
client
.
provider_info
:
log
.
warning
(
"
{} -- missing introspection endpoint
"
.
format
(
issuer
))
self
.
clients
[
issuer
]
=
client
# Store custom configuration options for this provider
self
.
clients_config
[
issuer
]
=
providers_config
[
provider
][
"
custom
"
]
except
Exception
as
ex
:
log
.
warning
(
"
Exception registering provider: {}
"
.
format
(
provider
))
log
.
warning
(
ex
)
...
...
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