extensions-website/files
Oleg Komarov e3ca4daed7 Permissions: change from list to key/value pairs in manifest (#168)
See #166

This PR changes validation rules for `permissions` field of the manifest.
When present, the field is expected to represent a dictionary of {slug: reason}
key-value pairs. Previous format was a list of [slug].

Validation for these reason strings ensures that a reason is a non-empty string,
no longer than 64 characters, and doesn't end in punctuation.

No visible changes on the website are done in this PR.
`/api/v1/extensions/` endpoint now returns `permissions` field as a dict
{slug: reason}, where reason is taken from `VersionPermission.help` field
managed via admin.

The new values are stored in metadata, but the `Version.permissions` model
is not changing yet, and thus it doesn't store the reason values.
We can decide to keep the model as is and lookup the reasons from
`Version.file.metadata`, but this needs more thought.

Reviewed-on: #168
Reviewed-by: Anna Sirota <annasirota@noreply.localhost>
2024-06-04 17:34:31 +02:00
..
migrations Reuse files as previews, icons or featured images (#161) 2024-06-04 12:23:25 +02:00
static/files/admin Admin: display icon/featured image/version relations of files 2024-05-31 12:57:19 +02:00
templates/files ApprovalQueue: fix N+1 query checking user.is_moderator 2024-05-06 19:16:50 +02:00
tests Files: add more tests for icon, featured image and video uploads 2024-05-10 18:23:23 +02:00
__init__.py Initial models, tests and other boilerplate 2022-08-25 17:37:48 +02:00
admin.py Admin: look up by extension slug/name across all file relations 2024-06-04 13:14:52 +02:00
apps.py Files: add WebP MIME-type 2024-04-26 13:34:30 +02:00
forms.py Reuse files as previews, icons or featured images (#161) 2024-06-04 12:23:25 +02:00
models.py Reuse files as previews, icons or featured images (#161) 2024-06-04 12:23:25 +02:00
signals.py Thumbnails: flag toggling validation requirement 2024-04-26 11:50:55 +02:00
tasks.py Thumbnails: update path when re-generating 2024-05-09 01:39:12 +02:00
theme.xsd Upload files, create extensions of different types + tests 2022-08-31 17:31:22 +02:00
utils.py Support for platforms and wheels (#131) 2024-05-16 18:20:41 +02:00
validators.py Permissions: change from list to key/value pairs in manifest (#168) 2024-06-04 17:34:31 +02:00