summary refs log tree commit diff
path: root/synapse/config/sso.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2021-02-11 10:05:15 -0500
committerGitHub <noreply@github.com>2021-02-11 10:05:15 -0500
commit6dade80048380166ac7543d96c4d4686401b1e37 (patch)
tree31e9f226a6f77a701a5849878c2b0cffd71b89c6 /synapse/config/sso.py
parentRemove conflicting sqlite tables that are "reserved" (shadow fts4 tables) (#9... (diff)
downloadsynapse-6dade80048380166ac7543d96c4d4686401b1e37.tar.xz
Combine the CAS & SAML implementations for required attributes. (#9326)
Diffstat (limited to 'synapse/config/sso.py')
-rw-r--r--synapse/config/sso.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/synapse/config/sso.py b/synapse/config/sso.py
index 6c60c6fea4..b94d3cd5e1 100644
--- a/synapse/config/sso.py
+++ b/synapse/config/sso.py
@@ -12,11 +12,28 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
-from typing import Any, Dict
+from typing import Any, Dict, Optional
+
+import attr
 
 from ._base import Config
 
 
+@attr.s(frozen=True)
+class SsoAttributeRequirement:
+    """Object describing a single requirement for SSO attributes."""
+
+    attribute = attr.ib(type=str)
+    # If a value is not given, than the attribute must simply exist.
+    value = attr.ib(type=Optional[str])
+
+    JSON_SCHEMA = {
+        "type": "object",
+        "properties": {"attribute": {"type": "string"}, "value": {"type": "string"}},
+        "required": ["attribute", "value"],
+    }
+
+
 class SSOConfig(Config):
     """SSO Configuration
     """