in which pylon replaces intercom (#2783)

This commit is contained in:
Shuchang Zheng
2025-06-25 05:45:07 +08:00
committed by GitHub
parent 6b5699a98c
commit 60dcd6bcb1
7 changed files with 91 additions and 4 deletions

View File

@@ -1,6 +1,7 @@
from skyvern.forge.sdk.routes import agent_protocol # noqa: F401
from skyvern.forge.sdk.routes import browser_sessions # noqa: F401
from skyvern.forge.sdk.routes import credentials # noqa: F401
from skyvern.forge.sdk.routes import pylon # noqa: F401
from skyvern.forge.sdk.routes import streaming # noqa: F401
from skyvern.forge.sdk.routes import streaming_commands # noqa: F401
from skyvern.forge.sdk.routes import streaming_vnc # noqa: F401

View File

@@ -0,0 +1,34 @@
import hashlib
import hmac
import structlog
from fastapi import Query
from skyvern.config import settings
from skyvern.forge.sdk.routes.routers import base_router
from skyvern.forge.sdk.schemas.pylon import PylonHash
LOG = structlog.get_logger()
@base_router.get(
"/pylon/email_hash",
include_in_schema=False,
response_model=PylonHash,
)
def get_pylon_email_hash(email: str = Query(...)) -> PylonHash:
no_hash = "???-no-hash-???"
secret = settings.PYLON_IDENTITY_VERIFICATION_SECRET
if not secret:
LOG.error("No Pylon identity verification secret", email=email)
return PylonHash(hash=no_hash)
try:
secret_bytes = bytes.fromhex(secret)
signature = hmac.new(secret_bytes, email.encode(), hashlib.sha256).hexdigest()
return PylonHash(hash=signature)
except Exception:
LOG.exception("Failed to generate Pylon email hash", email=email)
return PylonHash(hash=no_hash)

View File

@@ -0,0 +1,5 @@
from pydantic import BaseModel
class PylonHash(BaseModel):
hash: str