Skip to content

Commit

Permalink
Adding rule type for OSPS-QA-01 (#248)
Browse files Browse the repository at this point in the history
  • Loading branch information
mesembria authored Dec 19, 2024
1 parent c09f5f3 commit 4484e16
Show file tree
Hide file tree
Showing 5 changed files with 835 additions and 0 deletions.
47 changes: 47 additions & 0 deletions rule-types/github/repo_visibility.test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
tests:
- name: "Should be public"
def:
visibility: "public"
params: {}
expect: "pass"
entity: &test-repo
type: repository
entity:
owner: "coolhead"
name: "haze-wave"
http:
body_file: public.json
- name: "Should be private"
def:
visibility: "private"
params: {}
expect: "pass"
entity: *test-repo
http:
body_file: private.json
- name: "Should be public"
def:
visibility: "public"
params: {}
expect: "fail"
entity: *test-repo
http:
body_file: private.json
- name: "Not found should fail"
def:
visibility: "public"
params: {}
expect: "fail"
entity: *test-repo
http:
status: 404
body_file: notfound.json
- name: "Internal server error should fail"
def: {}
params: {}
expect: "fail"
entity: *test-repo
http:
status: 500
body: |
{ "message": "Internal server error" }
5 changes: 5 additions & 0 deletions rule-types/github/repo_visibility.testdata/notfound.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"message": "Not Found",
"documentation_url": "https://docs.github.com/rest/repos/repos#get-a-repository",
"status": "404"
}
Loading

0 comments on commit 4484e16

Please sign in to comment.