Add missing security specs for raw snippet access
What does this MR do?
It extends the project snippets access security specs to cover raw snippet paths as well.
When I was researching snippets for !7256 (merged), I noticed that specs existed for the HTML show view of project snippets but not the raw view. Seeing as this is a spec that is checking for access regressions on places where sensitive information might be kept, I thought it would be a good idea to cover the raw snippets access too.
To balance out the karma of adding in extra tests I also changed the tests to all use an empty_project
spec.
Are there points in the code the reviewer needs to double check?
With the aim of making the specs easier to read, I restructured some of them to use context blocks for each type of snippet.
I've used the same access rights defined for the show snippet paths for the raw snippet access.
Why was this MR needed?
To catch security regressions on raw snippet access for projects.
Screenshots (if relevant)
Does this MR meet the acceptance criteria?
- [-] CHANGELOG entry added
- [-] Documentation created/updated
- [-] API support added
- Tests
-
Added for this feature/bug -
All builds are passing
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Branch has no merge conflicts with master
(if it does - rebase it please) -
Squashed related commits together
What are the relevant issue numbers?
Merge request reports
Activity
Added 114 commits:
-
242d6d22...50f3fd49 - 113 commits from branch
gitlab-org:master
- 80a2e3a9 - Add missing security specs for raw snippet access
-
242d6d22...50f3fd49 - 113 commits from branch
To balance out the karma of adding in extra tests I also changed the tests to all use an
empty_project
spec. Thanks, @the-undefined! I'll take a look next week.Added ~164274 backstage labels
Reassigned to @smcgivern
Mentioned in commit 7ce03197
changed milestone to %8.14