Admin: delegate /.well-known/atproto-did to Atmosphere#170
Open
kraftbj wants to merge 2 commits into
Open
Conversation
FOSSE's own handler kept silently drifting from Atmosphere's identity contract — the original `is_connected()` gate 404'd during reauth, and PR 166 was the second time the mirrored gate needed to chase upstream. Atmosphere's bundled handler already gates on `has_identity()`, validates the DID, and emits the same `text/plain` body, so there's no FOSSE-shaped behavior worth maintaining a parallel implementation for. Delete FOSSE's `serve_atproto_did_well_known()` and the `init` priority-1 hook. Keep the `template_redirect` priority-1 suppression hook so the existing `fosse_serve_atproto_did_well_known` filter still means "neither plugin responds": when the filter returns false, clear Atmosphere's query var and force a 404. Fixes #169
Contributor
There was a problem hiding this comment.
Pull request overview
Delegates the /.well-known/atproto-did endpoint fully to the bundled Atmosphere plugin to avoid FOSSE maintaining a parallel handler that can drift from Atmosphere’s identity contract, while preserving FOSSE’s existing opt-out behavior via the fosse_serve_atproto_did_well_known filter.
Changes:
- Removed FOSSE’s
init-hooked/.well-known/atproto-didhandler and its associated response helper logic. - Kept (and documented) the
template_redirectpriority-1 suppression hook so filteringfosse_serve_atproto_did_well_knowntofalsestill results in neither plugin serving the route. - Dropped now-dead PHPUnit coverage for FOSSE’s former response helper and updated SDD implementation notes to record the delegation decision.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/Admin/class-bluesky-provider.php |
Removes the duplicate well-known handler and positions FOSSE as opt-out-only via the existing suppression hook. |
tests/php/Admin/Bluesky_ProviderTest.php |
Removes tests tied to the deleted response helper and updates hook-registration assertions accordingly. |
sdd/bluesky-handle-setup/implementation-notes.md |
Documents that Atmosphere now owns the well-known route and records the rationale for delegation. |
Comments suppressed due to low confidence (1)
tests/php/Admin/Bluesky_ProviderTest.php:857
- With FOSSE delegating
/.well-known/atproto-didto Atmosphere, the PHPUnit coverage for the actual well-known response behavior (200 vs 404, body shape, malformed DID handling) was removed. Consider adding an integration/E2E-level test that exercises the real HTTP endpoint (or otherwise validates Atmosphere’s handler contract) so future Atmosphere syncs can’t silently change the public response shape without a failing test.
/**
* The suppression hook is a no-op for unrelated atmosphere_wellknown query vars.
*/
public function test_maybe_suppress_atmosphere_well_known_no_op_for_other_query_vars() {
global $wp_query;
Comment on lines
+49
to
+51
| ### Well-known route delegated to Atmosphere (issue #169) | ||
| - **Decision**: FOSSE no longer serves `/.well-known/atproto-did` itself. Atmosphere's `serve_wellknown_atproto_did()` owns the route end-to-end; FOSSE only retains a `template_redirect` priority-1 suppression hook that fires when the `fosse_serve_atproto_did_well_known` filter returns false (clearing Atmosphere's query var and forcing a 404 so the opt-out contract still means "neither plugin responds"). | ||
| - **Reason**: The duplicated handler kept silently drifting from Atmosphere's identity contract (the original `is_connected()` gate broke domain-handle reconnect; PR 166 fixed it by mirroring `has_identity()`). Atmosphere's bundled handler already gates on `has_identity()`, validates the DID via `get_did()`, and emits the same `text/plain` body — there's no FOSSE-specific shape worth maintaining a parallel implementation for. See issue #169. |
…otes Adds a regression test that asserts Atmosphere's bundled `serve_wellknown_atproto_did` stays hooked on `template_redirect` at a priority greater than 1. Direct-call suppression tests can't catch the case where a future bundled resync moves the handler to priority 0 or 1 (or removes it), which would silently break the `fosse_serve_atproto_did_well_known` opt-out — the tripwire fails at the registration layer instead. Also refreshes the SDD docs that PR 170 left stale: - Status Snapshot and the "default-on with opt-out filter" decision in implementation-notes.md still described FOSSE-as-server. - The "delegated to Atmosphere" decision overstated upstream's validation; reworded to make clear that `esc_html(get_did())` is not syntax validation and that correctness now rides on Atmosphere persisting well-formed DIDs. - plan.md Task 1 is marked superseded (matching the Task 2/2.5/5 convention) so the historical Do steps don't read as current.
This was referenced May 21, 2026
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.
Summary
/.well-known/atproto-didhandler has been a mirror of Atmosphere's identity contract since the start, and it has now broken twice — once on the originalis_connected()gate (404'd during reauth) and again on the follow-up in PR 166. Atmosphere's bundled handler already gates onhas_identity(), validates the DID viaget_did(), and returns the sametext/plainbody, so there's no FOSSE-specific behavior worth maintaining a parallel implementation for.serve_atproto_did_well_known()and theinitpriority-1 registration inBluesky_Provider. Atmosphere now owns the route end-to-end attemplate_redirectpriority 10.template_redirectpriority-1 suppression hook so the existingfosse_serve_atproto_did_well_knownfilter still means "neither plugin responds": when it returns false, the hook clears Atmosphere'satmosphere_wellknownquery var and forces a 404.sdd/bluesky-handle-setup/implementation-notes.mdto record the delegation decision.Fixes #169.
Behavior change
No user-facing behavior change for the default-on case. Atmosphere's handler already gates on
has_identity(), which is the contract PR 166 made FOSSE adopt; the response shape (200 + DID body, 404 otherwise) is identical. Sites that filterfosse_serve_atproto_did_well_knowntofalsecontinue to get a 404 from neither plugin.Test Plan
./vendor/bin/phpunit --colors=always --do-not-cache-result tests/php/Admin/Bluesky_ProviderTest.php(96 passing)composer run-script lint-php -- src/Admin/class-bluesky-provider.php tests/php/Admin/Bluesky_ProviderTest.php