feat: add telnyx webhook api key in telephony config (#270)

This commit is contained in:
Sabiha Khan 2026-05-09 18:03:42 +05:30 committed by GitHub
parent 45a81c88e0
commit 01c201bf09
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 249 additions and 13 deletions

View file

@ -27,6 +27,7 @@ def _config_loader(value: Dict[str, Any]) -> Dict[str, Any]:
"provider": "telnyx",
"api_key": value.get("api_key"),
"connection_id": value.get("connection_id"),
"webhook_public_key": value.get("webhook_public_key"),
"from_numbers": value.get("from_numbers", []),
}
@ -124,6 +125,18 @@ _UI_METADATA = ProviderUIMetadata(
"blank and we will auto-create one for you on save."
),
),
ProviderUIField(
name="webhook_public_key",
label="Webhook Public Key",
type="textarea",
required=False,
sensitive=False,
description=(
"Public key from Mission Control Portal → Keys & Credentials "
"→ Public Key. Used to verify Telnyx webhook signatures. "
"Without it, webhooks from Telnyx will be rejected."
),
),
ProviderUIField(
name="from_numbers",
label="Phone Numbers",

View file

@ -18,6 +18,14 @@ class TelnyxConfigurationRequest(BaseModel):
"stored on the configuration."
),
)
webhook_public_key: Optional[str] = Field(
default=None,
description=(
"Webhook public key from Mission Control Portal → Keys & "
"Credentials → Public Key. Used to verify Telnyx webhook "
"signatures."
),
)
# Phone numbers are managed via the dedicated phone-numbers endpoints; the
# legacy /telephony-config POST shim still accepts them inline.
from_numbers: List[str] = Field(
@ -31,4 +39,5 @@ class TelnyxConfigurationResponse(BaseModel):
provider: Literal["telnyx"] = Field(default="telnyx")
api_key: str # Masked
connection_id: Optional[str] = None
webhook_public_key: Optional[str] = None
from_numbers: List[str]

View file

@ -48,6 +48,7 @@ class TelnyxProvider(TelephonyProvider):
def __init__(self, config: Dict[str, Any]):
self.api_key = config.get("api_key")
self.connection_id = config.get("connection_id")
self.webhook_public_key = config.get("webhook_public_key")
self.from_numbers = config.get("from_numbers", [])
if isinstance(self.from_numbers, str):