-
Notifications
You must be signed in to change notification settings - Fork 24
feat(dgw): preflight API #1279
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
feat(dgw): preflight API #1279
Conversation
Possible operations: - `get-version` - `get-agent-version` - `get-running-session-count` - `get-recording-storage-health` - `push-token` - `push-credentials` - `lookup-host` Possible results: - `version` - `agent-version` - `running-session-count` - `recording-storage-health` - `resolved-host` - `alert` Issue: DGW-245
| PreflightOperationKind::PushToken { token_id, token } => { | ||
| results.push(PreflightResult { | ||
| operation_id: operation.id, | ||
| kind: PreflightResultKind::Alert { | ||
| status: PreflightAlertStatus::GeneralFailure, | ||
| message: "unimplemented".to_owned(), | ||
| }, | ||
| }); | ||
| } | ||
| PreflightOperationKind::PushCredentials { | ||
| credentials_id, | ||
| credentials, | ||
| } => { | ||
| results.push(PreflightResult { | ||
| operation_id: operation.id, | ||
| kind: PreflightResultKind::Alert { | ||
| status: PreflightAlertStatus::GeneralFailure, | ||
| message: "unimplemented".to_owned(), | ||
| }, | ||
| }); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For a follow up PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The OpenAPI clients will be regenerated in a follow up PR.
DemoGenerate a scope token with the scope tokengen --provisioner-key <path/to/provisioner.key> scope 'gateway.preflight'New-DGatewayToken -Type SCOPE -Scope 'gateway.preflight'Perform preflight operations using $ curl "127.0.0.1:7171/jet/preflight?token=$(cargo run --manifest-path ./tools/tokengen/Cargo.toml '--' sign --provisioner-key ./config/provisioner.key scope "gateway.preflight")" \
-X POST -H "Content-Type: application/json" \
--data '[
{"id": "a86ae982-e4be-4f84-8ff2-893d66df9bdd", "kind": "get-version"},
{"id": "ef1a3ae9-e55d-48b8-92b0-ae67c29b2e4e", "kind": "push-token", "token": "hello", "token_id": "3d1d3c45-e377-4713-b8d5-45b07514cf22"},
{"id": "55821d24-d1df-481c-8b88-66c06f879835", "kind": "lookup-host", "host_to_lookup": "devolutions.net"},
{"id": "8ec4ab6b-39a5-411d-b191-54df2d976820", "kind": "get-running-session-count"}
]'And here is how the response looks like: |
pacmancoder
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Possible operations:
get-versionget-agent-versionget-running-session-countget-recording-storage-healthpush-tokenpush-credentialslookup-hostPossible results:
versionagent-versionrunning-session-countrecording-storage-healthresolved-hostalertIssue: DGW-245