gitcx 0.1.0a3__py3-none-any.whl
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.
- gitcx/__init__.py +34 -0
- gitcx/__main__.py +3 -0
- gitcx/authentication.py +128 -0
- gitcx/backend.py +38 -0
- gitcx/branch_policy.py +49 -0
- gitcx/catalog.py +470 -0
- gitcx/cli.py +23 -0
- gitcx/domain.py +145 -0
- gitcx/git_http.py +211 -0
- gitcx/management.py +196 -0
- gitcx/permissions.py +52 -0
- gitcx/provisioning.py +118 -0
- gitcx/py.typed +0 -0
- gitcx/receive.py +151 -0
- gitcx/ref_policy.py +151 -0
- gitcx-0.1.0a3.dist-info/METADATA +76 -0
- gitcx-0.1.0a3.dist-info/RECORD +20 -0
- gitcx-0.1.0a3.dist-info/WHEEL +4 -0
- gitcx-0.1.0a3.dist-info/entry_points.txt +3 -0
- gitcx-0.1.0a3.dist-info/licenses/LICENSE +21 -0
gitcx/receive.py
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"""Authenticated SHA-256 hosted receive with explicit cross-store outcomes."""
|
|
2
|
+
|
|
3
|
+
from contextlib import contextmanager
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
import time
|
|
6
|
+
|
|
7
|
+
from gitdx import (Advertisement, AdvertisedRef, Capability, CommandStatus, DirectRef, FLUSH,
|
|
8
|
+
IngestionProfile, Packet, ProtocolLimits, ReceiveInterrupted, ReceiveLimits,
|
|
9
|
+
ReceivePolicy, ReceiveRejected, ReceiveState, ReportStatus, TransferLimits,
|
|
10
|
+
UnsupportedFormat, encode_advertisement, encode_packet, encode_report_status,
|
|
11
|
+
parse_push_request)
|
|
12
|
+
from gitdx.confined_fs import ConfinedStorage, supported
|
|
13
|
+
|
|
14
|
+
from .authentication import TokenAuth
|
|
15
|
+
from .catalog import EventKind
|
|
16
|
+
from .domain import Action
|
|
17
|
+
from .permissions import PermissionDenied
|
|
18
|
+
from .ref_policy import RefPolicyService
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def default_receive_limits():
|
|
22
|
+
return ReceiveLimits(transfer=TransferLimits(max_refs=128, max_wire_bytes=16*1024*1024))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def require_write_profile(record):
|
|
26
|
+
if record.object_format != 'sha256':
|
|
27
|
+
raise UnsupportedFormat('hosted receive requires native SHA-256 storage')
|
|
28
|
+
if not supported():
|
|
29
|
+
raise UnsupportedFormat('hosted receive requires the qualified Linux descriptor profile')
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def preflight_receive(record, repo, limits):
|
|
33
|
+
require_write_profile(record)
|
|
34
|
+
if repo.object_format.value != record.object_format or not repo.bare:
|
|
35
|
+
raise UnsupportedFormat('hosted receive storage format mismatch')
|
|
36
|
+
# This creates no quarantine and runs before the host reads request bytes.
|
|
37
|
+
with ConfinedStorage(repo.git_dir, repo.storage_identity, limits=limits.filesystem): pass
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
@dataclass(frozen=True, slots=True)
|
|
41
|
+
class HostedReceiveResult:
|
|
42
|
+
operation_id: str
|
|
43
|
+
result: object
|
|
44
|
+
wire: bytes
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class ReceiveService:
|
|
48
|
+
def __init__(self, catalog, backend, *, limits=None, clock=time.time):
|
|
49
|
+
self.catalog = catalog;self.backend = backend
|
|
50
|
+
self.limits = limits or default_receive_limits();self.clock = clock
|
|
51
|
+
if not isinstance(self.limits, ReceiveLimits): raise TypeError('select ReceiveLimits')
|
|
52
|
+
self.protocol = ProtocolLimits(max_bytes=self.limits.transfer.max_wire_bytes,
|
|
53
|
+
max_refs=min(256, self.limits.transfer.max_refs), max_name_bytes=1024,
|
|
54
|
+
timeout=self.limits.transfer.max_seconds)
|
|
55
|
+
|
|
56
|
+
def _authorized(self, actor, repository_id, *, action=Action.WRITE):
|
|
57
|
+
actor = TokenAuth(self.catalog).revalidate(actor, now=int(self.clock()))
|
|
58
|
+
record = self.catalog.get_repository(actor, repository_id, action=action)
|
|
59
|
+
if self.catalog.provisioning_state(record.id) != 'ready':
|
|
60
|
+
raise PermissionDenied('repository not found or permission denied')
|
|
61
|
+
require_write_profile(record)
|
|
62
|
+
return actor, record
|
|
63
|
+
|
|
64
|
+
def _advertisement(self, repo):
|
|
65
|
+
caps = (Capability(b'object-format', b'sha256'), Capability(b'report-status'),
|
|
66
|
+
Capability(b'report-status-v2'), Capability(b'ofs-delta'), Capability(b'no-thin'), Capability(b'delete-refs'))
|
|
67
|
+
refs = []
|
|
68
|
+
for name, value in repo.refs.snapshot(max_refs=self.protocol.max_refs):
|
|
69
|
+
if not name.startswith(('refs/heads/', 'refs/tags/')): continue
|
|
70
|
+
if not isinstance(value, DirectRef): raise UnsupportedFormat('hosted receive refuses symbolic destinations')
|
|
71
|
+
refs.append(AdvertisedRef(name.encode('ascii'), value.oid))
|
|
72
|
+
return Advertisement(0, repo.object_format, caps, tuple(refs))
|
|
73
|
+
|
|
74
|
+
def advertise(self, actor, repository_id):
|
|
75
|
+
with self.catalog.transaction():
|
|
76
|
+
actor, record = self._authorized(actor, repository_id)
|
|
77
|
+
repo = self.backend.open_repository(record.storage_id)
|
|
78
|
+
preflight_receive(record, repo, self.limits)
|
|
79
|
+
data = encode_advertisement(self._advertisement(repo), limits=self.protocol)
|
|
80
|
+
self._authorized(actor, repository_id)
|
|
81
|
+
return encode_packet(Packet(data=b'# service=git-receive-pack\n'))+encode_packet(FLUSH)+data
|
|
82
|
+
|
|
83
|
+
def receive(self, actor, repository_id, body, *, cancel=None):
|
|
84
|
+
with self.catalog.transaction():
|
|
85
|
+
actor, record = self._authorized(actor, repository_id)
|
|
86
|
+
repo = self.backend.open_repository(record.storage_id)
|
|
87
|
+
preflight_receive(record, repo, self.limits)
|
|
88
|
+
request = parse_push_request(body, self._advertisement(repo), repo.object_format, limits=self.protocol)
|
|
89
|
+
version = self.catalog.branch_policy(actor, record.id).version
|
|
90
|
+
operation = self.catalog._prepare_receive(actor, record, request.commands, now=int(self.clock()))
|
|
91
|
+
policy_service = RefPolicyService(self.catalog, self.backend, max_commands=self.protocol.max_refs)
|
|
92
|
+
|
|
93
|
+
def ref_check(view, command):
|
|
94
|
+
result = policy_service.evaluate_receive(actor, record, repo, (command,), view,
|
|
95
|
+
expected_version=version, now=int(self.clock()))
|
|
96
|
+
decision = result.decisions[0]
|
|
97
|
+
return None if decision.allowed else decision.reason.value.encode('ascii')
|
|
98
|
+
|
|
99
|
+
@contextmanager
|
|
100
|
+
def publication_guard(view, commands):
|
|
101
|
+
# Catalog changes commit wholly before or after this publication.
|
|
102
|
+
# Engine lock order is catalog, then deterministic Git ref locks.
|
|
103
|
+
with self.catalog.transaction():
|
|
104
|
+
current_actor, current = self._authorized(actor, record.id)
|
|
105
|
+
if current != record or self.catalog.branch_policy(current_actor, record.id).version != version:
|
|
106
|
+
raise PermissionDenied('repository policy changed before publication')
|
|
107
|
+
yield
|
|
108
|
+
|
|
109
|
+
policy = ReceivePolicy(allow_deletes=True, allow_non_fast_forwards=True, allow_tag_replacement=True,
|
|
110
|
+
ref_check=ref_check, ingestion=IngestionProfile.UNTRUSTED, publication_guard=publication_guard)
|
|
111
|
+
try:
|
|
112
|
+
result = repo.receive(request.commands, request.pack, policy=policy, limits=self.limits,
|
|
113
|
+
cancel=cancel, coordinated=True)
|
|
114
|
+
except (ReceiveRejected, ReceiveInterrupted) as error:
|
|
115
|
+
result = error.result
|
|
116
|
+
summary = {'unpack_ok': result.unpack_ok, 'cleanup_pending': result.cleanup_pending,
|
|
117
|
+
'cleanup_error': result.cleanup_error, 'atomic': result.atomic,
|
|
118
|
+
'ref_transaction': None if result.ref_transaction is None else {
|
|
119
|
+
'id': result.ref_transaction.transaction_id, 'state': result.ref_transaction.state.value,
|
|
120
|
+
'journal_pending': result.ref_transaction.journal_pending,
|
|
121
|
+
'retired_path': str(result.ref_transaction.retired_path) if result.ref_transaction.retired_path else None},
|
|
122
|
+
'outcomes': [{'name': o.command.name.decode('ascii'), 'state': o.state.value,
|
|
123
|
+
'reason': o.reason.decode('ascii') if o.reason else None} for o in result.outcomes]}
|
|
124
|
+
# A crash/database failure here leaves a prepared receipt: explicitly
|
|
125
|
+
# unknown, never inferred accepted merely by observing later ref tips.
|
|
126
|
+
self.catalog._finish_receive(operation, summary, now=int(self.clock()))
|
|
127
|
+
if any(o.state is ReceiveState.UNKNOWN for o in result.outcomes):
|
|
128
|
+
wire = encode_packet(Packet(data=b'ERR receive outcome unknown; re-read refs\n'))
|
|
129
|
+
else:
|
|
130
|
+
statuses = tuple(CommandStatus(o.command.name, o.state is ReceiveState.ACCEPTED,
|
|
131
|
+
b'' if o.state is ReceiveState.ACCEPTED else o.reason or b'not accepted') for o in result.outcomes)
|
|
132
|
+
report = ReportStatus(result.unpack_ok, statuses, b'' if result.unpack_ok else b'pack rejected')
|
|
133
|
+
version = 2 if any(c.name == b'report-status-v2' for c in request.negotiated.capabilities) else 1
|
|
134
|
+
wire = encode_report_status(report, request.commands, repo.object_format, version=version, limits=self.protocol)
|
|
135
|
+
return HostedReceiveResult(operation, result, wire)
|
|
136
|
+
|
|
137
|
+
def recover(self, actor, repository_id, *, cancel=None):
|
|
138
|
+
"""Explicit administrator recovery; never adopt lockfiles or orphans."""
|
|
139
|
+
with self.catalog.transaction():
|
|
140
|
+
actor, record = self._authorized(actor, repository_id, action=Action.ADMIN)
|
|
141
|
+
repo = self.backend.open_repository(record.storage_id)
|
|
142
|
+
preflight_receive(record, repo, self.limits)
|
|
143
|
+
result = repo.recover_receive(ingestion=IngestionProfile.UNTRUSTED, limits=self.limits, cancel=cancel)
|
|
144
|
+
if result is not None:
|
|
145
|
+
self.catalog._event(EventKind.RECEIVE_RECOVERED, actor.user_id, record.id, int(self.clock()))
|
|
146
|
+
# A recovered Git journal is authoritative about that transaction.
|
|
147
|
+
# Untied prepared request receipts remain unknown across restarts.
|
|
148
|
+
return result
|
|
149
|
+
|
|
150
|
+
def chunks(self, data):
|
|
151
|
+
for start in range(0, len(data), 64*1024): yield data[start:start+64*1024]
|
gitcx/ref_policy.py
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"""Read-only ref-change decisions for freshly authorized repository writers."""
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass, replace
|
|
4
|
+
from enum import StrEnum
|
|
5
|
+
from itertools import islice
|
|
6
|
+
|
|
7
|
+
from gitdx import ObjectType, PushCommand, RevisionLimits, parse_object
|
|
8
|
+
from gitdx.errors import GitdxError
|
|
9
|
+
from gitdx.names import validate_refname
|
|
10
|
+
from gitdx.refs import DirectRef
|
|
11
|
+
|
|
12
|
+
from .authentication import TokenAuth
|
|
13
|
+
from .domain import Action, Permission, Principal
|
|
14
|
+
from .permissions import PermissionDenied
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class RefReason(StrEnum):
|
|
18
|
+
ALLOWED = "allowed"
|
|
19
|
+
UNSUPPORTED_REF = "unsupported-ref"
|
|
20
|
+
STALE_TIP = "stale-tip"
|
|
21
|
+
INVALID_TARGET = "invalid-target"
|
|
22
|
+
CREATE_DENIED = "creation-protected"
|
|
23
|
+
DELETE_DENIED = "deletion-protected"
|
|
24
|
+
FORCE_DENIED = "force-protected"
|
|
25
|
+
ADMIN_REQUIRED = "administrator-required"
|
|
26
|
+
REVIEW_REQUIRED = "review-required"
|
|
27
|
+
POLICY_CHANGED = "policy-changed"
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@dataclass(frozen=True, slots=True)
|
|
31
|
+
class RefDecision:
|
|
32
|
+
command: PushCommand
|
|
33
|
+
reason: RefReason
|
|
34
|
+
fast_forward: bool | None = None
|
|
35
|
+
rules: tuple[str, ...] = ()
|
|
36
|
+
|
|
37
|
+
@property
|
|
38
|
+
def allowed(self):return self.reason is RefReason.ALLOWED
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
@dataclass(frozen=True, slots=True)
|
|
42
|
+
class RefPolicyResult:
|
|
43
|
+
repository_id: str
|
|
44
|
+
actor: Principal
|
|
45
|
+
policy_version: int
|
|
46
|
+
decisions: tuple[RefDecision, ...]
|
|
47
|
+
|
|
48
|
+
@property
|
|
49
|
+
def allowed(self):return all(item.allowed for item in self.decisions)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class RefPolicyService:
|
|
53
|
+
"""Decisions are snapshots, never authority to write refs later.
|
|
54
|
+
|
|
55
|
+
This trusted Python boundary accepts principals, not user-supplied identity
|
|
56
|
+
records. HTTP callers must use TokenAuth.request() first. Evaluation holds a
|
|
57
|
+
catalog transaction, refreshes credentials/grants and reads managed storage;
|
|
58
|
+
native writers can still change refs, so publication must validate again.
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
def __init__(self, catalog, backend, *, max_commands=256, ancestry_limits=None):
|
|
62
|
+
if type(max_commands) is not int or not 1 <= max_commands <= 256:
|
|
63
|
+
raise ValueError("policy batches contain at most 256 ref commands")
|
|
64
|
+
self.catalog, self.backend = catalog, backend
|
|
65
|
+
self.max_commands = max_commands
|
|
66
|
+
self.ancestry_limits = ancestry_limits or RevisionLimits()
|
|
67
|
+
|
|
68
|
+
def evaluate(self, actor: Principal, repository_id: str, commands, *, now: int) -> RefPolicyResult:
|
|
69
|
+
commands = tuple(islice(commands, self.max_commands + 1))
|
|
70
|
+
if not commands or len(commands) > self.max_commands:raise ValueError("empty or excessive ref command batch")
|
|
71
|
+
if any(not isinstance(c, PushCommand) for c in commands):raise TypeError("select gitdx PushCommand records")
|
|
72
|
+
if len({c.name for c in commands}) != len(commands):raise ValueError("duplicate ref commands")
|
|
73
|
+
with self.catalog.transaction():
|
|
74
|
+
actor = TokenAuth(self.catalog).revalidate(actor, now=now)
|
|
75
|
+
record = self.catalog.get_repository(actor, repository_id, action=Action.WRITE)
|
|
76
|
+
if self.catalog.provisioning_state(repository_id) != "ready":raise PermissionDenied("repository not found or permission denied")
|
|
77
|
+
policy = self.catalog.branch_policy(actor, repository_id)
|
|
78
|
+
try:self.catalog.get_repository(actor, repository_id, action=Action.ADMIN)
|
|
79
|
+
except PermissionDenied:administrator = False
|
|
80
|
+
else:administrator = True
|
|
81
|
+
repo = self.backend.open_repository(record.storage_id)
|
|
82
|
+
if repo.object_format.value != record.object_format:raise ValueError("managed storage format mismatch")
|
|
83
|
+
decisions = tuple(self._decide(repo, c, policy.rules, administrator) for c in commands)
|
|
84
|
+
return RefPolicyResult(repository_id, actor, policy.version, decisions)
|
|
85
|
+
|
|
86
|
+
def recheck(self, result: RefPolicyResult, *, now: int) -> RefPolicyResult:
|
|
87
|
+
if not isinstance(result, RefPolicyResult):raise TypeError("select a ref policy result")
|
|
88
|
+
current = self.evaluate(result.actor, result.repository_id, (d.command for d in result.decisions), now=now)
|
|
89
|
+
if current.policy_version != result.policy_version:
|
|
90
|
+
return replace(current, decisions=tuple(replace(d, reason=RefReason.POLICY_CHANGED) for d in current.decisions))
|
|
91
|
+
return current
|
|
92
|
+
|
|
93
|
+
def evaluate_receive(self, actor, record, repo, commands, view, *, expected_version, now):
|
|
94
|
+
"""Recheck an authenticated receive against its quarantined overlay.
|
|
95
|
+
|
|
96
|
+
The hosting publication guard retains the outer catalog transaction;
|
|
97
|
+
coordinated Gitdx calls this again while its ref locks are held.
|
|
98
|
+
"""
|
|
99
|
+
commands = tuple(islice(commands, self.max_commands+1))
|
|
100
|
+
if not commands or len(commands) > self.max_commands: raise ValueError('invalid receive policy batch')
|
|
101
|
+
with self.catalog.transaction():
|
|
102
|
+
actor = TokenAuth(self.catalog).revalidate(actor, now=now)
|
|
103
|
+
current = self.catalog.get_repository(actor, record.id, action=Action.WRITE)
|
|
104
|
+
if current != record or self.catalog.provisioning_state(record.id) != 'ready':
|
|
105
|
+
raise PermissionDenied('repository not found or permission denied')
|
|
106
|
+
policy = self.catalog.branch_policy(actor, record.id)
|
|
107
|
+
try: self.catalog.get_repository(actor, record.id, action=Action.ADMIN)
|
|
108
|
+
except PermissionDenied: administrator = False
|
|
109
|
+
else: administrator = True
|
|
110
|
+
decisions = tuple(self._decide(repo, c, policy.rules, administrator, view=view) for c in commands)
|
|
111
|
+
if policy.version != expected_version:
|
|
112
|
+
decisions = tuple(replace(d, reason=RefReason.POLICY_CHANGED) for d in decisions)
|
|
113
|
+
return RefPolicyResult(record.id, actor, policy.version, decisions)
|
|
114
|
+
|
|
115
|
+
def _decide(self, repo, command, rules, administrator, *, view=None):
|
|
116
|
+
def decision(reason, ff=None):return RefDecision(command, reason, ff, tuple(r.pattern for r in selected))
|
|
117
|
+
selected = ()
|
|
118
|
+
try:
|
|
119
|
+
name = command.name.decode("ascii")
|
|
120
|
+
validate_refname(name)
|
|
121
|
+
if not name.startswith(("refs/heads/", "refs/tags/")):return decision(RefReason.UNSUPPORTED_REF)
|
|
122
|
+
if len(command.name) > 1024:return decision(RefReason.UNSUPPORTED_REF)
|
|
123
|
+
except (ValueError, UnicodeError):return decision(RefReason.UNSUPPORTED_REF)
|
|
124
|
+
selected = tuple(rule for rule in rules if rule.matches(name))
|
|
125
|
+
try:
|
|
126
|
+
actual = repo.refs.read(name)
|
|
127
|
+
if actual is not None and not isinstance(actual, DirectRef):return decision(RefReason.UNSUPPORTED_REF)
|
|
128
|
+
if (actual.oid if actual else None) != command.old:return decision(RefReason.STALE_TIP)
|
|
129
|
+
if any(oid is not None and oid.format != repo.object_format for oid in (command.old, command.new)):
|
|
130
|
+
return decision(RefReason.INVALID_TARGET)
|
|
131
|
+
ff = None
|
|
132
|
+
if command.new is not None:
|
|
133
|
+
raw = view.read(command.new) if view is not None else repo.objects.read(command.new)
|
|
134
|
+
parse_object(raw, repo.object_format)
|
|
135
|
+
if name.startswith("refs/heads/"):
|
|
136
|
+
if raw.kind is not ObjectType.COMMIT:return decision(RefReason.INVALID_TARGET)
|
|
137
|
+
# Graph errors and exhausted limits are refusals, not proof
|
|
138
|
+
# of a non-fast-forward update. All parents are validated.
|
|
139
|
+
ff = (view.is_ancestor(command.old or command.new, command.new) if view is not None else
|
|
140
|
+
repo.is_ancestor(command.old or command.new, command.new, limits=self.ancestry_limits))
|
|
141
|
+
elif command.old is not None:ff = command.old == command.new
|
|
142
|
+
except (GitdxError, OSError):return decision(RefReason.INVALID_TARGET)
|
|
143
|
+
if command.old == command.new:return decision(RefReason.ALLOWED, ff)
|
|
144
|
+
if any(r.minimum_permission is Permission.ADMIN for r in selected) and not administrator:
|
|
145
|
+
return decision(RefReason.ADMIN_REQUIRED, ff)
|
|
146
|
+
if command.old is None and any(not r.allow_create for r in selected):return decision(RefReason.CREATE_DENIED, ff)
|
|
147
|
+
if command.new is None and any(not r.allow_delete for r in selected):return decision(RefReason.DELETE_DENIED, ff)
|
|
148
|
+
if command.old is not None and command.new is not None and not ff and any(not r.allow_force for r in selected):
|
|
149
|
+
return decision(RefReason.FORCE_DENIED, ff)
|
|
150
|
+
if any(r.require_review for r in selected):return decision(RefReason.REVIEW_REQUIRED, ff)
|
|
151
|
+
return decision(RefReason.ALLOWED, ff)
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: gitcx
|
|
3
|
+
Version: 0.1.0a3
|
|
4
|
+
Summary: A Git-compatible hosting platform powered by gitdx
|
|
5
|
+
Author: ellainng
|
|
6
|
+
Author-email: ellainng <299958882+ellainng@users.noreply.github.com>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Requires-Dist: gitdx==0.1.0a2
|
|
10
|
+
Requires-Dist: expose-api==0.2.0 ; extra == 'http'
|
|
11
|
+
Requires-Python: >=3.14
|
|
12
|
+
Project-URL: Repository, https://github.com/wispsy/gitcx
|
|
13
|
+
Project-URL: Issues, https://github.com/wispsy/gitcx/issues
|
|
14
|
+
Provides-Extra: http
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
|
|
17
|
+
# gitcx
|
|
18
|
+
|
|
19
|
+
Developer preview: **0.1.0a3**, paired with published `gitdx==0.1.0a2`.
|
|
20
|
+
The selected scope includes catalog storage, repository provisioning,
|
|
21
|
+
authentication, the management API, bounded read-only smart HTTP and
|
|
22
|
+
SHA-256-only hosted receive on qualified Linux storage.
|
|
23
|
+
Production qualification is unfinished. [Preview notes](docs/releases.md)
|
|
24
|
+
record the supported scope and remaining gates.
|
|
25
|
+
The project was renamed from Gittycat to avoid the existing npm command name.
|
|
26
|
+
Use `pip install "gitcx[http]==0.1.0a3"`, `import gitcx` and the `gitcx` command.
|
|
27
|
+
See [migration instructions](docs/migration.md) for existing installations.
|
|
28
|
+
[Wispsy Releases](https://github.com/orgs/wispsy/projects/31)
|
|
29
|
+
tracks publication separately from current development.
|
|
30
|
+
|
|
31
|
+
A Git-compatible hosting and collaboration platform powered by [gitdx](https://github.com/wispsy/gitdx).
|
|
32
|
+
|
|
33
|
+
Python 3.14+ · MIT
|
|
34
|
+
|
|
35
|
+
Development starts with the [implementation plan](IMPLEMENTATION_PLAN.md) and
|
|
36
|
+
[shared Project](https://github.com/orgs/wispsy/projects/30). The roadmap records
|
|
37
|
+
qualification targets; public deployment remains a later milestone.
|
|
38
|
+
|
|
39
|
+
Source development does not imply a published package or deployed service.
|
|
40
|
+
|
|
41
|
+
The first implementation provides immutable platform records, validated slugs
|
|
42
|
+
and opaque storage IDs, an explicit Git backend protocol and deny-by-default
|
|
43
|
+
repository permissions. [Permission contracts](docs/permissions.md) describe
|
|
44
|
+
anonymous, owner, organization and collaborator behavior. Discovery uses the
|
|
45
|
+
same read policy as repository access.
|
|
46
|
+
|
|
47
|
+
[SQLite catalog storage](docs/catalog.md) now persists identities, ownership,
|
|
48
|
+
repository metadata, permissions, credential metadata and a transactional audit
|
|
49
|
+
outbox.
|
|
50
|
+
|
|
51
|
+
[Managed provisioning](docs/provisioning.md) now connects catalog permissions to
|
|
52
|
+
real Gitdx bare repositories with pending/ready recovery and an immutable backend
|
|
53
|
+
release.
|
|
54
|
+
|
|
55
|
+
[Personal token authentication](docs/authentication.md) provides one-time secret
|
|
56
|
+
delivery, expiring/revocable credentials and read/write/admin scope caps shared
|
|
57
|
+
by discovery and repository services. Account bootstrap and token issuance use
|
|
58
|
+
a trusted local catalog handle. The [optional management API](docs/management-api.md)
|
|
59
|
+
adds authorized JSON routes through Expose API and explicit loopback serving.
|
|
60
|
+
[Read-only smart HTTP](docs/smart-http.md) adds authorized discovery/upload-pack
|
|
61
|
+
through the same Expose API app. [Hosted receive](docs/receive.md) adds scoped,
|
|
62
|
+
policy-checked SHA-256 pushes with quarantined intake, audit receipts and explicit
|
|
63
|
+
interruption recovery. Interactive account login remains later work.
|
|
64
|
+
|
|
65
|
+
This preview also provides [branch protection and ref-change policy](docs/ref-policy.md):
|
|
66
|
+
versioned administrator rules, fresh token/grant checks and expected-old,
|
|
67
|
+
ancestry-based decisions for managed branches and tags. These read-only decisions
|
|
68
|
+
are rechecked under ref locks by the hosted receiver before publication.
|
|
69
|
+
|
|
70
|
+
Run `uv sync --locked` and `uv run python -m unittest discover -s tests -v`.
|
|
71
|
+
The [two-user hosting acceptance](docs/hosting-acceptance.md) runner checks real
|
|
72
|
+
stock-Git workflows, access refusal and restart, retaining a secret-free receipt.
|
|
73
|
+
The [installation profile](docs/installation.md) qualifies independently built
|
|
74
|
+
Gitdx/Gitcx artifacts and rejects backend capability mismatches.
|
|
75
|
+
`uv run python scripts/check_distribution.py` checks wheel/sdist installations
|
|
76
|
+
outside the checkout and startup with Git absent from PATH.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
gitcx/__init__.py,sha256=Hwh5f4-lcjrKPa5BNfy9dagYPNJCH2raECyg6HmAxpA,2058
|
|
2
|
+
gitcx/__main__.py,sha256=k1ocEWawweo1qCJWNFAAvyxz3tcY13dzvCenHszij30,48
|
|
3
|
+
gitcx/authentication.py,sha256=op-wPGF0uoTsIK6VEEpBq4xXEzy6iUsmn61XdE0-R88,6121
|
|
4
|
+
gitcx/backend.py,sha256=KEH45Ia5ETKKSvMa05HFZW-20ITlDjZ6j0HK3x77FCA,1236
|
|
5
|
+
gitcx/branch_policy.py,sha256=rd7-uNGuFitWN6NPTNjsKd3DryLbCuu35y1BTIazu8Y,1733
|
|
6
|
+
gitcx/catalog.py,sha256=ttfHnKNsE_fZFOn5qPfqKJ0PRxvZhxGQbfJ7yl5o4sU,30402
|
|
7
|
+
gitcx/cli.py,sha256=fie1E4ole56WTayNdtW0T5HFKvENiWhMH5QBrP7fdIo,1080
|
|
8
|
+
gitcx/domain.py,sha256=qpwS1e5voWy8KV3SA3EGnYGyRMXzuJRMUDbO0WKekS8,4315
|
|
9
|
+
gitcx/git_http.py,sha256=qKuAt77YMxpkr1MCKT9kcGtn8ZJDbgQ43S0F4iatCFY,12483
|
|
10
|
+
gitcx/management.py,sha256=9RNfZPtd7dsp9B6hLohdhH9668BvVmU8N1gVowQdAps,10953
|
|
11
|
+
gitcx/permissions.py,sha256=oDZwPTV1liRnUlnn3bQQsA6X0RRb8z_xoxVUQRp7IKY,2599
|
|
12
|
+
gitcx/provisioning.py,sha256=p16rxCNvgatQe6geI2vb-hqSIyXS4ra5NKmFPMpiTmc,6222
|
|
13
|
+
gitcx/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
|
+
gitcx/receive.py,sha256=VelVNMfC1MzkF_9mj6NV3xQiL3r_V1G0zYDl4tMslow,8851
|
|
15
|
+
gitcx/ref_policy.py,sha256=kNVoCYjHprBSaWRXN8fWngsZFClq4hh1W155xQ8dKSE,8475
|
|
16
|
+
gitcx-0.1.0a3.dist-info/licenses/LICENSE,sha256=pAeG0B2X4uxLV9iLuLxEEk4YSQamiNrWf4E6P5vch1Q,1069
|
|
17
|
+
gitcx-0.1.0a3.dist-info/WHEEL,sha256=G_-rrEibZr7OEM7zdH1dSO6s-VdjfnS5PA4CLAdI9Vw,80
|
|
18
|
+
gitcx-0.1.0a3.dist-info/entry_points.txt,sha256=oJ1yttrX9VTLU72WfuJgv9ADyEn9aQZH5u2AvP-HmU0,38
|
|
19
|
+
gitcx-0.1.0a3.dist-info/METADATA,sha256=EzMW8w1nsfLH295ptyGUY6qxrskmIImKDsaunHWK6uE,3962
|
|
20
|
+
gitcx-0.1.0a3.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Outside Labs
|
|
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.
|