Separate auth server and resource server hostname#58
Merged
DavidBuchanan314 merged 6 commits intomainfrom Oct 5, 2025
Merged
Conversation
Adds support for configuring a separate hostname for the OAuth authorization server, distinct from the PDS resource server hostname. - Add auth_pfx column to config table (db schema v3->v4) - Add migration script to populate auth_pfx from pds_pfx for existing DBs - Update init command with --auth_host option - Update config command with --auth_pfx option - Document nginx setup for separate auth hostname
Owner
Author
|
Hm, the challenge here is how to do hostname-based routing in aiohttp. |
Fix AnnotatedRouteTableDef to correctly set _is_as_route attribute on handler functions after decoration. The previous implementation was setting the attribute on the decorator function itself rather than on the returned handler. Add comprehensive test suite for split AS/RS configuration that verifies: - OAuth AS endpoints only accessible via auth hostname - OAuth RS endpoints only accessible via PDS hostname - XRPC endpoints only accessible via PDS hostname - Session management works correctly with split configuration All 78 tests passing.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for separating the OAuth authorization server hostname from the PDS resource server hostname, allowing the authorization endpoints to be served on a different domain while maintaining proper endpoint routing.
- Updated database schema to include separate
auth_pfxconfiguration field - Added middleware-based routing to enforce endpoint separation based on hostname
- Updated CLI to support configuring separate auth hostname during initialization
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/test_split_as_rs.py | Comprehensive test suite for split AS/RS hostname functionality |
| tests/test_database.py | Updated existing tests to include auth_pfx in config |
| tests/conftest.py | Updated test fixture to include auth_pfx configuration |
| src/millipds/util.py | Added hostname extraction utility function |
| src/millipds/static_config.py | Bumped database schema version to 4 |
| src/millipds/service.py | Added middleware for hostname-based routing enforcement |
| src/millipds/database.py | Extended database schema and config to support auth_pfx |
| src/millipds/auth_oauth.py | Split OAuth routes and updated metadata endpoints |
| src/millipds/main.py | Added CLI support for separate auth hostname configuration |
| migration_scripts/v4.py | Database migration script for schema v3 to v4 |
| docs/DEPLOY.md | Updated nginx configuration documentation for split hostnames |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds support for configuring a separate hostname for the OAuth authorization server, distinct from the PDS resource server hostname.