Skip to content

feat(dgw): add Session Recording Log artifacts - #1857

Merged
Benoît Cortier (CBenoit) merged 1 commit into
masterfrom
kristahouse-activity-log-recordings
Jul 16, 2026
Merged

Benoît Cortier (CBenoit) merged 1 commit into
masterfrom
kristahouse-activity-log-recordings

Conversation

@kristahouse

@kristahouse Krista House (kristahouse) commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

Adds server-side support for Session Recording Log recording artifacts.

Gateway can now accept JREC recording pushes with fileType=slog, persist the raw UTF-8 NDJSON stream as .slog, and serve .slog downloads with the application/x-ndjson content type. This establishes the Gateway storage contract needed by AD Session Recording Log producers and future viewers. Consumers derive the artifact type from the file extension in recording.json.

This PR only adds the Gateway recording storage contract. Token generation remains provided by the host system, such as DVLS. Gateway standalone webapp sandbox wiring will follow separately on top of this server contract.

Issue: DGW-403

Copilot AI review requested due to automatic review settings July 15, 2026 18:21
@kristahouse

Krista House (kristahouse) commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor Author

Implementation notes:

  • Adds RecordingFileType::SessionRecordingLog with wire value slog, stored extension .slog, and application/x-ndjson pull content type.
  • Extends recording.json entries with fileType, while reading older manifests by inferring missing file types from extensions.
    • Removed after review; the file type is derivable from the fileName extension, so the manifest is unchanged and consumers derive the type locally.
  • Keeps Gateway write behavior as raw byte passthrough; Gateway does not parse or semantically validate SLOG NDJSON.
  • Adds standalone webapp server support to issue JREC push tokens through /jet/webapp/session-token and exposes WebApp.EnableSessionRecording through config/health for the later sandbox UI PR.
    • Removed from this PR after review; standalone webapp token/config/health support belongs in the follow-up sandbox PR if needed.
  • Follow-up PR will wire the Gateway standalone AD webapp toggle/package integration on top of this server contract.
  • Follow-up refactor PR planned: use RecordingFileType::from_extension in streaming.rs and provide content types for the other recording file types.

Validation:

  • cargo test -p devolutions-gateway --lib
  • cargo check -p devolutions-gateway
  • cargo clippy -p devolutions-gateway --tests -- -D warnings
  • Manual smoke test against local Gateway: pushed fileType=slog, verified recording-0.slog and raw NDJSON contents.

Out of scope:

  • .slog viewer/rendering.
  • DVLS UI/search MVP.
  • Gateway standalone webapp checkbox/package wiring.
  • Media sidecar/concurrent artifact support.

@github-actions

Copy link
Copy Markdown

Let maintainers know that an action is required on their side

  • Add the label release-required Please cut a new release (Devolutions Gateway, Devolutions Agent, Jetsocat, PowerShell module) when you request a maintainer to cut a new release (Devolutions Gateway, Devolutions Agent, Jetsocat, PowerShell module)

  • Add the label release-blocker Follow-up is required before cutting a new release if a follow-up is required before cutting a new release

  • Add the label publish-required Please publish libraries (`Devolutions.Gateway.Utils`, OpenAPI clients, etc) when you request a maintainer to publish libraries (Devolutions.Gateway.Utils, OpenAPI clients, etc.)

  • Add the label publish-blocker Follow-up is required before publishing libraries if a follow-up is required before publishing libraries

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Gateway support for storing and downloading Session Recording Log (.slog) artifacts.

Changes:

  • Adds the slog recording type, manifest metadata, and NDJSON responses.
  • Adds standalone webapp token signing and feature configuration.
  • Preserves compatibility with legacy recording manifests.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
config_schema.json Defines the session-recording toggle.
devolutions-gateway/src/api/health.rs Exposes the toggle in health metadata.
devolutions-gateway/src/api/jrec.rs Serves .slog files as NDJSON.
devolutions-gateway/src/api/webapp.rs Signs JREC push tokens.
devolutions-gateway/src/config.rs Loads the webapp recording toggle.
devolutions-gateway/src/recording.rs Persists artifact types and migrates manifests.
devolutions-gateway/src/token.rs Defines the SLOG recording type.
devolutions-gateway/tests/config.rs Updates configuration fixtures.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread devolutions-gateway/src/api/webapp.rs Outdated
Comment thread devolutions-gateway/src/api/webapp.rs Outdated
@kristahouse
Krista House (kristahouse) force-pushed the kristahouse-activity-log-recordings branch from 874ab60 to 93a99fe Compare July 15, 2026 18:43
@kristahouse

Copy link
Copy Markdown
Contributor Author

Scope update:

  • Removed the standalone webapp JREC token/config/health pieces from this PR.
  • This PR now contains only the Gateway recording storage contract for fileType=slog / .slog.
  • Host systems such as DVLS remain responsible for minting JREC push tokens.
  • Gateway standalone webapp sandbox token/UI wiring will be handled in a separate follow-up PR.

Current changed files:

  • devolutions-gateway/src/api/jrec.rs
  • devolutions-gateway/src/recording.rs
  • devolutions-gateway/src/token.rs

Validation after reducing scope:

  • cargo test -p devolutions-gateway --lib session_recording_log
  • cargo check -p devolutions-gateway
  • cargo clippy -p devolutions-gateway --tests -- -D warnings

@kristahouse

Copy link
Copy Markdown
Contributor Author

Post-reduction smoke test:

  • Built the current PR branch release Gateway executable.
  • Started an isolated local Gateway using a copied config on http://localhost:7173 / tcp://localhost:8183.
  • Generated a JREC push token externally with tools/tokengen.
  • Pushed UTF-8 NDJSON to /jet/jrec/push/{sessionId}?fileType=slog&token=<redacted>.
  • Verified Gateway wrote recording-0.slog.
  • Verified recording.json contains fileName: "recording-0.slog" and fileType: "slog".
  • Verified raw NDJSON contents were preserved.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread devolutions-gateway/src/recording.rs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@kristahouse
Krista House (kristahouse) marked this pull request as ready for review July 15, 2026 20:31
Comment thread devolutions-gateway/src/api/jrec.rs
Comment thread devolutions-gateway/src/api/jrec.rs Outdated

@CBenoit Benoît Cortier (CBenoit) left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

I’m sorry, I pushed some fixup commits via the GitHub UI hoping to merge immediately, but I think there is a bigger change to make before merging. Can you look at my comments and tell me how that sounds to you? 🙏

Comment thread devolutions-gateway/src/token.rs
Comment thread devolutions-gateway/src/token.rs Outdated
Comment thread devolutions-gateway/src/recording.rs
Comment thread devolutions-gateway/src/token.rs
@kristahouse
Krista House (kristahouse) force-pushed the kristahouse-activity-log-recordings branch from ffc7d40 to 3426004 Compare July 16, 2026 13:07
Adds RecordingFileType::SessionRecordingLog (wire value slog, extension
.slog) and serves .slog recording files with the application/x-ndjson
content type on pull.

Co-authored-by: Benoît Cortier <3809077+CBenoit@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

@CBenoit Benoît Cortier (CBenoit) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@CBenoit
Benoît Cortier (CBenoit) merged commit e84baaa into master Jul 16, 2026
42 checks passed
@CBenoit
Benoît Cortier (CBenoit) deleted the kristahouse-activity-log-recordings branch July 16, 2026 15:40
Benoît Cortier (CBenoit) pushed a commit that referenced this pull request Sep 15, 2026
Follow-up changes requested during review of #1857.

Centralize recording extension handling in streaming through
RecordingFileType so validation, stream routing, and terminal input
selection are derived from one mapping.

Define explicit MIME mappings for WebM, TRP, Asciicast, and SLOG
artifacts, and declare PullRecordingFile response media types in source
annotations so generated OpenAPI output remains aligned and stable.

Issue: DGW-406

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Changelog: ignore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants