Connect Bitbucket Cloud
Let ProofLayer read your Bitbucket Cloud repositories to prove they are private and that their main branch is protected.
Before you start
Bitbucket Cloud is where some teams keep their source code. ProofLayer reads each repository’s visibility and branch rules to show that code is private and that changes go through review. ProofLayer only reads. It never changes code or settings.
| Word | What it means |
|---|---|
| Workspace | Your company’s space in Bitbucket Cloud. The slug is the first part of its address: acme in bitbucket.org/acme. |
| Workspace access token | A long code that lets a program read parts of your workspace. You choose exactly what it may do. |
| Branch restriction | A Bitbucket rule on a branch, such as “only these people may push directly” or “no force pushes”. |
Create the token in Bitbucket
Open your workspace settings
In Bitbucket choose your workspace, then open Settings → Workspace settings. Under security find Access tokens.
Create a workspace access token
Press Create workspace access token. Name it “ProofLayer read-only” and choose an expiry.
Choose the permissions
Tick these scopes:
Scopes Repositories: Read Account: Read Repositories: Admin (so branch restrictions can be read)Bitbucket only shows a repository’s branch restrictions to tokens with the Admin permission. ProofLayer itself makes read-only requests and never changes anything.
Copy the token
Press Create and copy the token straight away. Bitbucket shows it once.
Give ProofLayer the token
Create the connection
In ProofLayer go to Connections → New connection. For Provider choose Bitbucket Cloud, give it a Name such as “Engineering Bitbucket workspace”, and enter your Workspace (for example
acme).Paste the token
Paste it into Access token and press Create.
ProofLayer stores it encrypted and never shows it again. To replace it later, open the connection and use the Bitbucket access card.
Check that it works
Open the connection in ProofLayer
Go to Connections, click the connection you just made, and find the card called Bitbucket access.
Press Test access
ProofLayer makes one small read-only request and shows the answer.
Success looks like a green Access verified message. A red Access test failed message says what went wrong; see the table at the end of this page.
What ProofLayer reads
- Whether any repository is public.
- Whether each repository’s default branch has a rule limiting who can push to it directly.
- Whether history on the default branch can be rewritten (force push).
- Whether merging needs at least one approval, and a passing build.
- Empty repositories (no main branch yet) are skipped for the branch rules, but still checked for being private.
If something goes wrong
| What you see | Likely cause | What to do |
|---|---|---|
| Bitbucket refuses the token | Wrong workspace, expired token, or missing scopes. | Check the workspace slug and that Repositories: Read and Account: Read are ticked. |
| Branch rules fail to read | The token lacks the Admin permission on repositories. | Create a new token that includes Repositories: Admin. |
| Repositories are missing | The token covers only some repositories. | Use a workspace access token rather than a repository one. |
| You wanted two-factor evidence | Bitbucket does not provide it. | Connect the identity provider you sign in with. |