Skip to content

Commit 3e67a31

Browse files
committed
Add message for undocumented endpoints
1 parent e8377ef commit 3e67a31

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

lib/bitbucket_rest_api/repos/keys.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@ def list(user_name_or_project_key, repo_name, params={})
1818
normalize! params
1919

2020
url = if BitBucket.options[:bitbucket_server]
21+
# Endpoint is not referenced in the docs
22+
# https://docs.atlassian.com/bitbucket-server/rest/6.0.0/bitbucket-rest.html
23+
# but has been tested
2124
"/1.0/projects/#{user_name_or_project_key}/repos/#{repo_name.downcase}/ssh"
2225
else
23-
"/2.0/repositories/#{user_name_or_project_key}/#{repo.downcase}/deploy-keys/"
26+
"/2.0/repositories/#{user_name_or_project_key}/#{repo.downcase}/deploy-keys"
2427
end
2528

2629
response = get_request(url, params)
@@ -51,6 +54,9 @@ def create(user_name_or_project_key, repo_name, params={})
5154
options = { headers: { "Content-Type" => "application/json" } }
5255

5356
url = if BitBucket.options[:bitbucket_server]
57+
# Endpoint is not referenced in the docs
58+
# https://docs.atlassian.com/bitbucket-server/rest/6.0.0/bitbucket-rest.html
59+
# but has been tested
5460
"/1.0/projects/#{user_name_or_project_key}/repos/#{repo_name.downcase}/ssh"
5561
else
5662
"/2.0/repositories/#{user_name_or_project_key}/#{repo.downcase}/deploy-keys/"
@@ -95,6 +101,9 @@ def delete(user_name_or_project_key, repo_name, key_id, params={})
95101
normalize! params
96102

97103
url = if BitBucket.options[:bitbucket_server]
104+
# Endpoint is not referenced in the docs
105+
# https://docs.atlassian.com/bitbucket-server/rest/6.0.0/bitbucket-rest.html
106+
# but has been tested
98107
"/1.0/projects/#{user_name_or_project_key}/repos/#{repo_name.downcase}/ssh/#{key_id}"
99108
else
100109
"/2.0/repositories/#{user_name_or_project_key}/#{repo.downcase}/deploy-keys/#{key_id}"

lib/bitbucket_rest_api/repos/statuses.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ def create(user_name, repo_name, sha, state, key, url, options = {})
3939
})
4040

4141
url = if BitBucket.options[:bitbucket_server]
42+
# Endpoint is not referenced in the docs
43+
# https://docs.atlassian.com/bitbucket-server/rest/6.0.0/bitbucket-rest.html
44+
# but has been tested
4245
"/rest/build-status/1.0/commits/#{sha}"
4346
else
4447
"/2.0/repositories/#{user}/#{sanitize_repository_name(repo)}/commit/#{sha}/statuses/build"

0 commit comments

Comments
 (0)