dserver-signed-url-plugin 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,24 @@
1
+ .idea
2
+ app.db
3
+ TODO.rst
4
+ .coverage
5
+
6
+ *.swp
7
+ *.pyc
8
+ *.egg-info
9
+ *.pdf
10
+
11
+ test_rsa*
12
+ migrations/*
13
+ data/*
14
+ env*
15
+ .cache/*
16
+ .pytest_cache/*
17
+ .tox/*
18
+ build/*
19
+ dist/*
20
+ venv/*
21
+ old-provision/*
22
+ jwt-spike/*
23
+
24
+ dserver_signed_url_plugin/version.py
@@ -0,0 +1,80 @@
1
+ Changelog
2
+ =========
3
+
4
+ All notable changes to this project will be documented in this file.
5
+
6
+ The format is based on `Keep a Changelog <https://keepachangelog.com/en/1.0.0/>`_,
7
+ and this project adheres to `Semantic Versioning <https://semver.org/spec/v2.0.0.html>`_.
8
+
9
+
10
+ [0.1.0] - 2026-11-30
11
+ --------------------
12
+
13
+ First release of the dserver signed URL plugin. dserver hands out
14
+ time-limited signed URLs for the storage backend, so users can read and
15
+ upload datasets without backend credentials. Access is controlled by
16
+ dserver's base URI permissions.
17
+
18
+ Added
19
+ ~~~~~
20
+
21
+ - Read routes (require search permission on the base URI):
22
+
23
+ - ``GET /signed-urls/dataset/<uri>`` - signed URLs for admin metadata,
24
+ manifest, README, items, overlays and annotations, plus the tags
25
+ - ``GET /signed-urls/item/<uri>/<identifier>`` - signed URL for one item
26
+
27
+ - Upload routes (require register permission on the base URI):
28
+
29
+ - ``POST /signed-urls/upload/<base_uri>`` - the client sends the dataset
30
+ metadata (UUID, name, creator, frozen-at time, items with size, hash
31
+ and timestamp, tags, annotations, overlays). The server creates a
32
+ proto-dataset, writes tags, annotations and overlays itself and returns
33
+ signed URLs for the README and the items
34
+ - ``POST /signed-urls/upload-complete`` - checks that README and all
35
+ items are present, freezes the dataset with the client's manifest and
36
+ registers it in dserver
37
+
38
+ - Item uploads are checked by the storage backend: where the storage broker
39
+ supports it (``dtool-s3``), each item URL pins the item's MD5 as
40
+ ``Content-MD5``; the client must send the returned ``headers`` with its
41
+ ``PUT``. Only the ``md5sum_hexdigest`` hash function is accepted
42
+ - Interrupted uploads can be resumed: repeating the upload request for the
43
+ same UUID and base URI returns fresh URLs. The same UUID at a different
44
+ location, an existing dataset, or an ``upload-complete`` for a URI other
45
+ than the one the upload was started for are rejected with ``409``
46
+ - Invalid dataset names are rejected with ``400``
47
+ - Concurrent ``upload-complete`` requests for the same dataset are handled:
48
+ a dataset frozen in the meantime is treated as frozen and registered
49
+ - Storage backend errors on server-side writes (e.g. ``AccessDenied``
50
+ because dserver's storage credentials lack write permission) return
51
+ ``502 Bad Gateway`` with an explanatory message; backends without signing
52
+ support return ``501``
53
+ - Pending uploads are stored in a ``pending_upload`` table in the dserver
54
+ SQL database; run ``flask db migrate`` and ``flask db upgrade`` after
55
+ installing the plugin
56
+ - ``flask pending_upload`` commands: ``list``, ``cleanup --older-than
57
+ <hours>`` (with ``--dry-run``) and ``delete <uuid>``
58
+ - Configuration (environment variables):
59
+
60
+ - ``SIGNED_URL_READ_EXPIRY_SECONDS`` - lifetime of read URLs
61
+ (default: 3600)
62
+ - ``SIGNED_URL_WRITE_EXPIRY_SECONDS`` - lifetime of upload URLs
63
+ (default: 14400)
64
+ - ``SIGNED_URL_HOST_REWRITE`` - optional ``internal|external`` base URL
65
+ pair, e.g. ``http://minio:9000|http://localhost:9000``, to rewrite the
66
+ host of returned URLs when dserver reaches storage under an internal
67
+ hostname
68
+
69
+ Storage credentials come from the usual dtool storage broker
70
+ configuration (e.g. ``DTOOL_S3_ENDPOINT_<bucket>``)
71
+
72
+ Dependencies
73
+ ~~~~~~~~~~~~
74
+
75
+ - Python 3.10 or later
76
+ - ``dtoolcore>=3.20.0`` (``freeze_with_manifest``,
77
+ ``DtoolCoreFrozenDataSetError``)
78
+ - ``dtool-s3>=0.15.0`` (signed URL support)
79
+ - ``dservercore>0.18.0``
80
+ - Optional ``azure`` extra (``dtool-azure``) for Azure Blob Storage
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Lars Pastewka
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.