Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add license slug #18361

Closed
eviljeff opened this issue Nov 18, 2021 · 4 comments · Fixed by #18437
Closed

add license slug #18361

eviljeff opened this issue Nov 18, 2021 · 4 comments · Fixed by #18437

Comments

@eviljeff
Copy link
Member

for the addon submission api license implementation #18034 we need some way for an api client to be able to specify a pre-defined license. We have a license id (the license record pk), and a builtin integer (if >0 used to indicate the license is pre-defined, and to enumerate the choices), but neither is particularly user-friendly. Ideally we'd have a slug, for example mpl2, bsd, cc, etc, for the non-custom licenses.

@ioanarusiczki
Copy link

@eviljeff

I tried to test this using the info for license slugs from the docs. I ran quickly into 429 Too Many Requests while making PATCH requests on versions endpoint, sending license slugs. I don't know what's the new rule on throttles and I don't think I can override it as an admin.

  • at addon create I could send the request with a license slug "license": "MPL-2.0"
  • PATCH requests for static themes -> I tested with all license slugs
  • PATCH requests for non-themes -> I got some error for "LGPL-3.0-or-later" and I did not understand the reason why yet, I did have a problem with "all-rights-reserved" but once I associated it with builtinid:18 (in admin) I could use it. Because of "Request was throttled" I'm going to re-check this tomorrow.

@eviljeff
Copy link
Member Author

eviljeff commented Dec 7, 2021

@ioanarusiczki it was the fix for #18122 (that just got reverted)

@ioanarusiczki
Copy link

@eviljeff I tried to send {"license": "LGPL-3.0-or-later"} but I get a 400 "Invalid value". I checked the admin and I see "GNU Lesser General Public License, version 3.0" with the URL http://www.gnu.org/licenses/lgpl-3.0.html being available.

The other similar license with "LGPL-2.1-or-later" is alright. Maybe the slug for 3.0 is not correct?

@eviljeff
Copy link
Member Author

eviljeff commented Dec 8, 2021

@eviljeff I tried to send {"license": "LGPL-3.0-or-later"} but I get a 400 "Invalid value". I checked the admin and I see "GNU Lesser General Public License, version 3.0" with the URL http://www.gnu.org/licenses/lgpl-3.0.html being available.

The other similar license with "LGPL-2.1-or-later" is alright. Maybe the slug for 3.0 is not correct?

eek, you're right - the slug is wrong. I'll have to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants