Repository navigation
feat(dgw): explain rejected requests in API error responses - #2081
Open
Benoît Cortier (CBenoit) wants to merge 6 commits into
Open
Benoît Cortier (CBenoit) wants to merge 6 commits into
Benoît Cortier (CBenoit) wants to merge 6 commits into
Conversation
API errors now include a machine-readable reason (RFC 9457 problem details). Devolutions Server, Devolutions Hub and other clients can show precise errors, such as a provisioner key mismatch, an expired token (clock skew) or a gateway ID mismatch, instead of a generic failure. Issue: DGW-467 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Issue: DGW-467 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Issue: DGW-467 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Implementation notes: Format
One list of codes
Disclosure
OpenAPI and clients
Not covered yet
Testing
|
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
One or more issues must be addressed before approval.
0 open findings
What changed in this PR
Adds machine-readable API rejection reasons to help clients diagnose Gateway authentication failures without exposing internal details.
Changes:
- Adds stable error codes, RFC 9457 responses, and bearer-token challenges.
- Documents the response format and updates generated clients.
- Adds error-code tests and token-signing helpers.
No material findings identified. Tests were not executed. The separate prose-verifier pass was skipped due to the five-skill limit.
| File | Description |
|---|---|
| testsuite/tests/main.rs | Updated as part of this pull request. |
| testsuite/tests/error_codes.rs | Updated as part of this pull request. |
| testsuite/tests/cli/dgw/mod.rs | Updated as part of this pull request. |
| testsuite/src/token.rs | Updated as part of this pull request. |
| testsuite/src/lib.rs | Updated as part of this pull request. |
| testsuite/src/dgw_config.rs | Updated as part of this pull request. |
| testsuite/Cargo.toml | Updated as part of this pull request. |
| docs/API-spec.md | Updated as part of this pull request. |
| devolutions-gateway/tests/webapp.rs | Updated as part of this pull request. |
| devolutions-gateway/src/token.rs | Updated as part of this pull request. |
| devolutions-gateway/src/openapi.rs | Updated as part of this pull request. |
| devolutions-gateway/src/middleware/auth.rs | Updated as part of this pull request. |
| devolutions-gateway/src/lib.rs | Updated as part of this pull request. |
| devolutions-gateway/src/http.rs | Updated as part of this pull request. |
| devolutions-gateway/src/error_code.rs | Updated as part of this pull request. |
| devolutions-gateway/src/api/webapp.rs | Updated as part of this pull request. |
| devolutions-gateway/src/api/update.rs | Updated as part of this pull request. |
| devolutions-gateway/src/api/tunnel.rs | Updated as part of this pull request. |
| devolutions-gateway/src/api/traffic.rs | Updated as part of this pull request. |
| devolutions-gateway/src/api/sessions.rs | Updated as part of this pull request. |
| devolutions-gateway/src/api/session.rs | Updated as part of this pull request. |
| devolutions-gateway/src/api/preflight.rs | Updated as part of this pull request. |
| devolutions-gateway/src/api/net.rs | Updated as part of this pull request. |
| devolutions-gateway/src/api/monitoring.rs | Updated as part of this pull request. |
| devolutions-gateway/src/api/jrl.rs | Updated as part of this pull request. |
| devolutions-gateway/src/api/jrec.rs | Updated as part of this pull request. |
| devolutions-gateway/src/api/heartbeat.rs | Updated as part of this pull request. |
| devolutions-gateway/src/api/diagnostics.rs | Updated as part of this pull request. |
| devolutions-gateway/src/api/config.rs | Updated as part of this pull request. |
| devolutions-gateway/openapi/ts-angular-client/README.md | Updated as part of this pull request. |
| devolutions-gateway/openapi/ts-angular-client/model/models.ts | Updated as part of this pull request. |
| devolutions-gateway/openapi/ts-angular-client/model/errorCode.ts | Updated as part of this pull request. |
| devolutions-gateway/openapi/ts-angular-client/model/apiError.ts | Updated as part of this pull request. |
| devolutions-gateway/openapi/ts-angular-client/api/update.service.ts | Updated as part of this pull request. |
| devolutions-gateway/openapi/ts-angular-client/api/traffic.service.ts | Updated as part of this pull request. |
| devolutions-gateway/openapi/ts-angular-client/api/sessions.service.ts | Updated as part of this pull request. |
| devolutions-gateway/openapi/ts-angular-client/api/preflight.service.ts | Updated as part of this pull request. |
| devolutions-gateway/openapi/ts-angular-client/api/networkMonitoring.service.ts | Updated as part of this pull request. |
| devolutions-gateway/openapi/ts-angular-client/api/net.service.ts | Updated as part of this pull request. |
| devolutions-gateway/openapi/ts-angular-client/api/jrl.service.ts | Updated as part of this pull request. |
| devolutions-gateway/openapi/ts-angular-client/api/jrec.service.ts | Updated as part of this pull request. |
| devolutions-gateway/openapi/ts-angular-client/api/heartbeat.service.ts | Updated as part of this pull request. |
| devolutions-gateway/openapi/ts-angular-client/api/diagnostics.service.ts | Updated as part of this pull request. |
| devolutions-gateway/openapi/ts-angular-client/api/config.service.ts | Updated as part of this pull request. |
| devolutions-gateway/openapi/ts-angular-client/api/agent.service.ts | Updated as part of this pull request. |
| devolutions-gateway/openapi/ts-angular-client/.openapi-generator/FILES | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/UpdateRequestSchema.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/UpdateProductInfo.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/TransportProtocolResponse.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/TrafficEventResponse.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/TargetConnectionOptions.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/Subscriber.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SubProvisionerKey.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SetUpdateScheduleRequest.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SetConfigResponse.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SessionTokenSignRequest.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SessionTokenContentType.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SessionInfo.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ScanResultSourceDto.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ScanOriginDto.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/PubKeyFormat.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/PreflightOutputKind.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/PreflightOutput.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/PreflightOperationKind.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/PreflightOperation.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/PreflightAlertStatus.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkScanSourceDto.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkScanSourceCapabilitiesDto.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkScanResultKindDto.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkScanResultEventDto.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkInterfacesResponse.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkInterfaceDto.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitorsConfig.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitorResult.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitoringProbeTypeOneOf.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitoringProbeType.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitoringLogResponse.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitorDefinitionProbeTypeError.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitorDefinition.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ListenerUrls.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/JrlInfo.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/InterfaceInfo.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/Identity.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/HostScanStateDto.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/Heartbeat.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/GetUpdateScheduleResponse.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/GetUpdateProductsResponse.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/EventOutcomeResponse.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/EnrollResponse.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/EnrollRequest.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/DeleteManyResult.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/DataEncoding.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ConnectionMode.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ConfigPatch.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ConfigDiagnostic.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ClockDiagnostic.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ClaimedTrafficEvent.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AppTokenSignRequest.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AppTokenContentType.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AppCredentialKind.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AppCredential.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ApiError.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AgentStatus.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AgentInfo.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AgentDomainAdvertisement.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AddressFamily.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AckResponse.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AckRequest.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AccessScope.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AbstractOpenAPISchema.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/WebRequestPathBuilder.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/RetryConfiguration.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/RequestOptions.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/OpenAPIDateConverter.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/Multimap.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/ISynchronousClient.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/IReadableConfiguration.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/IAsynchronousClient.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/IApiAccessor.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/GlobalConfiguration.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/FileParameter.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/ExceptionFactory.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/Configuration.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/ClientUtils.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/ApiResponse.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/ApiException.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/ApiClient.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/WebAppApi.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/UpdateApi.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/TrafficApi.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/SessionsApi.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/PreflightApi.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/NetworkMonitoringApi.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/NetApi.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/JrlApi.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/JrecApi.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/HeartbeatApi.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/HealthApi.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/DiagnosticsApi.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/ConfigApi.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/AgentApi.cs | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/README.md | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/docs/UpdateApi.md | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/docs/TrafficApi.md | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/docs/SessionsApi.md | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/docs/PreflightApi.md | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/docs/NetworkMonitoringApi.md | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/docs/NetApi.md | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/docs/JrlApi.md | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/docs/JrecApi.md | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/docs/HeartbeatApi.md | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/docs/ErrorCode.md | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/docs/DiagnosticsApi.md | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/docs/ConfigApi.md | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/docs/ApiError.md | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/docs/AgentApi.md | Updated as part of this pull request. |
| devolutions-gateway/openapi/dotnet-client/.openapi-generator/FILES | Updated as part of this pull request. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…ateway into DGW-467-api-error-codes
…n-crate Tag the 403 of the new recording search scope with `insufficient_scope`, and declare the problem details body on the error responses of `/jet/jrec/search`. Move the `TokenError` mapping and code list tests next to the code, as `testsuite/CLAUDE.md` asks for tests of Gateway internals. Issue: DGW-467 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cite the documented error format and codes as the source of each new test's expected values, as the oracle marker check requires. - Document that a SCOPE token is valid for a single request, which the `unexpected_replay` test relies on. - Check `invalid_token` with an outdated revocation list, a documented rule, instead of the undocumented BRIDGE token lifetime limit. - Drop the uniqueness and format test of the code list: no source decides it, and the code list snapshot already pins every code. Issue: DGW-467 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
API errors now include a machine-readable reason (RFC 9457 problem details). Devolutions Server, Devolutions Hub and other clients can show precise errors, such as a provisioner key mismatch, an expired token (clock skew) or a gateway ID mismatch, instead of a generic failure.
Issue: DGW-467
🤖 Generated with Claude Code