I'm on a tricky situation to manage the access to multiple private repositories from a server which I'm installing with Composer.
I have multiple Teams with Projects and Repositories and everything works great for me and my team for our daily work.
The problem is when I want to give access to certain Repositories or Teams for a certain machine (usually a Linux server). For example to install repositories with Composer.
I've tried different options but or I'm missing a point or I don't know how to solve properly:
SSH Key method:
I want to configure an SSH key for multiple Repositories or multiple Teams but not on Account level for not giving access to all Repositories and Teams I have access.
The problem is that I cannot use the same SSH Key on multiple Repositories or Teams because of "Someone has already added that SSH key." error.
oAuth option:
I tried to create oAuth key/secret consumers and they work good if I generate an access_token with cURL and clone the repositories with x-token-auth pattern.
I can't make them work with composer unless if I configure the x-token-auth for repository url on composer.json which is not an option for obvious reasons.
I already tried to create auth.json file and configure bitbucket-oauth on composer.json
User based:
The only option I see would be to create a user for each server and configure and SSH key to this user and grant access to these repositories. Seems very time consuming and non scalable solutions.
Could anyone give me any insights about this problem?
Thank you in advance!