diff --git a/src/v1/cloud-functions.ts b/src/v1/cloud-functions.ts index d66539fb7..0a86853f9 100644 --- a/src/v1/cloud-functions.ts +++ b/src/v1/cloud-functions.ts @@ -104,8 +104,8 @@ export interface EventContext> { * does not exist. */ auth?: { - token: object; uid: string; + token: EventContextAuthToken; }; /** @@ -207,6 +207,29 @@ export interface EventContext> { timestamp: string; } +/** + * https://firebase.google.com/docs/reference/security/database#authtoken + */ +export interface EventContextAuthToken { + iss: string; + aud: string; + auth_time: number; + iat: number; + exp: number; + sub: string; + email?: string; + email_verified?: boolean; + phone_number?: string; + name?: string; + firebase?: { + identities?: { + [key: string]: string[]; + }; + sign_in_provider?: string; + tenant?: string; + }; +} + /** * Resource is a standard format for defining a resource * (google.rpc.context.AttributeContext.Resource). In Cloud Functions, it is the