align workflow CLI commands with MCP parity (#4792)

This commit is contained in:
Marc Kelechava 2026-02-18 11:34:12 -08:00 committed by GitHub
parent 2f6850ce20
commit 46a7ec1d26
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 1609 additions and 151 deletions

View file

@ -0,0 +1,29 @@
from __future__ import annotations
import hashlib
import os
def _resolve_api_key_hash_iterations() -> int:
raw = os.environ.get("SKYVERN_MCP_API_KEY_HASH_ITERATIONS", "120000")
try:
return max(10_000, int(raw))
except ValueError:
return 120_000
_API_KEY_HASH_ITERATIONS = _resolve_api_key_hash_iterations()
_API_KEY_HASH_SALT = os.environ.get(
"SKYVERN_MCP_API_KEY_HASH_SALT",
"skyvern-mcp-api-key-cache-v1",
).encode("utf-8")
def hash_api_key_for_cache(api_key: str) -> str:
"""Derive a deterministic, non-reversible fingerprint for API-key keyed caches."""
return hashlib.pbkdf2_hmac(
"sha256",
api_key.encode("utf-8"),
_API_KEY_HASH_SALT,
_API_KEY_HASH_ITERATIONS,
).hex()