Skip to content

Commit

Permalink
Merge pull request #299 from snyk/feat/add-go-mod-manifest-to-github-…
Browse files Browse the repository at this point in the history
…example

feat: add go.mod and go.sum manifest to github
  • Loading branch information
admons authored Dec 29, 2020
2 parents 428c540 + 97ec8a0 commit f34c1fe
Show file tree
Hide file tree
Showing 5 changed files with 361 additions and 5 deletions.
6 changes: 5 additions & 1 deletion client-templates/azure-repos/accept.json.sample
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,11 @@
"**/Podfile",
"**%2FPodfile",
"**/Podfile.lock",
"**%2FPodfile.lock"
"**%2FPodfile.lock",
"**/go.mod",
"**%2Fgo.mod",
"**/go.sum",
"**%2Fgo.sum"
]
},
{
Expand Down
44 changes: 44 additions & 0 deletions client-templates/bitbucket-server/accept.json.sample
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,50 @@
"password": "${BITBUCKET_PASSWORD}"
}
},
{
"//": "used to determine the full dependency tree",
"method": "GET",
"path": "/projects/:project/repos/:repo/browse*/go.mod",
"origin": "https://${BITBUCKET_API}",
"auth": {
"scheme": "basic",
"username": "${BITBUCKET_USERNAME}",
"password": "${BITBUCKET_PASSWORD}"
}
},
{
"//": "used to determine the full dependency tree",
"method": "GET",
"path": "/projects/:project/repos/:repo/browse*%2Fgo.mod",
"origin": "https://${BITBUCKET_API}",
"auth": {
"scheme": "basic",
"username": "${BITBUCKET_USERNAME}",
"password": "${BITBUCKET_PASSWORD}"
}
},
{
"//": "used to determine the full dependency tree",
"method": "GET",
"path": "/projects/:project/repos/:repo/browse*/go.sum",
"origin": "https://${BITBUCKET_API}",
"auth": {
"scheme": "basic",
"username": "${BITBUCKET_USERNAME}",
"password": "${BITBUCKET_PASSWORD}"
}
},
{
"//": "used to determine the full dependency tree",
"method": "GET",
"path": "/projects/:project/repos/:repo/browse*%2Fgo.sum",
"origin": "https://${BITBUCKET_API}",
"auth": {
"scheme": "basic",
"username": "${BITBUCKET_USERNAME}",
"password": "${BITBUCKET_PASSWORD}"
}
},
{
"//": "used to scan Dockerfile",
"method": "GET",
Expand Down
112 changes: 112 additions & 0 deletions client-templates/github-com/accept.json.sample
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,22 @@
{
"path": "commits.*.modified.*",
"value": "Podfile.lock"
},
{
"path": "commits.*.added.*",
"value": "go.mod"
},
{
"path": "commits.*.modified.*",
"value": "go.mod"
},
{
"path": "commits.*.added.*",
"value": "go.sum"
},
{
"path": "commits.*.modified.*",
"value": "go.sum"
}
]
},
Expand Down Expand Up @@ -999,6 +1015,54 @@
"path": "/:name/:repo/:path*%2FPodfile.lock",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_RAW}"
},
{
"//": "used to determine the full dependency tree",
"method": "GET",
"path": "/repos/:name/:repo/contents/:path*/go.mod",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_API}"
},
{
"//": "used to determine the full dependency tree",
"method": "GET",
"path": "/repos/:name/:repo/contents/:path*%2Fgo.mod",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_API}"
},
{
"//": "used to determine the full dependency tree",
"method": "GET",
"path": "/:name/:repo/:path*/go.mod",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_RAW}"
},
{
"//": "used to determine the full dependency tree",
"method": "GET",
"path": "/:name/:repo/:path*%2Fgo.mod",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_RAW}"
},
{
"//": "used to determine the full dependency tree",
"method": "GET",
"path": "/repos/:name/:repo/contents/:path*/go.sum",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_API}"
},
{
"//": "used to determine the full dependency tree",
"method": "GET",
"path": "/repos/:name/:repo/contents/:path*%2Fgo.sum",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_API}"
},
{
"//": "used to determine the full dependency tree",
"method": "GET",
"path": "/:name/:repo/:path*/go.sum",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_RAW}"
},
{
"//": "used to determine the full dependency tree",
"method": "GET",
"path": "/:name/:repo/:path*%2Fgo.sum",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_RAW}"
},
{
"//": "used to scan Dockerfile",
"method": "GET",
Expand Down Expand Up @@ -1672,6 +1736,54 @@
"path": "/:name/:repo/:path*%2FPodfile.lock",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_RAW}"
},
{
"//": "used to update manifest or lock",
"method": "PUT",
"path": "/repos/:name/:repo/contents/:path*/go.mod",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_API}"
},
{
"//": "used to update manifest or lock",
"method": "PUT",
"path": "/repos/:name/:repo/contents/:path*%2Fgo.mod",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_API}"
},
{
"//": "used to update manifest or lock",
"method": "PUT",
"path": "/:name/:repo/:path*/go.mod",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_RAW}"
},
{
"//": "used to update manifest or lock",
"method": "PUT",
"path": "/:name/:repo/:path*%2Fgo.mod",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_RAW}"
},
{
"//": "used to update manifest or lock",
"method": "PUT",
"path": "/repos/:name/:repo/contents/:path*/go.sum",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_API}"
},
{
"//": "used to update manifest or lock",
"method": "PUT",
"path": "/repos/:name/:repo/contents/:path*%2Fgo.sum",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_API}"
},
{
"//": "used to update manifest or lock",
"method": "PUT",
"path": "/:name/:repo/:path*/go.sum",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_RAW}"
},
{
"//": "used to update manifest or lock",
"method": "PUT",
"path": "/:name/:repo/:path*%2Fgo.sum",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_RAW}"
},
{
"//": "used to write or update ignore rules or existing patches",
"method": "PUT",
Expand Down
112 changes: 112 additions & 0 deletions client-templates/github-enterprise/accept.json.sample
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,22 @@
{
"path": "commits.*.modified.*",
"value": "Podfile.lock"
},
{
"path": "commits.*.added.*",
"value": "go.mod"
},
{
"path": "commits.*.modified.*",
"value": "go.mod"
},
{
"path": "commits.*.added.*",
"value": "go.sum"
},
{
"path": "commits.*.modified.*",
"value": "go.sum"
}
]
},
Expand Down Expand Up @@ -675,6 +691,54 @@
"path": "/repos/:name/:repo/contents/:path*%2FPodfile.lock",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_API}"
},
{
"//": "used to determine the full dependency tree",
"method": "GET",
"path": "/repos/:name/:repo/contents/:path*/go.mod",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_API}"
},
{
"//": "used to determine the full dependency tree",
"method": "GET",
"path": "/repos/:name/:repo/contents/:path*%2Fgo.mod",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_API}"
},
{
"//": "used to determine the full dependency tree",
"method": "GET",
"path": "/:name/:repo/:path*/go.mod",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_RAW}"
},
{
"//": "used to determine the full dependency tree",
"method": "GET",
"path": "/:name/:repo/:path*%2Fgo.mod",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_RAW}"
},
{
"//": "used to determine the full dependency tree",
"method": "GET",
"path": "/repos/:name/:repo/contents/:path*/go.sum",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_API}"
},
{
"//": "used to determine the full dependency tree",
"method": "GET",
"path": "/repos/:name/:repo/contents/:path*%2Fgo.sum",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_API}"
},
{
"//": "used to determine the full dependency tree",
"method": "GET",
"path": "/:name/:repo/:path*/go.sum",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_RAW}"
},
{
"//": "used to determine the full dependency tree",
"method": "GET",
"path": "/:name/:repo/:path*%2Fgo.sum",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_RAW}"
},
{
"//": "used to update manifest or lock",
"method": "PUT",
Expand Down Expand Up @@ -987,6 +1051,54 @@
"path": "/repos/:name/:repo/contents/:path*%2FPodfile.lock",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_API}"
},
{
"//": "used to update manifest or lock",
"method": "PUT",
"path": "/repos/:name/:repo/contents/:path*/go.mod",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_API}"
},
{
"//": "used to update manifest or lock",
"method": "PUT",
"path": "/repos/:name/:repo/contents/:path*%2Fgo.mod",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_API}"
},
{
"//": "used to update manifest or lock",
"method": "PUT",
"path": "/:name/:repo/:path*/go.mod",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_RAW}"
},
{
"//": "used to update manifest or lock",
"method": "PUT",
"path": "/:name/:repo/:path*%2Fgo.mod",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_RAW}"
},
{
"//": "used to update manifest or lock",
"method": "PUT",
"path": "/repos/:name/:repo/contents/:path*/go.sum",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_API}"
},
{
"//": "used to update manifest or lock",
"method": "PUT",
"path": "/repos/:name/:repo/contents/:path*%2Fgo.sum",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_API}"
},
{
"//": "used to update manifest or lock",
"method": "PUT",
"path": "/:name/:repo/:path*/go.sum",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_RAW}"
},
{
"//": "used to update manifest or lock",
"method": "PUT",
"path": "/:name/:repo/:path*%2Fgo.sum",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_RAW}"
},
{
"//": "used to write or update ignore rules or existing patches",
"method": "PUT",
Expand Down
Loading

0 comments on commit f34c1fe

Please sign in to comment.