Skip to content

Commit

Permalink
Merge pull request #851 from snyk/scm-504-bitbucker-sever-cred-valida…
Browse files Browse the repository at this point in the history
…tion

chore: add bitbucket server permission search for cred validation [SCM-504]
  • Loading branch information
aarlaud authored Sep 27, 2024
2 parents 58ea8b4 + c899f9c commit 3ea95a2
Show file tree
Hide file tree
Showing 8 changed files with 280 additions and 79 deletions.
10 changes: 10 additions & 0 deletions client-templates/bitbucket-server-bearer-auth/accept.json.sample
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,16 @@
"scheme": "bearer",
"token": "${BITBUCKET_PAT}"
}
},
{
"//": "used to validate credentials",
"method": "GET",
"path": "/rest/api/1.0/projects/:project/repos/:repo/permissions/search",
"origin": "https://${BITBUCKET}",
"auth": {
"scheme": "bearer",
"token": "${BITBUCKET_PAT}"
}
}
]
}
11 changes: 11 additions & 0 deletions client-templates/bitbucket-server/accept.json.sample
Original file line number Diff line number Diff line change
Expand Up @@ -1156,6 +1156,17 @@
"username": "${BITBUCKET_USERNAME}",
"password": "${BITBUCKET_PASSWORD}"
}
},
{
"//": "used to validate credentials",
"method": "GET",
"path": "/rest/api/1.0/projects/:project/repos/:repo/permissions/search",
"origin": "https://${BITBUCKET}",
"auth": {
"scheme": "basic",
"username": "${BITBUCKET_USERNAME}",
"password": "${BITBUCKET_PASSWORD}"
}
}
]
}
10 changes: 10 additions & 0 deletions defaultFilters/bitbucket-server-bearer-auth.json
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,16 @@
"scheme": "bearer",
"token": "${BITBUCKET_PAT}"
}
},
{
"//": "used to validate credentials",
"method": "GET",
"path": "/rest/api/1.0/projects/:project/repos/:repo/permissions/search",
"origin": "https://${BITBUCKET}",
"auth": {
"scheme": "bearer",
"token": "${BITBUCKET_PAT}"
}
}
]
}
11 changes: 11 additions & 0 deletions defaultFilters/bitbucket-server.json
Original file line number Diff line number Diff line change
Expand Up @@ -1156,6 +1156,17 @@
"username": "${BITBUCKET_USERNAME}",
"password": "${BITBUCKET_PASSWORD}"
}
},
{
"//": "used to validate credentials",
"method": "GET",
"path": "/rest/api/1.0/projects/:project/repos/:repo/permissions/search",
"origin": "https://${BITBUCKET}",
"auth": {
"scheme": "basic",
"username": "${BITBUCKET_USERNAME}",
"password": "${BITBUCKET_PASSWORD}"
}
}
]
}
36 changes: 0 additions & 36 deletions test/fixtures/accept/bitbucket-server-bearer-auth.json

This file was deleted.

39 changes: 0 additions & 39 deletions test/fixtures/accept/bitbucket-server.json

This file was deleted.

Loading

0 comments on commit 3ea95a2

Please sign in to comment.