@@ -224,22 +224,22 @@ Authenticated endpoints for managing photos. All admin endpoints use shared util
224224 - Pattern: All admin endpoints use discriminated unions for validation results
225225
226226- ** Upload** (` POST /admin/api/images ` ):
227- - Validates via Cloudflare Access (service tokens or IdP users )
227+ - Validates via Cloudflare Access (service tokens)
228228 - Authorizes client ID against user's ` authorized_client_ids ` in KV
229229 - Uploads photo to Cloudflare Images
230230 - Inserts metadata to D1
231231 - Returns ` { success: true, id: string, filename: string, uploaded: string } `
232232
233233- ** Lookup** (` GET /admin/api/images/by-name/[photoName] ` ):
234- - Validates via Cloudflare Access (service tokens or IdP users )
234+ - Validates via Cloudflare Access (service tokens)
235235 - Authorizes client ID against user's ` authorized_client_ids ` in KV
236236 - Searches for photo by name (case-insensitive)
237237 - Returns most recent photo if multiple matches exist
238238 - Returns ` { success: true, id: string, name: string, captured: string, uploaded: string } `
239239 - Use case: Enables automation tools (like Apple Shortcuts) to find image ID by photo name
240240
241241- ** Delete** (` DELETE /admin/api/images/[imageId] ` ):
242- - Validates via Cloudflare Access (service tokens or IdP users )
242+ - Validates via Cloudflare Access (service tokens)
243243 - Authorizes client ID against user's ` authorized_client_ids ` in KV
244244 - Verifies ownership (prevents cross-user deletion)
245245 - Deletes metadata from D1
@@ -277,7 +277,7 @@ All `/admin/*` routes use centralized authentication via SvelteKit hooks:
2772777 . Sets ` event.locals.adminAuth ` with authenticated context
2782788 . Request proceeds to handler with authenticated user info
279279
280- ### Supported Authentication Types
280+ ### Supported Authentication Type
281281
282282** Service Tokens** (Machine-to-machine):
283283
@@ -290,17 +290,6 @@ Headers:
290290- Used for automated uploads from scripts/applications
291291- Client ID validated against ` authorized_client_ids ` in KV
292292
293- ** IdP Users** (Browser-based):
294-
295- ```
296- Headers:
297- CF-Access-Jwt-Assertion: eyJhbGc...
298- ```
299-
300- - Authenticated via identity providers (Google, GitHub, etc.)
301- - Email address extracted from JWT
302- - Email can be added to ` authorized_client_ids ` for authorization
303-
304293### Local Development Bypass
305294
306295Development uses authentication bypass that ** only** activates when ` CF_ACCESS_TEAM_DOMAIN=dev ` :
@@ -339,9 +328,8 @@ export const POST: RequestHandler = async ({ locals }) => {
339328 }
340329
341330 const { username, identity } = locals .adminAuth ;
342- // identity.type: 'service_token' | 'idp_user'
331+ // identity.type: 'service_token'
343332 // identity.clientId: string
344- // identity.email?: string (for IdP users)
345333
346334 // Your handler logic here...
347335};
@@ -376,7 +364,6 @@ const event = {
3763643 . ** Test with real service tokens** - Use ` pnpm preview ` for realistic testing
3773654 . ** Never commit secrets** - Keep ` .dev.vars ` gitignored
3783665 . ** Update authorized_client_ids** - Add client IDs to KV config for authorization
379- 6 . ** Use appropriate auth type** - Service tokens for automation, IdP for browsers
380367
381368### Domain-Based Routing
382369
0 commit comments