How esn-hungary/esnscope works
ESNscope is a Cloudflare Worker OAuth exploration client. A browser reaches the Worker’s home/login pages, starts a PKCE authorization request to ESNaccount, returns to the callback, exchanges the code and fetches userinfo, then views profile, roles, and token metadata. The graph separates request routing, OAuth orchestration, provider communication, and presentation. Source excerpts support the shown calls; external-provider interactions are visible in the ESNaccount client, while broader configuration details are documented in the README.
Main entry points: oauth.ts OAuth orchestration · esnaccount.ts Provider client · html.ts Page rendering · index.ts HTTP router
Components 10
Worker routing
- HTTP router
src/index.ts
OAuth flow
- OAuth orchestration
src/oauth.ts - OAuth configuration
src/config.ts - OAuth data types
src/types.ts
ESNaccount API
- Provider client
src/esnaccount.ts
Profile explorer
- Page rendering
src/html.ts - Role extraction
src/roles.ts - Page styles
src/styles.ts
Other components
- Browser
- ESNaccount
Connections 11
- Browser → HTTP router: sends requests
README.md - HTTP router → Page rendering: renders pages
src/index.ts - HTTP router → OAuth orchestration: dispatches OAuth
src/index.ts - OAuth orchestration → OAuth configuration: reads settings
src/oauth.ts - OAuth orchestration → Provider client: requests tokens and profile
src/oauth.ts - OAuth orchestration → Page rendering: renders callback result
src/oauth.ts - Provider client → ESNaccount: calls authorization endpoint
README.md - Provider client → ESNaccount: posts code exchange
src/esnaccount.ts - Provider client → ESNaccount: gets userinfo
src/esnaccount.ts - Page rendering → Role extraction: extracts roles
src/html.ts - Page rendering → Page styles: embeds styles
src/html.ts