scim: Add SCIMConfigDict.

This adds a `TypedDict` to provide better type annotation for the
configuration object for SCIM.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This commit is contained in:
Zixuan James Li 2022-07-01 07:50:26 -04:00 committed by Tim Abbott
parent 2b1820cfcf
commit 0952b024c1
3 changed files with 11 additions and 4 deletions

View File

@ -273,3 +273,9 @@ class RealmPlaygroundDict(TypedDict):
name: str
pygments_language: str
url_prefix: str
class SCIMConfigDict(TypedDict):
bearer_token: str
scim_client_name: str
name_formatted_included: bool

View File

@ -1,8 +1,9 @@
import os
import pwd
from typing import Optional, Set, Tuple
from typing import Dict, Optional, Set, Tuple
from scripts.lib.zulip_tools import deport
from zerver.lib.types import SCIMConfigDict
ZULIP_ADMINISTRATOR = "desdemona+admin@zulip.com"
@ -186,7 +187,7 @@ SOCIAL_AUTH_SUBDOMAIN = "auth"
MEMCACHED_USERNAME: Optional[str] = None
SCIM_CONFIG = {
SCIM_CONFIG: Dict[str, SCIMConfigDict] = {
"zulip": {
"bearer_token": "token1234",
"scim_client_name": "test-scim-client",

View File

@ -5,7 +5,7 @@ import ldap
from django_auth_ldap.config import LDAPSearch
from zerver.lib.db import TimeTrackingConnection, TimeTrackingCursor
from zerver.lib.types import SAMLIdPConfigDict
from zerver.lib.types import SAMLIdPConfigDict, SCIMConfigDict
from .config import DEPLOY_ROOT, get_from_file_if_exists
from .settings import (
@ -272,7 +272,7 @@ RATE_LIMITING_RULES: Dict[str, List[Tuple[int, int]]] = {
FREE_TRIAL_DAYS: Optional[int] = None
SCIM_CONFIG = {
SCIM_CONFIG: Dict[str, SCIMConfigDict] = {
"zulip": {
"bearer_token": "token1234",
"scim_client_name": "test-scim-client",