diff --git a/edb/server/protocol/auth_ext/config.py b/edb/server/protocol/auth_ext/config.py index 40561e9f38c4..90105d044a85 100644 --- a/edb/server/protocol/auth_ext/config.py +++ b/edb/server/protocol/auth_ext/config.py @@ -87,6 +87,7 @@ class MagicLinkProviderConfig(ProviderConfig): name: Literal["builtin::local_magic_link"] token_time_to_live: statypes.Duration + @dataclass class WebhookConfig: events: list[str] diff --git a/edb/server/protocol/auth_ext/webhook.py b/edb/server/protocol/auth_ext/webhook.py index 261d2d6ed056..6ae756b496a6 100644 --- a/edb/server/protocol/auth_ext/webhook.py +++ b/edb/server/protocol/auth_ext/webhook.py @@ -139,4 +139,11 @@ async def send( ) result = json.loads(result_json) - return result[0]["id"] + match result[0]["id"]: + case str(id): + return id + case _: + raise ValueError( + "Expected single result with 'id' string property, got " + f"{result[0]!r}" + )