无法以开发人员身份使用API在团队中创建Bitbucket存储库
我有一个名为无法以开发人员身份使用API在团队中创建Bitbucket存储库,api,repository,bitbucket,bitbucket-api,Api,Repository,Bitbucket,Bitbucket Api,我有一个名为myaccount的Bitbucket帐户。我是名为ateam的团队的开发人员,该团队不属于我。我不是这个团队的管理员。开发人员在ateam中设置了创建存储库的权限。我可以通过bitbucket网站的UI在ateam中手动创建存储库。但是,我无法使用bitbucket的API执行此操作: $ curl -X POST -v -u myaccount:mypasswd https://api.bitbucket.org/2.0/repositories/ateam/rep1 -H "C
myaccount
的Bitbucket帐户。我是名为ateam的团队的开发人员,该团队不属于我。我不是这个团队的管理员。开发人员在ateam
中设置了创建存储库的权限。我可以通过bitbucket
网站的UI在ateam
中手动创建存储库。但是,我无法使用bitbucket的API执行此操作:
$ curl -X POST -v -u myaccount:mypasswd https://api.bitbucket.org/2.0/repositories/ateam/rep1 -H "Content-Type: application/json" -d '{"is_private": true}'
Enter host password for user 'myaccount':
* Trying 104.192.143.5...
* Connected to api.bitbucket.org (104.192.143.5) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* Server certificate: *.bitbucket.org
* Server certificate: DigiCert SHA2 High Assurance Server CA
* Server certificate: DigiCert High Assurance EV Root CA
* Server auth using Basic with user 'myaccount'
> POST /2.0/repositories/histeam/rep2 HTTP/1.1
> Host: api.bitbucket.org
> Authorization: Basic YWxleGFuZHJlLW5hZGluOmJpdGJ1Y2tldDEy
> User-Agent: curl/7.43.0
> Accept: */*
> Content-Type: application/json
> Content-Length: 20
>
* upload completely sent off: 20 out of 20 bytes
< HTTP/1.1 403 FORBIDDEN
< Server: nginx/1.6.2
< Vary: Authorization, Cookie
< Content-Type: application/json; charset=utf-8
< Strict-Transport-Security: max-age=31536000
< Date: Thu, 14 Jul 2016 09:59:27 GMT
< X-Served-By: app-111
< X-Static-Version: 53f44cd8792e
< ETag: "2517d8a35dee8cb8cd9e5f0c889915ba"
< X-Render-Time: 0.0265378952026
< X-Accepted-OAuth-Scopes: repository:admin
< Connection: keep-alive
< X-Version: 53f44cd8792e
< X-Request-Count: 317
< X-Frame-Options: SAMEORIGIN
< Content-Length: 35
<
* Connection #0 to host api.bitbucket.org left intact
{"error": {"message": "Forbidden"}}
关键是我需要以开发人员的身份而不是管理员的身份使用API创建一个存储库。它使用网站的GUI工作,但不通过API工作:尽管有创建存储库的权限,但禁止开发人员使用API来创建存储库。我们这里有虫子吗?如果没有,我是否遗漏了什么
编辑1 下面是开发人员对团队权限的屏幕截图。正如人们所看到的,他们应该能够创建一个存储库
这里是Bitbucket开发者。我同意这是一个错误。事实上,我个人对此负有责任:(.所以,对此表示歉意 我已经做了一个修复,它将在下一次部署中部署(可能是本周二)
亲切问候。据我所知,只有管理员才能创建repo。这是不真实的,我附加了一个图像,向您展示了开发人员在团队中的权限。任何开发人员都可以使用web界面在团队中创建任何存储库。我们需要使用API来创建存储库,这是出于某些原因而禁止的。非常感谢!我期待修复;)
$ curl -X POST -v -u myaccount:mypasswd https://api.bitbucket.org/2.0/repositories/ateam/rep1 -H "Content-Type: application/json" -d '{"is_private": true}'