browser

package
v0.0.0-...-8ff70ea Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvBrowserCSPPolicy             = "MINIO_BROWSER_CONTENT_SECURITY_POLICY"
	EnvBrowserHSTSSeconds           = "MINIO_BROWSER_HSTS_SECONDS"
	EnvBrowserHSTSIncludeSubdomains = "MINIO_BROWSER_HSTS_INCLUDE_SUB_DOMAINS"
	EnvBrowserHSTSPreload           = "MINIO_BROWSER_HSTS_PRELOAD"
	EnvBrowserReferrerPolicy        = "MINIO_BROWSER_REFERRER_POLICY"
)

Browser sub-system constants

Variables

View Source
var (
	DefaultKVS = config.KVS{
		config.KV{
			Key:   browserCSPPolicy,
			Value: "default-src 'self' 'unsafe-eval' 'unsafe-inline';",
		},
		config.KV{
			Key:   browserHSTSSeconds,
			Value: "0",
		},
		config.KV{
			Key:   browserHSTSIncludeSubdomains,
			Value: config.EnableOff,
		},
		config.KV{
			Key:   browserHSTSPreload,
			Value: config.EnableOff,
		},
		config.KV{
			Key:   browserReferrerPolicy,
			Value: "strict-origin-when-cross-origin",
		},
	}
)

DefaultKVS - default storage class config

View Source
var (
	Help = config.HelpKVS{
		config.HelpKV{
			Key:         browserCSPPolicy,
			Description: `set Content-Security-Policy response header value` + defaultHelpPostfix(browserCSPPolicy),
			Optional:    true,
			Type:        "string",
		},
		config.HelpKV{
			Key:         browserHSTSSeconds,
			Description: `set Strict-Transport-Security 'max-age' amount of seconds value` + defaultHelpPostfix(browserHSTSSeconds),
			Optional:    true,
			Type:        "number",
		},
		config.HelpKV{
			Key:         browserHSTSIncludeSubdomains,
			Description: `turn 'on' to set Strict-Transport-Security 'includeSubDomains' directive` + defaultHelpPostfix(browserHSTSIncludeSubdomains),
			Optional:    true,
			Type:        "boolean",
		},
		config.HelpKV{
			Key:         browserHSTSPreload,
			Description: `turn 'on' to set Strict-Transport-Security 'preload' directive` + defaultHelpPostfix(browserHSTSPreload),
			Optional:    true,
			Type:        "boolean",
		},
		config.HelpKV{
			Key:         browserReferrerPolicy,
			Description: `set Referrer-Policy response header value` + defaultHelpPostfix(browserReferrerPolicy),
			Optional:    true,
			Type:        "string",
		},
	}
)

Help template for browser feature.

Functions

This section is empty.

Types

type Config

type Config struct {
	CSPPolicy             string `json:"csp_policy"`
	HSTSSeconds           int    `json:"hsts_seconds"`
	HSTSIncludeSubdomains bool   `json:"hsts_include_subdomains"`
	HSTSPreload           bool   `json:"hsts_preload"`
	ReferrerPolicy        string `json:"referrer_policy"`
}

Config storage class configuration

func LookupConfig

func LookupConfig(kvs config.KVS) (cfg Config, err error)

LookupConfig - lookup api config and override with valid environment settings if any.

func (*Config) GetCSPolicy

func (browseCfg *Config) GetCSPolicy() string

GetCSPolicy - Get the Content security Policy

func (*Config) GetHSTSSeconds

func (browseCfg *Config) GetHSTSSeconds() int

GetHSTSSeconds - Get the Content security Policy

func (*Config) GetReferPolicy

func (browseCfg *Config) GetReferPolicy() string

GetReferPolicy - Get the ReferPolicy

func (*Config) IsHSTSIncludeSubdomains

func (browseCfg *Config) IsHSTSIncludeSubdomains() string

IsHSTSIncludeSubdomains - is HSTS 'includeSubdomains' directive enabled

func (*Config) IsHSTSPreload

func (browseCfg *Config) IsHSTSPreload() string

IsHSTSPreload - is HSTS 'preload' directive enabled

func (*Config) Update

func (browseCfg *Config) Update(newCfg Config)

Update Updates browser with new config

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL