Repository navigation
CONSOLE-5550: Add ObjectSrc to ConsolePlugin CSP directives - #3128
shahsahil264 wants to merge 3 commits into
Conversation
Signed-off-by: Sahil Shah <sahshah@redhat.com>
Allow plugins to declare object-src sources while preserving existing CSP validation and limits. Regenerate the schemas and document aggregation behavior, with validation coverage for acceptance and invalid declarations. Signed-off-by: Sahil Shah <sahshah@redhat.com>
Integrate the earlier ObjectSrc branch without a force push. Keep the exact source and generated artifacts validated against current upstream. Signed-off-by: Sahil Shah <sahshah@redhat.com>
|
Pipeline controller notification This PR uses the pipeline controller for second-stage tests. Selection and triggering follow the repository configuration. Use |
|
@shahsahil264: This pull request references CONSOLE-5550 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.1.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
No actionable comments were generated in the recent review.
|
|
Hello @shahsahil264! Some important instructions when contributing to openshift/api: |
PR Summary by QodoAllow ObjectSrc in ConsolePlugin CSP directives
AI Description
Diagram
High-Level Assessment
Files changed (7)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewPowered by Qodo |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@shahsahil264: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
everettraven
left a comment
There was a problem hiding this comment.
Adding this option reads as net-new functionality and should undergo the standard feature development process, which includes feature-gating this new value.
|
Thanks for the review! Following the team discussion, we changed the decision to keep |
Analysis / Root cause:
ConsolePlugin CSP validation currently rejects
ObjectSrc, preventing plugins from declaring sources for<object>and<embed>elements.Solution description:
Add
ObjectSrctoDirectiveTypeand its validation enum, document its behavior, and regenerate CRD, Swagger, and OpenAPI artifacts. Preserve the existing validation rules and directive limits.MediaSrc,ChildSrc, andWorkerSrcare intentionally excluded from the plugin-facing API. The corresponding Console backend change hardcodesmedia-src 'none',child-src 'none', andworker-src 'self'. The worker exception preserves the existing same-originload-test.sw.jsservice worker. These policies remain non-configurable through ConsolePlugin; extensibility can be considered later if a specific plugin needs it and requests it.Screenshots / screen recording:
Not applicable: API/schema change.
Test setup:
Use the repository's local envtest API server; no cluster credentials are required. Full generation and verification ran in a disposable checkout at the import path required by the protobuf generator. The validated patch is byte-identical to the seven changed files in the working checkout.
Test cases:
make update: passed across all API groups; reproduced the existing patch exactly.make test-unit: passed (8 packages containing tests)make -C console/v1 test: 34 passed, 0 failedmake verify PULL_BASE_SHA=HEAD: passed, including both lint configurations (0 issues)Browser conformance:
Not applicable: API/schema change.
Additional info:
Jira: https://redhat.atlassian.net/browse/CONSOLE-5550
Coordinate rollout with the corresponding console-operator dependency update and Bridge support. Do not enable ObjectSrc declarations until the deployed Bridge recognizes them; remove declarations before rolling back to an older Bridge.
Reviewers and assignees:
Repository maintainers.