Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
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
Maunium
synapse
Commits
e51b2f3f
Unverified
Commit
e51b2f3f
authored
4 years ago
by
Richard van der Hoff
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Tighten the restrictions on `idp_id` (#9177)
parent
0cd2938b
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
changelog.d/9177.feature
+1
-0
1 addition, 0 deletions
changelog.d/9177.feature
synapse/config/oidc_config.py
+9
-3
9 additions, 3 deletions
synapse/config/oidc_config.py
with
10 additions
and
3 deletions
changelog.d/9177.feature
0 → 100644
+
1
−
0
View file @
e51b2f3f
Add
support
for
multiple
SSO
Identity
Providers.
This diff is collapsed.
Click to expand it.
synapse/config/oidc_config.py
+
9
−
3
View file @
e51b2f3f
...
@@ -331,17 +331,23 @@ def _parse_oidc_config_dict(
...
@@ -331,17 +331,23 @@ def _parse_oidc_config_dict(
config_path
+
(
"
user_mapping_provider
"
,
"
module
"
),
config_path
+
(
"
user_mapping_provider
"
,
"
module
"
),
)
)
# MSC2858 will appy certain limits in what can be used as an IdP id, so let's
# MSC2858 will app
l
y certain limits in what can be used as an IdP id, so let's
# enforce those limits now.
# enforce those limits now.
# TODO: factor out this stuff to a generic function
idp_id
=
oidc_config
.
get
(
"
idp_id
"
,
"
oidc
"
)
idp_id
=
oidc_config
.
get
(
"
idp_id
"
,
"
oidc
"
)
valid_idp_chars
=
set
(
string
.
ascii_l
etters
+
string
.
digits
+
"
-._
~
"
)
valid_idp_chars
=
set
(
string
.
ascii_l
owercase
+
string
.
digits
+
"
-._
"
)
if
any
(
c
not
in
valid_idp_chars
for
c
in
idp_id
):
if
any
(
c
not
in
valid_idp_chars
for
c
in
idp_id
):
raise
ConfigError
(
raise
ConfigError
(
'
idp_id may only contain
A-Z,
a-z, 0-9,
"
-
"
,
"
.
"
,
"
_
"
,
"
~
"
'
,
'
idp_id may only contain a-z, 0-9,
"
-
"
,
"
.
"
,
"
_
"'
,
config_path
+
(
"
idp_id
"
,),
config_path
+
(
"
idp_id
"
,),
)
)
if
idp_id
[
0
]
not
in
string
.
ascii_lowercase
:
raise
ConfigError
(
"
idp_id must start with a-z
"
,
config_path
+
(
"
idp_id
"
,),
)
# MSC2858 also specifies that the idp_icon must be a valid MXC uri
# MSC2858 also specifies that the idp_icon must be a valid MXC uri
idp_icon
=
oidc_config
.
get
(
"
idp_icon
"
)
idp_icon
=
oidc_config
.
get
(
"
idp_icon
"
)
if
idp_icon
is
not
None
:
if
idp_icon
is
not
None
:
...
...
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