Last active
March 9, 2022 14:58
-
-
Save snyk-omar/663c37d26808edb5a4361d5ddfb8f1f1 to your computer and use it in GitHub Desktop.
Azure Repos + Code Agent Accept.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"public": [ | |
{ | |
"//": "used for pushing up webhooks from Azure", | |
"method": "POST", | |
"path": "/webhook/azure-repos/:webhookId" | |
} | |
], | |
"private": [ | |
{ | |
"//": "get list of projects for given organisation", | |
"method": "GET", | |
"path": "/_apis/projects", | |
"origin": "https://${AZURE_REPOS_HOST}/${AZURE_REPOS_ORG}", | |
"auth": { | |
"scheme": "basic", | |
"token": "${BROKER_CLIENT_VALIDATION_BASIC_AUTH}" | |
} | |
}, | |
{ | |
"//": "get specific repository for given organisation", | |
"method": "GET", | |
"path": "/:owner/_apis/git/repositories/:repo", | |
"origin": "https://${AZURE_REPOS_HOST}/${AZURE_REPOS_ORG}", | |
"auth": { | |
"scheme": "basic", | |
"token": "${BROKER_CLIENT_VALIDATION_BASIC_AUTH}" | |
} | |
}, | |
{ | |
"//": "get list of repositories for given organisation", | |
"method": "GET", | |
"path": "/:owner/_apis/git/repositories", | |
"origin": "https://${AZURE_REPOS_HOST}/${AZURE_REPOS_ORG}", | |
"auth": { | |
"scheme": "basic", | |
"token": "${BROKER_CLIENT_VALIDATION_BASIC_AUTH}" | |
} | |
}, | |
{ | |
"//": "get list of refs", | |
"method": "GET", | |
"path": "/:owner/_apis/git/repositories/:repo/refs", | |
"origin": "https://${AZURE_REPOS_HOST}/${AZURE_REPOS_ORG}", | |
"auth": { | |
"scheme": "basic", | |
"token": "${BROKER_CLIENT_VALIDATION_BASIC_AUTH}" | |
} | |
}, | |
{ | |
"//": "search through repositories of given organisation", | |
"method": "GET", | |
"path": "_apis/git/repositories", | |
"origin": "https://${AZURE_REPOS_HOST}/${AZURE_REPOS_ORG}", | |
"auth": { | |
"scheme": "basic", | |
"token": "${BROKER_CLIENT_VALIDATION_BASIC_AUTH}" | |
} | |
}, | |
{ | |
"//": "create hook", | |
"method": "POST", | |
"path": "/_apis/hooks/subscriptions", | |
"origin": "https://${AZURE_REPOS_HOST}/${AZURE_REPOS_ORG}", | |
"auth": { | |
"scheme": "basic", | |
"token": "${BROKER_CLIENT_VALIDATION_BASIC_AUTH}" | |
} | |
}, | |
{ | |
"//": "delete hook", | |
"method": "DELETE", | |
"path": "/_apis/hooks/subscriptions/:subscriptionId", | |
"origin": "https://${AZURE_REPOS_HOST}/${AZURE_REPOS_ORG}", | |
"auth": { | |
"scheme": "basic", | |
"token": "${BROKER_CLIENT_VALIDATION_BASIC_AUTH}" | |
} | |
}, | |
{ | |
"//": "get file content. restrict by file types", | |
"method": "GET", | |
"path": "/:owner/_apis/git/repositories/:repo/items", | |
"origin": "https://${AZURE_REPOS_HOST}/${AZURE_REPOS_ORG}", | |
"valid": [ | |
{ | |
"queryParam": "path", | |
"values": [ | |
"**/package.json", | |
"**%2Fpackage.json", | |
"**/yarn.lock", | |
"**%2Fyarn.lock", | |
"**/package-lock.json", | |
"**%2Fpackage-lock.json", | |
"**/Gemfile", | |
"**%2FGemfile", | |
"**/Gemfile.lock", | |
"**%2FGemfile.lock", | |
"**/pom.xml", | |
"**%2Fpom.xml", | |
"**/*req*.txt", | |
"**%2F*req*.txt", | |
"**/requirements/*.txt", | |
"**%2Frequirements%2F*.txt", | |
"**/build.gradle", | |
"**%2Fbuild.gradle", | |
"**/gradle.lockfile", | |
"**%2Fgradle.lockfile", | |
"**/build.sbt", | |
"**%2Fbuild.sbt", | |
"**/.snyk", | |
"**%2F.snyk", | |
"**/packages.config", | |
"**%2Fpackages.config", | |
"**/*.csproj", | |
"**%2F*.csproj", | |
"**/*.vbproj", | |
"**%2F*.vbproj", | |
"**/*.fsproj", | |
"**%2F*.fsproj", | |
"**/project.json", | |
"**%2Fproject.json", | |
"**/Gopkg.toml", | |
"**%2FGopkg.toml", | |
"**/Gopkg.lock", | |
"**%2FGopkg.lock", | |
"**/vendor.json", | |
"**%2Fvendor.json", | |
"**/composer.lock", | |
"**%2Fcomposer.lock", | |
"**/composer.json", | |
"**%2Fcomposer.json", | |
"**/project.assets.json", | |
"**%2Fproject.assets.json", | |
"**/Podfile", | |
"**%2FPodfile", | |
"**/Podfile.lock", | |
"**%2FPodfile.lock", | |
"**/go.mod", | |
"**%2Fgo.mod", | |
"**/go.sum", | |
"**%2Fgo.sum", | |
"**/*Dockerfile*", | |
"**%2F*Dockerfile*" | |
] | |
}, | |
{ | |
"queryParam": "recursionLevel", | |
"values": [ | |
"none" | |
] | |
}, | |
{ | |
"queryParam": "download", | |
"values": [ | |
"true" | |
] | |
}, | |
{ | |
"queryParam": "includeContent", | |
"values": [ | |
"true" | |
] | |
} | |
], | |
"auth": { | |
"scheme": "basic", | |
"token": "${BROKER_CLIENT_VALIDATION_BASIC_AUTH}" | |
} | |
}, | |
{ | |
"//": "check file existence. restrict by file types", | |
"method": "GET", | |
"path": "/:owner/_apis/git/repositories/:repo/items", | |
"origin": "https://${AZURE_REPOS_HOST}/${AZURE_REPOS_ORG}", | |
"valid": [ | |
{ | |
"queryParam": "path", | |
"values": [ | |
"**/package.json", | |
"**%2Fpackage.json", | |
"**/yarn.lock", | |
"**%2Fyarn.lock", | |
"**/package-lock.json", | |
"**%2Fpackage-lock.json", | |
"**/Gemfile", | |
"**%2FGemfile", | |
"**/Gemfile.lock", | |
"**%2FGemfile.lock", | |
"**/pom.xml", | |
"**%2Fpom.xml", | |
"**/*req*.txt", | |
"**%2F*req*.txt", | |
"**/requirements/*.txt", | |
"**%2Frequirements%2F*.txt", | |
"**/build.gradle", | |
"**%2Fbuild.gradle", | |
"**/gradle.lockfile", | |
"**%2Fgradle.lockfile", | |
"**/build.sbt", | |
"**%2Fbuild.sbt", | |
"**/.snyk", | |
"**%2F.snyk", | |
"**/packages.config", | |
"**%2Fpackages.config", | |
"**/*.csproj", | |
"**%2F*.csproj", | |
"**/*.vbproj", | |
"**%2F*.vbproj", | |
"**/*.fsproj", | |
"**%2F*.fsproj", | |
"**/project.json", | |
"**%2Fproject.json", | |
"**/Gopkg.toml", | |
"**%2FGopkg.toml", | |
"**/Gopkg.lock", | |
"**%2FGopkg.lock", | |
"**/vendor.json", | |
"**%2Fvendor.json", | |
"**/composer.lock", | |
"**%2Fcomposer.lock", | |
"**/composer.json", | |
"**%2Fcomposer.json", | |
"**/project.assets.json", | |
"**%2Fproject.assets.json", | |
"**/Podfile", | |
"**%2FPodfile", | |
"**/Podfile.lock", | |
"**%2FPodfile.lock", | |
"**/go.mod", | |
"**%2Fgo.mod", | |
"**/go.sum", | |
"**%2Fgo.sum", | |
"**/*Dockerfile*", | |
"**%2F*Dockerfile*" | |
] | |
}, | |
{ | |
"queryParam": "versionDescriptor.versionType", | |
"values": [ | |
"branch" | |
] | |
}, | |
{ | |
"queryParam": "includeContentMetadata", | |
"values": [ | |
"true" | |
] | |
} | |
], | |
"auth": { | |
"scheme": "basic", | |
"token": "${BROKER_CLIENT_VALIDATION_BASIC_AUTH}" | |
} | |
}, | |
{ | |
"//": "get list of files for given repository", | |
"method": "GET", | |
"path": "/:owner/_apis/git/repositories/:repo/items", | |
"origin": "https://${AZURE_REPOS_HOST}/${AZURE_REPOS_ORG}", | |
"valid": [ | |
{ | |
"queryParam": "recursionLevel", | |
"values": [ | |
"full" | |
] | |
}, | |
{ | |
"queryParam": "download", | |
"values": [ | |
"false" | |
] | |
}, | |
{ | |
"queryParam": "includeContent", | |
"values": [ | |
"false" | |
] | |
} | |
], | |
"auth": { | |
"scheme": "basic", | |
"token": "${BROKER_CLIENT_VALIDATION_BASIC_AUTH}" | |
} | |
}, | |
{ | |
"//": "get list of commits for given repository", | |
"method": "GET", | |
"path": "/:owner/_apis/git/repositories/:repo/commits", | |
"origin": "https://${AZURE_REPOS_HOST}/${AZURE_REPOS_ORG}", | |
"auth": { | |
"scheme": "basic", | |
"token": "${BROKER_CLIENT_VALIDATION_BASIC_AUTH}" | |
} | |
}, | |
{ | |
"//": "update status of given commit", | |
"method": "POST", | |
"path": "/:owner/_apis/git/repositories/:repo/commits/:commitId/statuses", | |
"origin": "https://${AZURE_REPOS_HOST}/${AZURE_REPOS_ORG}", | |
"auth": { | |
"scheme": "basic", | |
"token": "${BROKER_CLIENT_VALIDATION_BASIC_AUTH}" | |
} | |
}, | |
{ | |
"//": "update status of given pull request", | |
"method": "POST", | |
"path": "/:owner/_apis/git/repositories/:repo/pullRequests/:pullRef/statuses", | |
"origin": "https://${AZURE_REPOS_HOST}/${AZURE_REPOS_ORG}", | |
"auth": { | |
"scheme": "basic", | |
"token": "${BROKER_CLIENT_VALIDATION_BASIC_AUTH}" | |
} | |
}, | |
{ | |
"//": "find PR for given repository", | |
"method": "GET", | |
"path": "/:owner/_apis/git/repositories/:repo/pullrequests", | |
"origin": "https://${AZURE_REPOS_HOST}/${AZURE_REPOS_ORG}", | |
"auth": { | |
"scheme": "basic", | |
"token": "${BROKER_CLIENT_VALIDATION_BASIC_AUTH}" | |
} | |
}, | |
{ | |
"//": "create new PR in given repository", | |
"method": "POST", | |
"path": "/:owner/_apis/git/repositories/:repo/pullrequests", | |
"origin": "https://${AZURE_REPOS_HOST}/${AZURE_REPOS_ORG}", | |
"auth": { | |
"scheme": "basic", | |
"token": "${BROKER_CLIENT_VALIDATION_BASIC_AUTH}" | |
} | |
}, | |
{ | |
"//": "update existing PR in given repository", | |
"method": "PATCH", | |
"path": "/:owner/_apis/git/repositories/:repo/pullrequests/:pullRef", | |
"origin": "https://${AZURE_REPOS_HOST}/${AZURE_REPOS_ORG}", | |
"auth": { | |
"scheme": "basic", | |
"token": "${BROKER_CLIENT_VALIDATION_BASIC_AUTH}" | |
} | |
}, | |
{ | |
"//": "push new commit in given repository", | |
"method": "POST", | |
"path": "/:owner/_apis/git/repositories/:repo/pushes", | |
"origin": "https://${AZURE_REPOS_HOST}/${AZURE_REPOS_ORG}", | |
"auth": { | |
"scheme": "basic", | |
"token": "${BROKER_CLIENT_VALIDATION_BASIC_AUTH}" | |
} | |
}, | |
{ | |
"//": "used to redirect requests to snyk git client", | |
"method": "any", | |
"path": "/snykgit/*", | |
"origin": "${GIT_CLIENT_URL}" | |
}, | |
{ | |
"//": "needed for code snippets", | |
"method": "GET", | |
"path": "/:owner/_apis/git/repositories/:repo/items", | |
"origin": "https://${AZURE_REPOS_HOST}/${AZURE_REPOS_ORG}", | |
"auth": { | |
"scheme": "basic", | |
"token": "${BROKER_CLIENT_VALIDATION_BASIC_AUTH}" | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment