fix creating org token encryption issue (#3111)

This commit is contained in:
LawyZheng
2025-08-06 13:39:36 +08:00
committed by GitHub
parent b57edfc24b
commit 027b6b77f8

View File

@@ -2,7 +2,7 @@ from datetime import timedelta
import structlog import structlog
from skyvern.forge.app import DATABASE from skyvern.forge import app
from skyvern.forge.sdk.core import security from skyvern.forge.sdk.core import security
from skyvern.forge.sdk.schemas.organizations import OrganizationAuthToken, OrganizationAuthTokenType from skyvern.forge.sdk.schemas.organizations import OrganizationAuthToken, OrganizationAuthTokenType
@@ -20,7 +20,7 @@ async def create_org_api_token(org_id: str) -> OrganizationAuthToken:
The API token created for the specified org_id. The API token created for the specified org_id.
""" """
# get the organization # get the organization
organization = await DATABASE.get_organization(org_id) organization = await app.DATABASE.get_organization(org_id)
if not organization: if not organization:
raise Exception(f"Organization id {org_id} not found") raise Exception(f"Organization id {org_id} not found")
@@ -30,7 +30,7 @@ async def create_org_api_token(org_id: str) -> OrganizationAuthToken:
expires_delta=API_KEY_LIFETIME, expires_delta=API_KEY_LIFETIME,
) )
# generate OrganizationAutoToken # generate OrganizationAutoToken
org_auth_token = await DATABASE.create_org_auth_token( org_auth_token = await app.DATABASE.create_org_auth_token(
organization_id=org_id, organization_id=org_id,
token=api_key, token=api_key,
token_type=OrganizationAuthTokenType.api, token_type=OrganizationAuthTokenType.api,