Skip to content

Commit

Permalink
Merge pull request #751 from snyk/feat/IA-330-apprisk-catalog-info
Browse files Browse the repository at this point in the history
feat: add catalog-info.yaml paths for azure, github, gitlab
  • Loading branch information
aarlaud authored May 2, 2024
2 parents 7bdb1e6 + f325090 commit 837f6f5
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 0 deletions.
18 changes: 18 additions & 0 deletions defaultFilters/apprisk/azure-repos.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,24 @@
"token": "${BROKER_CLIENT_VALIDATION_BASIC_AUTH}"
}
},
{
"//": "used to retrieve organization context from catalog-info.yaml",
"method": "GET",
"path": "/:org/:project/_apis/git/repositories/:repo/files",
"origin": "https://${AZURE_REPOS_HOST}",
"auth": {
"scheme": "basic",
"token": "${BROKER_CLIENT_VALIDATION_BASIC_AUTH}"
},
"valid": [
{
"queryParam": "path",
"values": [
"catalog-info.yaml"
]
}
]
},
{
"//": "get list of team's members",
"method": "GET",
Expand Down
6 changes: 6 additions & 0 deletions defaultFilters/apprisk/github.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@
"path": "/repos/:owner/:repo/contributors",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_API}"
},
{
"//": "used to retrieve organization context from catalog-info.yaml",
"method": "GET",
"path": "/repos/:name/:repo/contents/catalog-info.yaml",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_API}"
},
{
"//": "used to get repo's languages",
"method": "GET",
Expand Down
6 changes: 6 additions & 0 deletions defaultFilters/apprisk/gitlab.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
"path": "/api/v4/projects/:project/groups",
"origin": "https://${GITLAB}"
},
{
"//": "used to retrieve organization context from catalog-info.yaml",
"method": "GET",
"path": "/api/v4/projects/:project/repository/files/catalog-info.yaml/raw",
"origin": "https://${GITLAB}"
},
{
"//": "get metadata",
"method": "GET",
Expand Down
30 changes: 30 additions & 0 deletions test/unit/__snapshots__/runtime-rules-hotloading.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,24 @@ Object {
"origin": "https://\${AZURE_REPOS_HOST}",
"path": "/:org/:project/_apis/git/repositories/:repo/commits",
},
Object {
"//": "used to retrieve organization context from catalog-info.yaml",
"auth": Object {
"scheme": "basic",
"token": "\${BROKER_CLIENT_VALIDATION_BASIC_AUTH}",
},
"method": "GET",
"origin": "https://\${AZURE_REPOS_HOST}",
"path": "/:org/:project/_apis/git/repositories/:repo/files",
"valid": Array [
Object {
"queryParam": "path",
"values": Array [
"catalog-info.yaml",
],
},
],
},
Object {
"//": "get list of team's members",
"auth": Object {
Expand Down Expand Up @@ -3699,6 +3717,12 @@ Object {
"origin": "https://\${GITHUB_TOKEN}@\${GITHUB_API}",
"path": "/repos/:owner/:repo/contributors",
},
Object {
"//": "used to retrieve organization context from catalog-info.yaml",
"method": "GET",
"origin": "https://\${GITHUB_TOKEN}@\${GITHUB_API}",
"path": "/repos/:name/:repo/contents/catalog-info.yaml",
},
Object {
"//": "used to get repo's languages",
"method": "GET",
Expand Down Expand Up @@ -7072,6 +7096,12 @@ Object {
"origin": "https://\${GITLAB}",
"path": "/api/v4/projects/:project/groups",
},
Object {
"//": "used to retrieve organization context from catalog-info.yaml",
"method": "GET",
"origin": "https://\${GITLAB}",
"path": "/api/v4/projects/:project/repository/files/catalog-info.yaml/raw",
},
Object {
"//": "get metadata",
"method": "GET",
Expand Down

0 comments on commit 837f6f5

Please sign in to comment.