Skip to content

fix: apply asset policy to audio beds - #155

Merged
Brad-Edwards merged 1 commit into
devfrom
148-bed-url-policy
May 23, 2026
Merged

fix: apply asset policy to audio beds#155
Brad-Edwards merged 1 commit into
devfrom
148-bed-url-policy

Conversation

@Brad-Edwards

Copy link
Copy Markdown
Contributor

Summary

Applies the configured asset URL policy to composition audio-bed sources in validation and runtime playback, so hardened deployments can use the same base URL and scheme allowlist for scene assets and composition beds.

Requirement UIDs

  • (none — bug/refactor/maintenance run; see Traceability section below)

Related Issues

Closes #148

ADR Impact

  • ADR-004
  • ADR-012
  • ADR-021

Changes

  • Promote the asset URL policy shape into a shared AssetUrlPolicy contract used by validation, preloading, and audio checks.
  • Validate composition audioBed.src entries through resolveAssetUrl() with the configured baseUrl and allowedSchemes.
  • Thread the asset policy into createAudioService() and the scene loader so bed playback is rejected at runtime if validation was skipped.
  • Add string and array audioBed.src tests for validation and runtime policy enforcement, plus default permissive-policy coverage.

Test Plan

  • Unit tests pass (make test)

  • Integration tests pass if applicable (make integration)

  • make check passes (Spotless, SpotBugs, Error Prone, Checkstyle, JaCoCo)

  • No coverage regression

  • pnpm test -- tests/runtime/validation.test.ts tests/runtime/audio.test.ts tests/runtime/scene-loader-audio.test.ts

  • pnpm test -- tests/runtime/audio.test.ts tests/runtime/validation.test.ts tests/runtime/scene-loader-audio.test.ts

  • pnpm lint && pnpm typecheck && pnpm test

  • pre-commit run --all-files

Ground Control Checks

  • make policy passes
  • gc_evaluate_quality_gates passes or is unchanged by this repo-only change
  • gc_run_sweep reviewed; findings fixed or recorded with rationale

Traceability

Checklist

  • Code follows project coding standards (docs/CODING_STANDARDS.md)
  • No business logic in API layer
  • Domain layer has no framework imports
  • Envers @Audited on new entities if applicable
  • Changelog fragment added at changelog.d/148.fixed.md
  • Architectural docs updated if stack, package structure, or key behaviors changed

@sonarqubecloud

Copy link
Copy Markdown

@Brad-Edwards
Brad-Edwards merged commit 0674457 into dev May 23, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant