Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .agents/agents/dpop-reviewer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: dpop-reviewer
description: Read-only security review of an oauth-dpop-server diff against RFC 9449 and OAuth 2.1. Use after changing dpop/, authserver/, ninja_dpop/, token issuance, key handling, or nonce logic.
tools: Read, Grep, Glob, Bash
model: sonnet
---

You review; you never edit. Read the diff (`git diff`) and the touched files, then check:

1. **Proof validation** — `typ` is `dpop+jwt`, algorithm allow-list, `jwk` has no private part, `htm`/`htu` match the request exactly, `iat` window, `jti` replay cache, `ath` for resource requests.
2. **Binding** — access tokens carry `cnf.jkt`; refresh tokens for public clients are bound; a mismatch is rejected, never downgraded to Bearer.
3. **Nonces** — server nonce issued and checked as specified; `use_dpop_nonce` retried correctly.
4. **OAuth 2.1** — PKCE required, exact redirect-URI match, no implicit or password grant, refresh rotation with reuse detection.
5. **Secrets** — nothing sensitive in logs or error bodies; keys never leave the key-rotation code.
6. **Tests** — every security change has a test that fails without it.

Report findings as `file:line — problem — how it could be exploited`, most severe first. Nothing found: say "No security issues", and name what you checked.
17 changes: 17 additions & 0 deletions .agents/agents/verifier.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: verifier
description: Runs oauth-dpop-server's quality gates and reports only what fails. Use after any code change, before opening a PR, or when asked if the build is green.
tools: Bash, Read
model: haiku
---

You run the quality gates and report. You never edit source files.

The gates, in order (keep going after a failure):
1. `make lint`
2. `make typecheck`
3. `make test`
4. If `uv.lock` changed: `make requirements` then `git diff --exit-code requirements.txt`.

`make interop` is slow and needs Dart and Redis: run it only when asked, or when `dpop/` or `interop/` changed. Source of truth: `Makefile` and `.github/workflows/ci.yml`.
Report one line of gates (✓/✗ each), then each failure once with file and shortest message. No stack traces, no passing output. All green: "All gates pass" with test counts.
1 change: 1 addition & 0 deletions .claude/agents
5 changes: 0 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ name: CI
on:
pull_request:
branches: [main]
push:
branches: [main]
schedule:
# Weekly, so a dependency that turns vulnerable is caught without a push.
- cron: "17 5 * * 1"

concurrency:
group: ci-${{ github.ref }}
Expand Down
23 changes: 23 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# AGENTS.md — oauth-dpop-server

Canonical instructions for any AI agent or human working in this repo.
`CLAUDE.md` is a pointer only; new rules go **here**.

A small OAuth 2.1 authorization server whose every access token is sender-constrained with DPoP
([RFC 9449](https://www.rfc-editor.org/rfc/rfc9449)). Packages: `authserver/`, `dpop/`, `ninja_dpop/`, `demo_api/`, `interop/`.
Read `README.md`, `CONTRIBUTING.md` and `SECURITY.md` first.

## Commands (`make help` lists all)

- `make check` — lint, mypy strict, tests (SQLite + fakeredis, no services needed): what CI runs.
- `make test-postgres` — the suite against Postgres at `$DATABASE_URL`.
- `make interop` — the Dart `dpop_client` against a live server (needs Dart, Redis, `../dpop_client`).
- `make requirements` — regenerate `requirements.txt` from `uv.lock`; CI's `lockfile` job fails if you forget.

## Rules

- Follow the RFC to the letter: proof validation, `htm`/`htu`/`iat`/`jti`/`ath`, server nonces, `cnf.jkt` binding. A shortcut here is a security bug.
- A token without a valid proof from the bound key must be rejected, always.
- Never log tokens, proofs, or private keys. Signing keys rotate `pending -> active -> retired` (`make keys`).
- Security-relevant changes get a test that fails without the fix.
- CI workflows are reusable ones from `CtrlAltDevelop/ci-workflows`; change checks there, not here.
22 changes: 21 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,25 @@ uses [Semantic Versioning](https://semver.org/).

## [Unreleased]

## [0.3.0] - 2026-11-26

### Added

- Resource indicators (RFC 8707). The `resource` parameter on authorization,
pushed authorization and token requests selects a token's `aud` from the
new `OAUTH_RESOURCES` setting; the default audience stays valid. A request
for anything unregistered, or outside what the grant covered, is refused
with `invalid_target`. Refreshing stays within the original grant.
- Clients carry a `resources` allow-list (`manage.py create_client
--resource`, or the admin); the default audience needs no entry. The consent
page names the resources a request asks for.

### Changed

- Dependencies updated to their latest releases.
- Migration `0002_resource_indicators` adds `resources` to authorization codes
and token families.

## [0.2.0] - 2026-10-15

### Added
Expand Down Expand Up @@ -61,6 +80,7 @@ The first release.
- A Docker image, a Compose stack, and CI through the shared
`ci-workflows`.

[Unreleased]: https://github.com/CtrlAltDevelop/oauth-dpop-server/compare/v0.2.0...HEAD
[Unreleased]: https://github.com/CtrlAltDevelop/oauth-dpop-server/compare/v0.3.0...HEAD
[0.3.0]: https://github.com/CtrlAltDevelop/oauth-dpop-server/compare/v0.2.0...v0.3.0
[0.2.0]: https://github.com/CtrlAltDevelop/oauth-dpop-server/compare/v0.1.0...v0.2.0
[0.1.0]: https://github.com/CtrlAltDevelop/oauth-dpop-server/releases/tag/v0.1.0
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
See [AGENTS.md](./AGENTS.md).
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# syntax=docker/dockerfile:1
FROM python:3.14-slim AS build
FROM python:3.15-slim AS build

COPY --from=ghcr.io/astral-sh/uv:0.12 /uv /usr/local/bin/uv
ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy UV_PROJECT_ENVIRONMENT=/opt/venv
WORKDIR /app
COPY pyproject.toml uv.lock ./
RUN uv sync --frozen --no-dev --no-install-project

FROM python:3.14-slim
FROM python:3.15-slim

ENV PATH="/opt/venv/bin:$PATH" PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1
RUN useradd --system --uid 10001 --create-home --home-dir /app app
Expand Down
Loading
Loading