fix(SKY-11914): require auth for pylon email hash (#7142)

This commit is contained in:
Aaron Perez 2026-07-06 18:20:57 -05:00 committed by GitHub
parent 3c2c44c11a
commit af2a0ffcbd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 0 additions and 35 deletions

View file

@ -7,7 +7,6 @@ from skyvern.forge.sdk.routes import credentials # noqa: F401
from skyvern.forge.sdk.routes import custom_llms # noqa: F401
from skyvern.forge.sdk.routes import debug_sessions # noqa: F401
from skyvern.forge.sdk.routes import prompts # noqa: F401
from skyvern.forge.sdk.routes import pylon # noqa: F401
from skyvern.forge.sdk.routes import run_blocks # noqa: F401
from skyvern.forge.sdk.routes import runtime_config # noqa: F401
from skyvern.forge.sdk.routes import scripts # noqa: F401

View file

@ -1,34 +0,0 @@
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.warning("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)