geofront.backends.bitbucket
— Bitbucket Cloud team¶
New in version 0.4.0.
Provides team implementation for Bitbucket Cloud (which is also known as simply Bitbucket).
In order to use Bitbucket’s API you need to add an OAuth consumer. You can find the form from
. OAuth consumer has to be set like the following:- Callback
- It has to be the root url of the Geofront server.
- Permissions
The following permissions are required:
- Account
Read.
It’s used for identifying the authenticated Bitbucket user.
- Team membership
Read.
It’s used for determining whether the authenticated Bitbucket user belongs to the Bitbucket team.
Other than the above are unnecessary.
Note
Not to be confused with Bitbucket Server (which was Stash).
For Bitbucket Server, use geofront.backend.stash
module instead.
Note
Unfortunately, Atlassian deprecated the existing SSH keys endpoint
from their HTTP RESTful API. Unlike geofront.backends.github
or
geofront.backends.stash
, Bitbucket Cloud cannot be used for
storing/loading public keys, but can be used only for authentication and
authorization. You need to use other key store implementations instead
e.g. CloudKeyStore
or DatabaseKeyStore
.
-
class
geofront.backends.bitbucket.
BitbucketTeam
(consumer_key: str, consumer_secret: str, team_username: str) → None¶ Authenticate team membership through Bitbucket Cloud, and authorize to access Bitbucket Cloud key store.
Note that group identifiers
list_groups()
method returns are Bitbucket team group slugs. You can find the list of your available group slugs in the team using Bitbucket API:$ curl -u YourUsername https://api.bitbucket.org/1.0/groups/YourTeamUsername/ [ { "name": "Administrators", "permission": "read", "auto_add": false, "slug": "administrators", ... }, { "name": "Developers", "permission": "read", "auto_add": false, "slug": "developers", ... }, ]
Parameters: - consumer_key (
str
) – bitbucket oauth consumer key - consumer_secret (
str
) – bitbucket oauth consumer secret - team_username (
str
) – bitbucket team account name. for example'spoqa'
in https://bitbucket.org/spoqa
- consumer_key (