Skip to content
Closed
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
24 changes: 24 additions & 0 deletions lib/spec/lib/sitestandards_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,28 @@
expect("/downloads.html").not_to match(valid)
end
end

describe 'check for links to a privacy policy' do
valid = SiteStandards::COMMON_CHECKS['privacy'][SiteStandards::CHECK_VALIDATE]
it "should recognize the canonical privacy policy URL" do
expect("https://privacy.apache.org/policies/privacy-policy-public.html").to match(valid)
end
it "should recognize the legacy foundation privacy URL" do
expect("https://www.apache.org/foundation/policies/privacy.html").to match(valid)
expect("https://apache.org/foundation/policies/privacy.html").to match(valid)
end
it "should recognize project-level privacy pages on *.apache.org" do
expect("https://beam.apache.org/privacy_policy").to match(valid)
expect("https://karaf.apache.org/privacy.html").to match(valid)
expect("https://pig.apache.org/privacypolicy.html").to match(valid)
expect("https://systemds.apache.org/privacy-policy").to match(valid)
expect("https://hudi.apache.org/asf/privacy").to match(valid)
expect("https://cwiki.apache.org/confluence/display/KNOX/Privacy+Policy").to match(valid)
end
it "should reject non-ASF privacy pages" do
expect("https://policies.google.com/privacy").not_to match(valid)
expect("https://github.com/apache/privacy-website").not_to match(valid)
expect("https://example.com/privacy-policy.html").not_to match(valid)
end
end
end
2 changes: 2 additions & 0 deletions lib/whimsy/sitestandards.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ module SiteStandards
CHECK_VALIDATE => %r{\Ahttps://privacy\.apache\.org/policies/privacy-policy-public\.html\z
|
\Ahttps?://(?:www\.)?apache\.org/foundation/policies/privacy\.html\z
|
\Ahttps?://[a-z0-9.-]*\.?apache\.org/.*privac[yie]
}ix,
CHECK_TYPE => 'href',
CHECK_POLICY => 'https://www.apache.org/foundation/marks/pmcs.html#navigation',
Expand Down