eclipse-sw360 / sw360

SW360 project
https://www.eclipse.org/sw360/
Other
123 stars 99 forks source link

REST API: write access revised #512

Open mcjaeger opened 5 years ago

mcjaeger commented 5 years ago

Background

Some discussion from a couple telcos have covered to re-engineer the write access over the REST API to the SW360 system. Currently, there are the following two main authentication methods:

Currently, write access over the REST API is possible the same way as using the UI in the browser. Since a person has written a selenium-based remote control for SW360 (before the REST API was available) a separate restriction of the REST API which is not there in the Web UI is questionable.

The access key generation (in the user's preference section) allows for generation of read access only or read/write access.

New Motivation

Now another problem has emerged: not every user shall be able to write the SW360 using the REST API. rather the users who can write to the SW360 shall be elevated only when they need to write and their writing REST client code is OK.

Otherwise, users started writing a number of not-so-cool data sets which do not contain useful information (component name and version only, etc) and created entries are also not checked for duplicates.

Idea is to have persons tested their write clients using the SW360 REST API in a staging environment. Then, they could be granted for productive use.

Possible approaches

In the discussions, several approaches were evaluated:

imaykay commented 5 years ago

Hi @mcjaeger, everything sounds correct to me. Maybe just one refinement to the last bullet point in your list: The named Oauth credentials are "just" a valid Oauth access token that can be used for access until its given validity is reached.

So, just let us know which of the given two solutions you prefer. As discussed, both have advantages and disadvantages. Main points are:

Custom solution: user attribute

pro: faster to implement and easier to use con: no standard and custom tailored

Standard solution: oauth client workflow

pro: official standard for that use case con: more complicated to implement for us and each client

mcjaeger commented 5 years ago

I vote for standard solution

imaykay commented 5 years ago

I think it might make sense to divide this issue into smaller parts so that reviews and bug findings are easier. These issues are the ones I just created: