-
Notifications
You must be signed in to change notification settings - Fork 0
feat(node): full dashboard auth and API parity #385
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
Merged
+5,948
−165
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
68eb5e2
feat(node): session auth for the dashboard
pratyush618 fa1e55d
feat(node): settings API, probes, scaler, and job detail routes
pratyush618 e385d83
feat(node): persist webhook deliveries, add rotate and replay
pratyush618 e79f5de
feat(node): task/queue overrides and middleware toggles
pratyush618 b96eec5
refactor(node): restructure dashboard into subpackages
pratyush618 7469453
feat(node): logs, circuit breakers, replay, and job DAG
pratyush618 0cdfa0f
feat(node): OAuth login for the dashboard
pratyush618 a6d624d
feat(node): proxy and interception stats endpoints
pratyush618 4a7c651
fix(node): avoid regex backtracking in oauth callback url
pratyush618 2c7180b
fix(node): run replay_job off the event loop
pratyush618 b88212c
fix(node): dedupe job DAG edges
pratyush618 6379447
fix(node): reject OIDC slots sharing an env prefix
pratyush618 262020c
fix(node): require exp and azp checks on id_tokens
pratyush618 5119b7c
fix(node): require https on discovered OIDC endpoints
pratyush618 63524ce
fix(node): harden auth store writes
pratyush618 3fe0577
fix(node): enforce settings value cap in bytes
pratyush618 864addd
fix(node): bind dashboard after env admin bootstrap
pratyush618 02dd678
fix(node): degraded readiness 503, safe oauth slot decode
pratyush618 eaeb8a0
fix(node): clamp delivery log pagination inputs
pratyush618 c9c521f
fix(node): catch detached webhook dispatch failures
pratyush618 84d2e7b
fix(node): resolve middleware chain before task resources
pratyush618 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| //! JS shapes for operational inspection: circuit breakers, replay history, | ||
| //! and the job dependency DAG. | ||
|
|
||
| use napi_derive::napi; | ||
| use taskito_core::storage::models::{CircuitBreakerRow, ReplayHistoryRow}; | ||
|
|
||
| use super::JsJob; | ||
|
|
||
| /// A task's circuit-breaker state (the dashboard-facing subset). | ||
| #[napi(object)] | ||
| pub struct JsCircuitBreaker { | ||
| pub task_name: String, | ||
| /// `closed`, `open`, or `half_open`. | ||
| pub state: String, | ||
| pub failure_count: i32, | ||
| pub last_failure_at: Option<i64>, | ||
| pub opened_at: Option<i64>, | ||
| pub threshold: i32, | ||
| pub window_ms: i64, | ||
| pub cooldown_ms: i64, | ||
| } | ||
|
|
||
| pub fn circuit_breaker_to_js(row: CircuitBreakerRow) -> JsCircuitBreaker { | ||
| let state = match row.state { | ||
| 1 => "open", | ||
| 2 => "half_open", | ||
| _ => "closed", | ||
| }; | ||
| JsCircuitBreaker { | ||
| task_name: row.task_name, | ||
| state: state.to_string(), | ||
| failure_count: row.failure_count, | ||
| last_failure_at: row.last_failure_at, | ||
| opened_at: row.opened_at, | ||
| threshold: row.threshold, | ||
| window_ms: row.window_ms, | ||
| cooldown_ms: row.cooldown_ms, | ||
| } | ||
| } | ||
|
|
||
| /// One replay of a job (result blobs are omitted; ids + errors suffice). | ||
| #[napi(object)] | ||
| pub struct JsReplayEntry { | ||
| pub id: String, | ||
| pub original_job_id: String, | ||
| pub replay_job_id: String, | ||
| pub replayed_at: i64, | ||
| pub original_error: Option<String>, | ||
| pub replay_error: Option<String>, | ||
| } | ||
|
|
||
| pub fn replay_to_js(row: ReplayHistoryRow) -> JsReplayEntry { | ||
| JsReplayEntry { | ||
| id: row.id, | ||
| original_job_id: row.original_job_id, | ||
| replay_job_id: row.replay_job_id, | ||
| replayed_at: row.replayed_at, | ||
| original_error: row.original_error, | ||
| replay_error: row.replay_error, | ||
| } | ||
| } | ||
|
|
||
| /// A `dependency -> dependent` edge in a job DAG. | ||
| #[napi(object)] | ||
| pub struct JsDagEdge { | ||
| pub from: String, | ||
| pub to: String, | ||
| } | ||
|
|
||
| /// The dependency DAG reachable from one job. | ||
| #[napi(object)] | ||
| pub struct JsJobDag { | ||
| pub nodes: Vec<JsJob>, | ||
| pub edges: Vec<JsDagEdge>, | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.