···425425426426### Documenting Scope Requirements
427427428428-Use the `#[ScopedEndpoint]` attribute to document which OAuth scopes your extension methods require. This helps with documentation and enables scope checking in authenticated mode:
428428+Use the `#[ScopedEndpoint]` and `#[PublicEndpoint]` attributes to document the authentication requirements of your extension methods:
429429430430```php
431431+use SocialDept\AtpClient\Attributes\PublicEndpoint;
431432use SocialDept\AtpClient\Attributes\ScopedEndpoint;
432433use SocialDept\AtpClient\Client\Requests\Request;
433434use SocialDept\AtpClient\Enums\Scope;
···441442 // Process and return metrics...
442443 }
443444444444- // Methods without #[ScopedEndpoint] work in both public and authenticated modes
445445+ #[PublicEndpoint]
445446 public function getPublicPostMetrics(string $uri): array
446447 {
447448 $thread = $this->atp->bsky->feed->getPostThread($uri);
···450451}
451452```
452453453453-Methods with `#[ScopedEndpoint]` indicate they require authentication, while methods without it can work in public mode. See [scopes.md](scopes.md) for full documentation on scope handling.
454454+> **Note:** These attributes currently serve as documentation only. Runtime scope enforcement will be implemented in a future release. Using them correctly now ensures forward compatibility.
455455+456456+Methods with `#[ScopedEndpoint]` indicate they require authentication, while methods with `#[PublicEndpoint]` work without authentication. See [scopes.md](scopes.md) for full documentation on scope handling.
454457455458## Available Domains
456459
+20-12
docs/scopes.md
···11# OAuth Scopes
2233-The AT Protocol uses OAuth scopes to control what actions an application can perform on behalf of a user. AtpClient provides tools for documenting, checking, and enforcing scope requirements.
33+The AT Protocol uses OAuth scopes to control what actions an application can perform on behalf of a user. AtpClient provides attributes for documenting scope requirements on endpoints.
44+55+> **Note:** The `#[ScopedEndpoint]` and `#[PublicEndpoint]` attributes currently serve as documentation only. Runtime scope validation and enforcement will be implemented in a future release. Using these attributes correctly now ensures forward compatibility.
4657## Quick Reference
68···75777678## The ScopedEndpoint Attribute
77797878-The `#[ScopedEndpoint]` attribute documents and optionally enforces scope requirements on methods.
8080+The `#[ScopedEndpoint]` attribute documents scope requirements on methods that require authentication.
79818082### Basic Usage
8183···154156}
155157```
156158157157-## Scope Enforcement
159159+## Scope Enforcement (Planned)
160160+161161+> **Coming Soon:** Runtime scope enforcement is not yet implemented. The following documentation describes planned functionality for a future release.
158162159163### Configuration
160164···220224$checker->matchesGranular($session, 'repo:*');
221225```
222226223223-## Route Middleware
227227+## Route Middleware (Planned)
228228+229229+> **Coming Soon:** Route middleware is not yet implemented. The following documentation describes planned functionality for a future release.
224230225231Protect Laravel routes based on ATP session scopes:
226232···286292287293## Public Mode and Scopes
288294289289-When using `Atp::public()`, no scope checking occurs because there's no authenticated session:
295295+Methods marked with `#[PublicEndpoint]` can be called without authentication using `Atp::public()`:
290296291297```php
292292-// Public mode - no authentication, no scopes
298298+// Public mode - no authentication required
293299$client = Atp::public('https://public.api.bsky.app');
294294-$client->bsky->actor->getProfile('someone.bsky.social'); // Works without scopes
300300+$client->bsky->actor->getProfile('someone.bsky.social'); // Works without auth
295301296296-// Authenticated mode - scopes are checked
302302+// Authenticated mode - for endpoints requiring scopes
297303$client = Atp::as($did);
298304$client->bsky->feed->getTimeline(); // Requires transition:generic scope
299305```
300306301301-Methods that work in public mode typically don't have `#[ScopedEndpoint]` attributes, while authenticated-only methods do.
307307+Methods with `#[PublicEndpoint]` work in both modes, while methods with `#[ScopedEndpoint]` require authentication.
302308303303-## Exception Handling
309309+## Exception Handling (Planned)
310310+311311+> **Coming Soon:** These exceptions will be thrown when scope enforcement is implemented in a future release.
304312305313### MissingScopeException
306314307307-Thrown when required scopes are missing and enforcement is strict:
315315+Will be thrown when required scopes are missing and enforcement is strict:
308316309317```php
310318use SocialDept\AtpClient\Exceptions\MissingScopeException;
···321329322330### ScopeAuthorizationException
323331324324-Thrown by middleware when route access is denied:
332332+Will be thrown by middleware when route access is denied:
325333326334```php
327335use SocialDept\AtpClient\Exceptions\ScopeAuthorizationException;