scripticus-schema 0.1.1__tar.gz → 0.1.2__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.
- {scripticus_schema-0.1.1 → scripticus_schema-0.1.2}/PKG-INFO +1 -1
- {scripticus_schema-0.1.1 → scripticus_schema-0.1.2}/pyproject.toml +1 -1
- {scripticus_schema-0.1.1 → scripticus_schema-0.1.2}/src/scripticus_schema/manifest.py +6 -0
- scripticus_schema-0.1.2/src/scripticus_schema/publish_api.py +30 -0
- {scripticus_schema-0.1.1 → scripticus_schema-0.1.2}/README.md +0 -0
- {scripticus_schema-0.1.1 → scripticus_schema-0.1.2}/src/scripticus_schema/__init__.py +0 -0
- {scripticus_schema-0.1.1 → scripticus_schema-0.1.2}/src/scripticus_schema/index_api.py +0 -0
- {scripticus_schema-0.1.1 → scripticus_schema-0.1.2}/src/scripticus_schema/semver.py +0 -0
- {scripticus_schema-0.1.1 → scripticus_schema-0.1.2}/src/scripticus_schema/treehash.py +0 -0
|
@@ -25,6 +25,12 @@ NAMESPACE_RE = re.compile(r"^[a-z][a-z0-9]*(-[a-z0-9]+)*$")
|
|
|
25
25
|
|
|
26
26
|
KNOWN_OS = ("linux", "macos", "windows")
|
|
27
27
|
|
|
28
|
+
# One archive per format group: POSIX/macOS targets travel as .tar.gz,
|
|
29
|
+
# Windows as .zip (D26). The client packs by this table; the server checks
|
|
30
|
+
# at publish that an uploaded archive's format matches the manifest's
|
|
31
|
+
# declared platforms.
|
|
32
|
+
FORMAT_GROUPS = (("tar.gz", ("linux", "macos")), ("zip", ("windows",)))
|
|
33
|
+
|
|
28
34
|
|
|
29
35
|
@dataclass(frozen=True)
|
|
30
36
|
class Language:
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"""Wire models for the index service's publish (write-path) API (D32).
|
|
2
|
+
|
|
3
|
+
The request side is deliberately not modelled here: a publish is a
|
|
4
|
+
multipart upload of the package archive plus a Gitea token in the
|
|
5
|
+
``Authorization`` header, and everything else — identity, variant tags,
|
|
6
|
+
dependencies, the content hash — is derived server-side from the archive
|
|
7
|
+
itself, which is never trusted to match any client-supplied claims (D8).
|
|
8
|
+
Only the response shape is contract.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from pydantic import BaseModel
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class PublishedArtifact(BaseModel):
|
|
15
|
+
filename: str
|
|
16
|
+
archive_format: str # "tar.gz" | "zip"
|
|
17
|
+
platforms: list[str]
|
|
18
|
+
language: str
|
|
19
|
+
size: int
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class PublishResult(BaseModel):
|
|
23
|
+
"""Response for a successful publish: what the index now records."""
|
|
24
|
+
|
|
25
|
+
namespace: str
|
|
26
|
+
name: str
|
|
27
|
+
version: str
|
|
28
|
+
content_hash: str
|
|
29
|
+
publisher: str
|
|
30
|
+
artifact: PublishedArtifact
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|