@@ -502,8 +502,8 @@ export interface ExecutionContext<Props = unknown> {
502502 readonly key ?: string ;
503503 readonly override ?: string ;
504504 } ;
505- abort ( reason ?: any ) : void ;
506505 readonly access ?: CloudflareAccessContext ;
506+ abort ( reason ?: any ) : void ;
507507}
508508export type ExportedHandlerFetchHandler <
509509 Env = unknown ,
@@ -4693,8 +4693,48 @@ export interface EventCounts {
46934693/**
46944694 * Represents the identity of a user authenticated via Cloudflare Access.
46954695 * This matches the result of calling /cdn-cgi/access/get-identity.
4696- */
4697- export type CloudflareAccessIdentity = object ;
4696+ *
4697+ * The exact structure of the returned object depends on the identity provider
4698+ * configuration for the Access application. The fields below represent commonly
4699+ * available properties, but additional provider-specific fields may be present.
4700+ */
4701+ export interface CloudflareAccessIdentity extends Record < string , unknown > {
4702+ /** The user's email address, if available from the identity provider. */
4703+ email ?: string ;
4704+ /** The user's display name. */
4705+ name ?: string ;
4706+ /** The user's unique identifier. */
4707+ user_uuid ?: string ;
4708+ /** The Cloudflare account ID. */
4709+ account_id ?: string ;
4710+ /** Login timestamp (Unix epoch seconds). */
4711+ iat ?: number ;
4712+ /** The user's IP address at authentication time. */
4713+ ip ?: string ;
4714+ /** Authentication methods used (e.g., "pwd"). */
4715+ amr ?: string [ ] ;
4716+ /** Identity provider information. */
4717+ idp ?: {
4718+ id : string ;
4719+ type : string ;
4720+ } ;
4721+ /** Geographic information about where the user authenticated. */
4722+ geo ?: {
4723+ country : string ;
4724+ } ;
4725+ /** Group memberships from the identity provider. */
4726+ groups ?: Array < {
4727+ id : string ;
4728+ name : string ;
4729+ email ?: string ;
4730+ } > ;
4731+ /** Device posture check results, keyed by check ID. */
4732+ devicePosture ?: Record < string , unknown > ;
4733+ /** True if the user connected via Cloudflare WARP. */
4734+ is_warp ?: boolean ;
4735+ /** True if the user is authenticated via Cloudflare Gateway. */
4736+ is_gateway ?: boolean ;
4737+ }
46984738/**
46994739 * Cloudflare Access authentication information for the current request.
47004740 */
@@ -4706,8 +4746,11 @@ export interface CloudflareAccessContext {
47064746 readonly aud : string ;
47074747 /**
47084748 * Fetches the full identity information for the authenticated user.
4749+ * This makes a call to the Access identity service to retrieve extended
4750+ * user information such as groups, device posture, and identity provider data.
47094751 *
47104752 * @returns The subject's identity, if one exists
4753+ * @throws May throw if the identity service is unreachable or returns an error.
47114754 */
47124755 getIdentity ( ) : Promise < CloudflareAccessIdentity | undefined > ;
47134756}
0 commit comments