Distribution to Bintray only available for Admin users

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Distribution to Bintray only available for Admin users

unguiculus
Hi,

We have a number of open source projects which we push to Bintray. I am trying to use a distribution repo for this. Bintray integration is configured in Artifactory. Bintray API keys have been added to the users' profiles. Permissions to the distribution repo have been granted. However, only admin users have the Distribute feature available in Artifactory. Trying to use the REST API also gives an error: "Invalid user for operation - you do not have the required permission." What am I missing here, what permission is required? The docs don't mention permissions at all for distribution repos. I'd appreciate any assistance.

Thanks,
Reinhard
Reply | Threaded
Open this post in threaded view
|

Re: Distribution to Bintray only available for Admin users

eranbl
Hi Reinhard,

I believe there might be some confusion here.
The Distribution repository is not related to the Bintray integration configuration. While the Bintray integration require you to configure you API key in the user profile this is _not_ part/related to the distribution repository configuration. As documented here the setup of the Distribution repository needs to be done by an Admin user in a Bintray organization (. As part of the dist repo configuration the user is redirected to Bintray to retrieve a token. This token is then used as part of the repo configuration. However, any Artifactory user with Read+Write permissions can use this feature (once the dist repo is configured).

Hope this helps,
Eran

p.s. with respect to the permissions required on Bintray's side this is actually documented:
"Artifacts are synchronized from your Artifactory distribution repository to Bintray through a Bintray organization to which you have administration privileges"
Reply | Threaded
Open this post in threaded view
|

Re: Distribution to Bintray only available for Admin users

unguiculus
Hi Eran,

Thanks for you response. Maybe I did not express myself clearly enough. I set up the distribution repo and Bintray integration correctly in Artifactory Pro and I can successfully distribute artifacts to Bintray. It works for me being an admin in Artifactory. However, I could not find a way to make this feature available to non-admin users in Artifactory. I assigned read and write permissions for the Maven repo and the distribution repo, but the "Distribute" functionality is not available in the Web UI and the REST API (https://www.jfrog.com/confluence/display/RTF/Artifactory+REST+API#ArtifactoryRESTAPI-DistributeBuild) can't be used either as I mentioned in my initial post. So, my question is: What is necessary to enable the "Distribute" feature in Artifactory to non-admin users?

Thanks,
Reinhard
Reply | Threaded
Open this post in threaded view
|

Re: Distribution to Bintray only available for Admin users

unguiculus
Okay, so I dug into the source code and found out that the user needs permissions to any path in the distribution repo. Maybe this could be made clearer in the docs.

DistributionServiceImpl lines 196 ff.
//Distribute permission == deploy to root of dist repo
if (!authorizationService.canDeploy(repo.getRepoPath("."))) {

After granting permissions with pattern '**', the distribution feature is available for the user in the Web UI and does work. However, it still does not work using the REST API.

"status" : 403,
"message" : "Invalid user for operation - you do not have the required permission, user: foo"

BintrayRestHelper.isPushToBintrayAllowed returns false.

What else is missing?

Thanks, Reinhard