Add DomPurify sanitizer custom elements configuration (#26989)

* Add DomPurify sanitizer custom elements configuration
---------

Signed-off-by: Harsha Teja Kanna <h7kanna@gmail.com>
This commit is contained in:
Harsha Teja Kanna
2024-10-17 13:21:56 -04:00
committed by GitHub
parent 9a6d61c9c9
commit 4f0cb89c42
5 changed files with 157 additions and 0 deletions
+16
View File
@@ -42,6 +42,22 @@ export interface Config {
* @visibility frontend
*/
allowedIframeHosts?: string[];
/**
* Allows listed custom element tag name regex
* Example:
* allowedCustomElementTagNameRegExp: '^backstage-'
* this will allow all custom elements with tag name matching `^backstage-` like <backstage-custom-element /> etc.
* @visibility frontend
*/
allowedCustomElementTagNameRegExp: string;
/**
* Allows listed custom element attribute name regex
* Example:
* allowedCustomElementAttributeNameRegExp: 'attribute1|attribute2'
* this will allow all custom element attributes matching `attribute1` or `attribute2` like <backstage-custom-element attribute1="yes" attribute2/>
* @visibility frontend
*/
allowedCustomElementAttributeNameRegExp: string;
};
};
}