Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ui/admin/app/components/form/field/json-secret/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
@isLintingEnabled={{true}}
@language='json'
@onInput={{@onInput}}
@cspNonce={{(csp-nonce)}}
data-test-code-editor
/>
{{/if}}
Expand Down
1 change: 1 addition & 0 deletions ui/admin/app/components/form/role/edit-grants/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
@value={{this.grantStringsText}}
@onInput={{this.onInput}}
@customExtensions={{this.customExtensions}}
@cspNonce={{(csp-nonce)}}
data-test-code-editor
as |CE|
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
@language='shell'
@value={{or (get @model @name) ''}}
@onInput={{fn this.setWorkerFilter @model @name}}
@cspNonce={{(csp-nonce)}}
data-test-code-editor
/>
</F.Control>
Expand Down
20 changes: 20 additions & 0 deletions ui/admin/app/helpers/csp-nonce.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* Copyright IBM Corp. 2021, 2026
* SPDX-License-Identifier: BUSL-1.1
*/

import Helper from '@ember/component/helper';

/**
* Returns the CSP style-src nonce from the document's head metadata.
*/
export default class CspNonceHelper extends Helper {
compute() {
return (
document
?.querySelector('meta[name="csp-nonce"]')
?.getAttribute('content')
?.trim() ?? ''
);
}
}
1 change: 1 addition & 0 deletions ui/admin/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<!DOCTYPE html>
<html>
<head>
<meta name="csp-nonce" content="__BOUNDARY_CSP_NONCE__">
Comment thread
bgajjala8 marked this conversation as resolved.
<meta charset="utf-8">
<title>Admin</title>
<meta name="description" content="Simple and secure remote access with HashiCorp Boundary.">
Expand Down
Loading