Hi everyone,
On GitHub/GitLab we can generate a personal access token and use it directly in Composer to give access to a single private repository.
In Bitbucket, I see that we can use OAuth consumer key/secret, but that seems to work at the workspace level — meaning it gives access to all private repos in the workspace.
What I actually need:
A way to give Composer access to only one private PHP library repo.
I don’t want to expose or allow access to all repos in my workspace.
Basically, I want something like GitHub/GitLab tokens that I can drop into Composer so that running composer install
will pull from just that one repo.
Is there any way to do this in Bitbucket?
Thanks in advance for any suggestions.
Hi @takielias
For your use case I'd suggest using a repository access token, they are scoped for a singular repository and you can configure the permissions granted to the access token for that repository:
Please let me know if you need further assistance.
Cheers!
- Ben (Bitbucket Cloud Support)
Hi @Ben ,
Thanks for the suggestion. But if I understand correctly, a repository access token can technically be used by anyone who obtains it, since it’s not tied to a specific user. That’s not exactly what I’m looking for.
What I need is a way to ensure that only users who already have access to the repository can use it, rather than having a standalone token that could be shared.
Is there a way to enforce this kind of user-based restriction?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.