Skip to content

Commit 2ed4d57

Browse files
committed
Removed '!' from all API urls - I've no idea why it was there, but it must be removed for basic auth to work.
1 parent cef16bb commit 2ed4d57

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
lines changed

src/main/scala/com/codacy/client/bitbucket/service/BuildStatusServices.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class BuildStatusServices(client: BitbucketClient) {
1111
*
1212
*/
1313
def getBuildStatus(owner: String, repository: String, commit: String, key: String): RequestResponse[BuildStatus] = {
14-
val url = s"https://bitbucket.org/!api/2.0/repositories/$owner/$repository/commit/$commit/statuses/build/$key"
14+
val url = s"https://bitbucket.org/api/2.0/repositories/$owner/$repository/commit/$commit/statuses/build/$key"
1515

1616
client.execute(Request(url, classOf[BuildStatus]))
1717
}
@@ -22,7 +22,7 @@ class BuildStatusServices(client: BitbucketClient) {
2222
*
2323
*/
2424
def createBuildStatus(owner: String, repository: String, commit: String, buildStatus: BuildStatus): RequestResponse[BuildStatus] = {
25-
val url = s"https://bitbucket.org/!api/2.0/repositories/$owner/$repository/commit/$commit/statuses/build"
25+
val url = s"https://bitbucket.org/api/2.0/repositories/$owner/$repository/commit/$commit/statuses/build"
2626

2727
val values = Map("state" -> Seq(buildStatus.state.toString), "key" -> Seq(buildStatus.key),
2828
"name" -> Seq(buildStatus.name), "url" -> Seq(buildStatus.url),
@@ -36,7 +36,7 @@ class BuildStatusServices(client: BitbucketClient) {
3636
*
3737
*/
3838
def updateBuildStatus(owner: String, repository: String, commit: String, buildStatus: BuildStatus): RequestResponse[BuildStatus] = {
39-
val url = s"https://bitbucket.org/!api/2.0/repositories/$owner/$repository/commit/$commit/statuses/build/${buildStatus.key}"
39+
val url = s"https://bitbucket.org/api/2.0/repositories/$owner/$repository/commit/$commit/statuses/build/${buildStatus.key}"
4040

4141
val payload = Json.obj(
4242
"state" -> buildStatus.state,

src/main/scala/com/codacy/client/bitbucket/service/CommitServices.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import play.api.libs.json.{JsNumber, JsObject, JsString}
88
class CommitServices(client: BitbucketClient) {
99

1010
def createComment(author: String, repo: String, commit: String, body: String, file: Option[String] = None, line: Option[Int] = None): RequestResponse[CommitComment] = {
11-
val url = s"https://bitbucket.org/!api/1.0/repositories/$author/$repo/changesets/${CommitHelper.anchor(commit)}/comments"
11+
val url = s"https://bitbucket.org/api/1.0/repositories/$author/$repo/changesets/${CommitHelper.anchor(commit)}/comments"
1212

1313
val params = file.map(filename => "filename" -> JsString(filename)) ++
1414
line.map(lineTo => "line_to" -> JsNumber(lineTo))
@@ -19,7 +19,7 @@ class CommitServices(client: BitbucketClient) {
1919
}
2020

2121
def deleteComment(author: String, repo: String, commit: String, commentId: Long): Unit = {
22-
val url = s"https://bitbucket.org/!api/1.0/repositories/$author/$repo/changesets/${CommitHelper.anchor(commit)}/comments/$commentId"
22+
val url = s"https://bitbucket.org/api/1.0/repositories/$author/$repo/changesets/${CommitHelper.anchor(commit)}/comments/$commentId"
2323

2424
client.delete(url)
2525
}

src/main/scala/com/codacy/client/bitbucket/service/PullRequestServices.scala

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class PullRequestServices(client: BitbucketClient) {
1414
*
1515
*/
1616
def getPullRequests(owner: String, repository: String, states: Seq[String] = Seq("OPEN")): RequestResponse[Seq[PullRequest]] = {
17-
val url = s"https://bitbucket.org/!api/2.0/repositories/$owner/$repository/pullrequests?pagelen=50&state=${states.mkString("&state=")}"
17+
val url = s"https://bitbucket.org/api/2.0/repositories/$owner/$repository/pullrequests?pagelen=50&state=${states.mkString("&state=")}"
1818

1919
client.executePaginated(Request(url, classOf[Seq[PullRequest]]))
2020
}
@@ -24,13 +24,13 @@ class PullRequestServices(client: BitbucketClient) {
2424
*
2525
*/
2626
def getPullRequestCommits(owner: String, repository: String, prId: Long): RequestResponse[Seq[SimpleCommit]] = {
27-
val url = s"https://bitbucket.org/!api/2.0/repositories/$owner/$repository/pullrequests/$prId/commits?pagelen=100"
27+
val url = s"https://bitbucket.org/api/2.0/repositories/$owner/$repository/pullrequests/$prId/commits?pagelen=100"
2828

2929
client.executePaginated(Request(url, classOf[Seq[SimpleCommit]]))
3030
}
3131

3232
def create(owner: String, repository: String, title: String, sourceBranch: String, destinationBranch: String): RequestResponse[JsObject] = {
33-
val url = s"https://bitbucket.org/!api/2.0/repositories/$owner/$repository/pullrequests"
33+
val url = s"https://bitbucket.org/api/2.0/repositories/$owner/$repository/pullrequests"
3434

3535
val payload = Json.obj(
3636
"title" -> title,
@@ -50,22 +50,22 @@ class PullRequestServices(client: BitbucketClient) {
5050
}
5151

5252
def postApprove(owner: String, repository: String, prId: Long): RequestResponse[JsObject] = {
53-
val url = s"https://bitbucket.org/!api/2.0/repositories/$owner/$repository/pullrequests/$prId/approve"
53+
val url = s"https://bitbucket.org/api/2.0/repositories/$owner/$repository/pullrequests/$prId/approve"
5454
client.postJson(Request(url, classOf[JsObject]), JsNull)
5555
}
5656

5757
def deleteApprove(owner: String, repository: String, prId: Long): RequestResponse[Boolean] = {
58-
val url = s"https://bitbucket.org/!api/2.0/repositories/$owner/$repository/pullrequests/$prId/approve"
58+
val url = s"https://bitbucket.org/api/2.0/repositories/$owner/$repository/pullrequests/$prId/approve"
5959
client.delete(url)
6060
}
6161

6262
def merge(owner: String, repository: String, prId: Long): RequestResponse[JsObject] = {
63-
val url = s"https://bitbucket.org/!api/2.0/repositories/$owner/$repository/pullrequests/$prId/merge"
63+
val url = s"https://bitbucket.org/api/2.0/repositories/$owner/$repository/pullrequests/$prId/merge"
6464
client.postJson(Request(url, classOf[JsObject]), JsNull)
6565
}
6666

6767
def decline(owner: String, repository: String, prId: Long): RequestResponse[JsObject] = {
68-
val url = s"https://bitbucket.org/!api/2.0/repositories/$owner/$repository/pullrequests/$prId/decline"
68+
val url = s"https://bitbucket.org/api/2.0/repositories/$owner/$repository/pullrequests/$prId/decline"
6969
client.postJson(Request(url, classOf[JsObject]), JsNull)
7070
}
7171

@@ -95,7 +95,7 @@ class PullRequestServices(client: BitbucketClient) {
9595
}
9696

9797
def listComments(author: String, repo: String, pullRequestId: Int): RequestResponse[Seq[SimplePullRequestComment]] = {
98-
val url = s"https://bitbucket.org/!api/1.0/repositories/$author/$repo/pullrequests/$pullRequestId/comments"
98+
val url = s"https://bitbucket.org/api/1.0/repositories/$author/$repo/pullrequests/$pullRequestId/comments"
9999

100100
client.execute(Request(url, classOf[Seq[SimplePullRequestComment]]))
101101
}

src/main/scala/com/codacy/client/bitbucket/service/RepositoryServices.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,22 @@ class RepositoryServices(client: BitbucketClient) {
1111
* Use this if you're looking for a full list of all of the repositories associated with a user
1212
*/
1313
def getRepositories: RequestResponse[Seq[SimpleRepository]] = {
14-
client.execute(Request(s"https://bitbucket.org/!api/1.0/user/repositories", classOf[Seq[SimpleRepository]]))
14+
client.execute(Request(s"https://bitbucket.org/api/1.0/user/repositories", classOf[Seq[SimpleRepository]]))
1515
}
1616

1717
/*
1818
* Gets the list of the user's repositories. Private repositories only appear on this list
1919
* if the caller is authenticated and is authorized to view the repository.
2020
*/
2121
def getRepositories(username: String): RequestResponse[Seq[Repository]] = {
22-
client.executePaginated(Request(s"https://bitbucket.org/!api/2.0/repositories/$username", classOf[Seq[Repository]]))
22+
client.executePaginated(Request(s"https://bitbucket.org/api/2.0/repositories/$username", classOf[Seq[Repository]]))
2323
}
2424

2525
/*
2626
* Creates a ssh key
2727
*/
2828
def createKey(username: String, repo: String, key: String): RequestResponse[SshKey] = {
29-
val url = s"https://bitbucket.org/!api/1.0/repositories/$username/$repo/deploy-keys"
29+
val url = s"https://bitbucket.org/api/1.0/repositories/$username/$repo/deploy-keys"
3030

3131
val values = Json.obj(
3232
"key" -> key,

src/main/scala/com/codacy/client/bitbucket/service/UserServices.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@ class UserServices(client: BitbucketClient) {
1010
* Gets the basic information associated with the token owner account.
1111
*/
1212
def getUser: RequestResponse[User] = {
13-
client.execute(Request("https://bitbucket.org/!api/1.0/user", classOf[User]))
13+
client.execute(Request("https://bitbucket.org/api/1.0/user", classOf[User]))
1414
}
1515

1616
/*
1717
* Gets the basic information associated with an account.
1818
*/
1919
def getUser(username: String): RequestResponse[User] = {
20-
client.execute(Request(s"https://bitbucket.org/!api/1.0/users/$username", classOf[User]))
20+
client.execute(Request(s"https://bitbucket.org/api/1.0/users/$username", classOf[User]))
2121
}
2222

2323
/*
2424
* Creates a ssh key
2525
*/
2626
def createKey(username: String, key: String): RequestResponse[SshKey] = {
27-
val url = s"https://bitbucket.org/!api/1.0/users/$username/ssh-keys"
27+
val url = s"https://bitbucket.org/api/1.0/users/$username/ssh-keys"
2828

2929
val values = Json.obj(
3030
"key" -> key,

0 commit comments

Comments
 (0)