This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add configuration setting for CAS protocol version #15816
Merged
Merged
Changes from 7 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
9fa253b
Update cas.py
agrimpard e04ede7
Update cas.py
agrimpard f3d22cc
Create 15807.feature
agrimpard 00553f6
Merge branch 'matrix-org:develop' into develop
agrimpard eb0a7ab
Update config_documentation.md
agrimpard 62ab53a
Update 15807.feature
agrimpard 8b51585
Rename 15807.feature to 15816.feature (issuer to PR)
agrimpard f079462
Handle CAS protocol version 1, 2 and 3 else it raise an error
agrimpard 46821f8
Merge branch 'develop' into develop
clokep f806669
Handle default CAS protocol version "none"
agrimpard 02acd2b
Import ConfigError since we eventually raise error
agrimpard d2f271b
lint !
agrimpard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add configuration setting for CAS protocol version. Contributed by Aurélien Grimpard. | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,6 +67,7 @@ def __init__(self, hs: "HomeServer"): | |
|
||
self._cas_server_url = hs.config.cas.cas_server_url | ||
self._cas_service_url = hs.config.cas.cas_service_url | ||
self._cas_protocol_version = hs.config.cas.cas_protocol_version | ||
self._cas_displayname_attribute = hs.config.cas.cas_displayname_attribute | ||
self._cas_required_attributes = hs.config.cas.cas_required_attributes | ||
|
||
|
@@ -120,7 +121,10 @@ async def _validate_ticket( | |
Returns: | ||
The parsed CAS response. | ||
""" | ||
uri = self._cas_server_url + "/proxyValidate" | ||
if self._cas_protocol_version == 3: | ||
uri = self._cas_server_url + "/p3/proxyValidate" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems legit -> spec docs for CAS protocol version 3: https://apereo.github.io/cas/6.6.x/protocol/CAS-Protocol-Specification.html#29-p3proxyvalidate-cas-30
|
||
else: | ||
uri = self._cas_server_url + "/proxyValidate" | ||
args = { | ||
"ticket": ticket, | ||
"service": self._build_service_param(service_args), | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Helpful docs for anyone looking at this: https://github.com/matrix-org/synapse/blob/d53547352063c3e66302f7bdc40d7ac7270e605c/docs/development/cas.md