diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-05-21 15:02:30 +0300 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-05-21 17:49:00 +0300 |
commit | 5f24a2c047db0bff8c9e267bfa8ef8e43e6bd24e (patch) | |
tree | 9ab706fd48e87bcf0a03802790ecf92e644f26d3 /config | |
parent | 710142016b140538bfc11e48bb32d26fa685b2ad (diff) |
Add PrivacyEnhanced mode for YouTube to the GDPR Policy
See #4616
Diffstat (limited to 'config')
-rw-r--r-- | config/privacy/privacyConfig.go | 8 | ||||
-rw-r--r-- | config/privacy/privacyConfig_test.go | 10 |
2 files changed, 11 insertions, 7 deletions
diff --git a/config/privacy/privacyConfig.go b/config/privacy/privacyConfig.go index 0241b5704..64bbe71bb 100644 --- a/config/privacy/privacyConfig.go +++ b/config/privacy/privacyConfig.go @@ -72,8 +72,12 @@ type Vimeo struct { // YouTube holds the privacy configuration settingsrelated to the YouTube shortcode. type YouTube struct { - Service `mapstructure:",squash"` - NoCookie bool + Service `mapstructure:",squash"` + + // When you turn on privacy-enhanced mode, + // YouTube won’t store information about visitors on your website + // unless they play the video. + PrivacyEnhanced bool } func DecodeConfig(cfg config.Provider) (pc Config, err error) { diff --git a/config/privacy/privacyConfig_test.go b/config/privacy/privacyConfig_test.go index f8e2ebbd1..bca53f167 100644 --- a/config/privacy/privacyConfig_test.go +++ b/config/privacy/privacyConfig_test.go @@ -44,7 +44,7 @@ disable = true disable = true [privacy.youtube] disable = true -noCookie = true +privacyEnhanced = true ` cfg, err := config.FromConfigString(tomlConfig, "toml") assert.NoError(err) @@ -61,7 +61,7 @@ noCookie = true assert.True(pc.Tweet.Disable) assert.True(pc.Vimeo.Disable) - assert.True(pc.YouTube.NoCookie) + assert.True(pc.YouTube.PrivacyEnhanced) assert.True(pc.YouTube.Disable) } @@ -74,7 +74,7 @@ someOtherValue = "foo" [Privacy] [Privacy.YouTube] -NoCOOKIE = true +PrivacyENhanced = true ` cfg, err := config.FromConfigString(tomlConfig, "toml") assert.NoError(err) @@ -82,7 +82,7 @@ NoCOOKIE = true pc, err := DecodeConfig(cfg) assert.NoError(err) assert.NotNil(pc) - assert.True(pc.YouTube.NoCookie) + assert.True(pc.YouTube.PrivacyEnhanced) } func TestDecodeConfigDefault(t *testing.T) { @@ -91,5 +91,5 @@ func TestDecodeConfigDefault(t *testing.T) { pc, err := DecodeConfig(viper.New()) assert.NoError(err) assert.NotNil(pc) - assert.False(pc.YouTube.NoCookie) + assert.False(pc.YouTube.PrivacyEnhanced) } |