@@ -20,6 +20,7 @@ wordpress-atmosphere/
2020│ ├── class-api.php # DPoP-authenticated PDS request layer with nonce retry.
2121│ ├── class-autoloader.php # Custom WordPress-style autoloader.
2222│ ├── class-backfill.php # Bulk re-sync of existing posts.
23+ │ ├── class-block-editor.php # Enqueues the block-editor panels (share toggle + pre-publish).
2324│ ├── class-handle.php # Domain-handle setup helper (writes /.well-known/atproto-did).
2425│ ├── class-post-types.php # Supported post-type discovery and option storage.
2526│ ├── class-publisher.php # Atomic applyWrites for both Bluesky post + standard.site document.
@@ -42,6 +43,11 @@ wordpress-atmosphere/
4243│ │ ├── class-nonce-storage.php # DPoP nonce persistence.
4344│ │ └── class-resolver.php # handle → DID → PDS → auth server resolution chain.
4445│ │
46+ │ ├── rest/ # REST API controllers (WP_REST_Controller subclasses).
47+ │ │ ├── class-client-metadata-controller.php # Public OAuth client-metadata endpoint.
48+ │ │ └── admin/ # Authenticated, editor-only controllers.
49+ │ │ └── class-pre-publish-controller.php # Pre-publish projection for the editor panel.
50+ │ │
4551│ ├── transformer/ # WordPress → AT Protocol record transformers.
4652│ │ ├── class-base.php # Abstract base.
4753│ │ ├── class-comment.php # Comment → app.bsky.feed.post (reply).
@@ -51,8 +57,9 @@ wordpress-atmosphere/
5157│ │ ├── class-publication.php # Site → site.standard.publication.
5258│ │ └── class-tid.php # AT Protocol Timestamp ID generation.
5359│ │
54- │ └── wp-admin/ # Admin functionality.
55- │ └── class-admin.php # Settings page, sidebar panel, REST handlers.
60+ │ └── wp-admin/ # Admin screens.
61+ │ ├── class-admin.php # Settings page, OAuth callback, menu wiring.
62+ │ └── class-settings-fields.php # Settings API field rendering.
5663│
5764├── integrations/ # Third-party plugin integrations.
5865│ └── class-load.php # Integration loader stub.
@@ -162,6 +169,8 @@ namespace Atmosphere\OAuth;
162169namespace Atmosphere\Transformer;
163170namespace Atmosphere\Content_Parser;
164171namespace Atmosphere\Integrations;
172+ namespace Atmosphere\Rest; // Public REST controllers.
173+ namespace Atmosphere\Rest\Admin; // Authenticated, editor-only REST controllers.
165174namespace Atmosphere\WP_Admin;
166175namespace Atmosphere\Tests;
167176```
@@ -212,7 +221,9 @@ class Publisher {
212221| AT Protocol record transformers | ` includes/transformer/ ` | ` Atmosphere\Transformer ` |
213222| OAuth flow components | ` includes/oauth/ ` | ` Atmosphere\OAuth ` |
214223| Content parsers (NSID-typed ` content ` producers) | ` includes/content-parser/ ` | ` Atmosphere\Content_Parser ` |
215- | Admin screens / REST handlers | ` includes/wp-admin/ ` | ` Atmosphere\WP_Admin ` |
224+ | Public REST controllers (` WP_REST_Controller ` ) | ` includes/rest/ ` | ` Atmosphere\Rest ` |
225+ | Authenticated/editor-only REST controllers | ` includes/rest/admin/ ` | ` Atmosphere\Rest\Admin ` |
226+ | Admin screens | ` includes/wp-admin/ ` | ` Atmosphere\WP_Admin ` |
216227| Third-party plugin integrations | ` integrations/ ` | ` Atmosphere\Integrations ` |
217228
218229### Creating a New Subdirectory
@@ -227,6 +238,24 @@ After adding or renaming a class file under the `Atmosphere` namespace, no Compo
227238
228239## Architectural Patterns
229240
241+ ### REST Controllers
242+
243+ Every REST endpoint is a ` WP_REST_Controller ` subclass under ` includes/rest/ `
244+ (public) or ` includes/rest/admin/ ` (authenticated / editor-only), mirroring
245+ the wordpress-activitypub plugin's layout. Each controller declares its route
246+ via ` register_routes() ` ; they are all instantiated together in
247+ ` Atmosphere::register_rest_controllers() ` on ` rest_api_init ` .
248+
249+ Route namespaces are versioned deliberately:
250+
251+ - ** ` atmosphere/v1 ` ** — the public OAuth ` client-metadata ` endpoint. Its URL is
252+ the OAuth ` client_id ` , an external contract, so the version string is frozen
253+ and must not change.
254+ - ** ` atmosphere/1.0 ` ** — admin/editor routes (e.g. the pre-publish preview).
255+
256+ New admin routes should use ` atmosphere/1.0 ` , set ` show_in_index => false ` , and
257+ gate access with a ` permission_callback ` .
258+
230259### Transformer Pattern
231260
232261The transformer pattern (` includes/transformer/ ` ) is the canonical way to add a new AT Protocol record type:
0 commit comments