-
Architecture
Trust boundary:
External Git client → Caddy → Sztab (auth) → Sztabina
Caddy configuration:
git.sztab.company.com forward_auth sztab:8080 uri /api/auth/validate-git-request copy_headers Authorization reverse_proxy sztabina:8085
Key properties:
- Caddy blocks unauthorized requests
- Sztabina never sees authentication failures
- Git protocol semantics remain unchanged
Authentication Contract
Validation endpoint implemented in Sztab:
/api/auth/validate-git-request
Requirements:
- Stateless
- Low latency
- Safe for repeated calls per Git operation
- No redirects, cookies, or HTML
Expected behavior:
- HTTP 200 → request allowed
- HTTP 401 / 403 → request denied
This endpoint acts as a gatekeeper, not a login flow.
Implementation Tasks
- Define Personal Access Token (PAT) model and validation rules
- Implement /api/auth/validate-git-request endpoint in Sztab
- Integrate Caddy forward_auth with Sztab
- Add external Git domain and TLS configuration
- Verify correct behavior for:
- git clone
- git fetch
- git push
- Ensure clean failure modes (401/403)
- Add minimal logging for auth failures
Testing
- Requests without PAT are rejected
- Requests with invalid or expired PAT are rejected
- Requests with valid PAT succeed
- Internal authless access continues to work
- No authentication logic exists in Sztabina
- Git operations behave correctly under repeated auth checks
Risks
- Auth endpoint latency affecting Git operations
- Misconfigured headers breaking Git HTTP semantics
Mitigation:
- Keep auth endpoint minimal and stateless
- Load-test with repeated Git operations
- Add explicit logging at the proxy and auth boundary
Acceptance Criteria
- External Git access requires a valid PAT
- Invalid or missing PAT always results in 401/403
- Internal Git access remains auth-free
- No authentication code exists in Sztabina
- Design is documented and reproducible
-
| Type |
New Feature
|
| Priority |
Major
|
| Assignee | |
| Version |
1.10
|
| Sprints |
n/a
|
| Customer |
n/a
|
Issue Votes (0)
Summary
Implement Phase 2 security policy for the Sztabina embedded Git server: external Git access protected by Personal Access Tokens (PATs).
Authentication is enforced strictly at the reverse-proxy boundary. Sztabina itself remains completely authentication-free.
Background
Phase 1 establishes Sztabina as an internal, trusted Git server with no authentication.
Phase 2 extends this design to support external Git access while preserving the same architectural principle:
This mirrors OneDev-like workflows while improving separation of concerns.
Scope
In Scope
Out of Scope