Skip to content

Commit

Permalink
Fix workload token expiration for cached steps/runs
Browse files Browse the repository at this point in the history
  • Loading branch information
schustmi committed Dec 4, 2024
1 parent 61988c0 commit 09fde96
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/zenml/zen_server/routers/auth_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
from zenml.enums import (
APITokenType,
AuthScheme,
ExecutionStatus,
OAuthDeviceStatus,
OAuthGrantTypes,
)
Expand Down Expand Up @@ -589,10 +588,7 @@ def api_token(
"security reasons."
)

if pipeline_run.status in [
ExecutionStatus.FAILED,
ExecutionStatus.COMPLETED,
]:
if pipeline_run.status.is_finished:
raise ValueError(
f"The execution of pipeline run {pipeline_run_id} has already "
"concluded and API tokens can no longer be generated for it "
Expand All @@ -609,10 +605,7 @@ def api_token(
"be generated for non-existent step runs for security reasons."
)

if step_run.status in [
ExecutionStatus.FAILED,
ExecutionStatus.COMPLETED,
]:
if step_run.status.is_finished:
raise ValueError(
f"The execution of step run {step_run_id} has already "
"concluded and API tokens can no longer be generated for it "
Expand Down

0 comments on commit 09fde96

Please sign in to comment.