Skip to content

Commit 15cfc10

Browse files
committed
CONSOLE-4265: Add new API field to ConsolePlugin CRD for allowing additional CSP sources
1 parent 3c700b6 commit 15cfc10

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

console/v1/types_console_plugin.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,26 @@ type ConsolePluginSpec struct {
4848
// i18n is the configuration of plugin's localization resources.
4949
// +optional
5050
I18n ConsolePluginI18n `json:"i18n"`
51+
// csp is a list of Content Security Policy directives for the plugin.
52+
CSP []ConsolePluginCSP `json:"csp"`
53+
}
54+
55+
// DirectiveType is an enumeration of supported CSP directives
56+
type DirectiveType string
57+
58+
const (
59+
DefaultSrc DirectiveType = "default-src"
60+
ScriptSrc DirectiveType = "script-src"
61+
ImgSrc DirectiveType = "img-src"
62+
StyleSrc DirectiveType = "style-src"
63+
FontSrc DirectiveType = "font-src"
64+
BaseUri DirectiveType = "base-uri"
65+
)
66+
67+
// ConsolePluginCSP
68+
type ConsolePluginCSP struct {
69+
Directive DirectiveType `json:"directive"`
70+
Sources []string `json:"source"`
5171
}
5272

5373
// LoadType is an enumeration of i18n loading types

0 commit comments

Comments
 (0)