Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix workload token expiration for cached steps/runs #3243

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions src/zenml/zen_server/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,10 +413,7 @@ def get_pipeline_run_status(
logger.error(error)
raise CredentialsNotValid(error)

if pipeline_run_status in [
ExecutionStatus.FAILED,
ExecutionStatus.COMPLETED,
]:
if pipeline_run_status.is_finished:
error = (
f"The execution of pipeline run "
f"{decoded_token.pipeline_run_id} has already concluded and "
Expand Down Expand Up @@ -461,10 +458,7 @@ def get_step_run_status(
logger.error(error)
raise CredentialsNotValid(error)

if step_run_status in [
ExecutionStatus.FAILED,
ExecutionStatus.COMPLETED,
]:
if step_run_status.is_finished:
error = (
f"The execution of step run "
f"{decoded_token.step_run_id} has already concluded and "
Expand Down
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
Loading