firebase-admin-edge 1.0.18 → 1.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/README.md +26 -0
  2. package/dist/auth/auth-endpoint-errors.d.ts +15 -0
  3. package/dist/auth/auth-endpoint-errors.d.ts.map +1 -0
  4. package/dist/auth/auth-endpoint-errors.js +120 -0
  5. package/dist/auth/auth-endpoint-errors.js.map +1 -0
  6. package/dist/auth/auth-error-codes.d.ts +777 -0
  7. package/dist/auth/auth-error-codes.d.ts.map +1 -0
  8. package/dist/auth/auth-error-codes.js +823 -0
  9. package/dist/auth/auth-error-codes.js.map +1 -0
  10. package/dist/auth/errors.d.ts +20 -0
  11. package/dist/auth/errors.d.ts.map +1 -0
  12. package/dist/auth/errors.js +29 -0
  13. package/dist/auth/errors.js.map +1 -0
  14. package/dist/auth/firebase-admin-auth.d.ts +12 -21
  15. package/dist/auth/firebase-admin-auth.d.ts.map +1 -1
  16. package/dist/auth/firebase-admin-auth.js +54 -16
  17. package/dist/auth/firebase-admin-auth.js.map +1 -1
  18. package/dist/auth/firebase-admin-auth.test.js +36 -24
  19. package/dist/auth/firebase-admin-auth.test.js.map +1 -1
  20. package/dist/auth/firebase-auth-endpoints.d.ts +13 -77
  21. package/dist/auth/firebase-auth-endpoints.d.ts.map +1 -1
  22. package/dist/auth/firebase-auth-endpoints.js +53 -37
  23. package/dist/auth/firebase-auth-endpoints.js.map +1 -1
  24. package/dist/auth/firebase-auth-endpoints.test.js +178 -13
  25. package/dist/auth/firebase-auth-endpoints.test.js.map +1 -1
  26. package/dist/auth/firebase-auth.d.ts +5 -9
  27. package/dist/auth/firebase-auth.d.ts.map +1 -1
  28. package/dist/auth/firebase-auth.js +61 -21
  29. package/dist/auth/firebase-auth.js.map +1 -1
  30. package/dist/auth/firebase-auth.test.js +29 -12
  31. package/dist/auth/firebase-auth.test.js.map +1 -1
  32. package/dist/auth/firebase-jwt.d.ts +5 -29
  33. package/dist/auth/firebase-jwt.d.ts.map +1 -1
  34. package/dist/auth/firebase-jwt.js +74 -33
  35. package/dist/auth/firebase-jwt.js.map +1 -1
  36. package/dist/auth/firebase-jwt.test.js +31 -11
  37. package/dist/auth/firebase-jwt.test.js.map +1 -1
  38. package/dist/auth/github-oauth.d.ts +5 -2
  39. package/dist/auth/github-oauth.d.ts.map +1 -1
  40. package/dist/auth/github-oauth.js +126 -13
  41. package/dist/auth/github-oauth.js.map +1 -1
  42. package/dist/auth/github-oauth.test.d.ts +2 -0
  43. package/dist/auth/github-oauth.test.d.ts.map +1 -0
  44. package/dist/auth/github-oauth.test.js +202 -0
  45. package/dist/auth/github-oauth.test.js.map +1 -0
  46. package/dist/auth/google-oauth.d.ts +3 -3
  47. package/dist/auth/google-oauth.d.ts.map +1 -1
  48. package/dist/auth/google-oauth.js +89 -26
  49. package/dist/auth/google-oauth.js.map +1 -1
  50. package/dist/auth/google-oauth.test.js +105 -35
  51. package/dist/auth/google-oauth.test.js.map +1 -1
  52. package/dist/auth/oauth.d.ts +3 -0
  53. package/dist/auth/oauth.d.ts.map +1 -0
  54. package/dist/auth/oauth.js +28 -0
  55. package/dist/auth/oauth.js.map +1 -0
  56. package/dist/auth/oauth.test.d.ts +2 -0
  57. package/dist/auth/oauth.test.d.ts.map +1 -0
  58. package/dist/auth/oauth.test.js +233 -0
  59. package/dist/auth/oauth.test.js.map +1 -0
  60. package/dist/firebase-edge-errors.d.ts +95 -0
  61. package/dist/firebase-edge-errors.d.ts.map +1 -0
  62. package/dist/firebase-edge-errors.js +102 -0
  63. package/dist/firebase-edge-errors.js.map +1 -0
  64. package/dist/firebase-edge-errors.test.d.ts +2 -0
  65. package/dist/firebase-edge-errors.test.d.ts.map +1 -0
  66. package/dist/firebase-edge-errors.test.js +72 -0
  67. package/dist/firebase-edge-errors.test.js.map +1 -0
  68. package/dist/firebase-edge-server.d.ts +5 -4
  69. package/dist/firebase-edge-server.d.ts.map +1 -1
  70. package/dist/firebase-edge-server.js +22 -17
  71. package/dist/firebase-edge-server.js.map +1 -1
  72. package/dist/firebase-edge-server.test.js +55 -7
  73. package/dist/firebase-edge-server.test.js.map +1 -1
  74. package/package.json +1 -1
@@ -0,0 +1,233 @@
1
+ import { describe, expect, it, beforeEach, vi } from 'vitest';
2
+ import { createGitHubOAuthLoginUrl, createGoogleOAuthLoginUrl } from './oauth.js';
3
+ import { exchangeCodeForGitHubIdToken } from './github-oauth.js';
4
+ import { exchangeCodeForGoogleIdToken, getToken } from './google-oauth.js';
5
+ import { FirebaseEdgeError } from './errors.js';
6
+ import { GitHubErrorInfo } from './auth-error-codes.js';
7
+ const restFetchMock = vi.hoisted(() => vi.fn());
8
+ const signJWTMock = vi.hoisted(() => vi.fn());
9
+ vi.mock('../rest-fetch.js', () => ({
10
+ restFetch: restFetchMock
11
+ }));
12
+ vi.mock('./firebase-jwt.js', () => ({
13
+ signJWT: signJWTMock
14
+ }));
15
+ beforeEach(() => {
16
+ restFetchMock.mockReset();
17
+ signJWTMock.mockReset();
18
+ });
19
+ describe('OAuth', () => {
20
+ describe('URL Creation', () => {
21
+ describe('createGitHubOAuthLoginUrl', () => {
22
+ it('builds expected GitHub authorization URL', () => {
23
+ const url = createGitHubOAuthLoginUrl('https://example.com/callback', '/next/path', 'client-123');
24
+ const parsed = new URL(url);
25
+ expect(parsed.origin + parsed.pathname).toBe('https://github.com/login/oauth/authorize');
26
+ expect(parsed.searchParams.get('client_id')).toBe('client-123');
27
+ expect(parsed.searchParams.get('redirect_uri')).toBe('https://example.com/callback');
28
+ expect(parsed.searchParams.get('scope')).toBe('read:user user:email');
29
+ expect(JSON.parse(parsed.searchParams.get('state') ?? '')).toEqual({
30
+ next: '/next/path',
31
+ provider: 'github'
32
+ });
33
+ });
34
+ it('handles special characters in paths', () => {
35
+ const url = createGitHubOAuthLoginUrl('https://example.com/auth/callback', '/dashboard?tab=settings&theme=dark', 'my-client-id');
36
+ const parsed = new URL(url);
37
+ expect(parsed.searchParams.get('client_id')).toBe('my-client-id');
38
+ expect(parsed.searchParams.get('redirect_uri')).toBe('https://example.com/auth/callback');
39
+ const state = JSON.parse(parsed.searchParams.get('state') ?? '{}');
40
+ expect(state.next).toBe('/dashboard?tab=settings&theme=dark');
41
+ expect(state.provider).toBe('github');
42
+ });
43
+ });
44
+ describe('createGoogleOAuthLoginUrl', () => {
45
+ it('builds expected Google consent screen URL', () => {
46
+ const url = createGoogleOAuthLoginUrl('https://example.com/callback', '/next/path', 'client-123');
47
+ const parsed = new URL(url);
48
+ expect(parsed.origin + parsed.pathname).toBe('https://accounts.google.com/o/oauth2/v2/auth');
49
+ expect(parsed.searchParams.get('client_id')).toBe('client-123');
50
+ expect(parsed.searchParams.get('redirect_uri')).toBe('https://example.com/callback');
51
+ expect(parsed.searchParams.get('response_type')).toBe('code');
52
+ expect(parsed.searchParams.get('scope')).toBe('openid email profile');
53
+ expect(parsed.searchParams.get('access_type')).toBe('offline');
54
+ expect(parsed.searchParams.get('prompt')).toBe('consent');
55
+ expect(JSON.parse(parsed.searchParams.get('state') ?? '')).toEqual({
56
+ next: '/next/path',
57
+ provider: 'google'
58
+ });
59
+ });
60
+ });
61
+ describe('URL encoding and safety', () => {
62
+ it('properly encodes special characters in GitHub URLs', () => {
63
+ const url = createGitHubOAuthLoginUrl('https://example.com/callback', '/path with spaces & symbols!', 'client-123');
64
+ expect(() => new URL(url)).not.toThrow();
65
+ const parsed = new URL(url);
66
+ const state = JSON.parse(parsed.searchParams.get('state') ?? '{}');
67
+ expect(state.next).toBe('/path with spaces & symbols!');
68
+ });
69
+ it('properly encodes special characters in Google URLs', () => {
70
+ const url = createGoogleOAuthLoginUrl('https://example.com/auth/callback?foo=bar&baz=qux', '/admin/users?filter=active&sort=name', 'client@example.com');
71
+ expect(() => new URL(url)).not.toThrow();
72
+ const parsed = new URL(url);
73
+ expect(parsed.searchParams.get('client_id')).toBe('client@example.com');
74
+ });
75
+ });
76
+ });
77
+ describe('GitHub OAuth', () => {
78
+ const payload = {
79
+ code: 'auth-code',
80
+ redirect_uri: 'https://example.com/callback',
81
+ client_id: 'client-123',
82
+ client_secret: 'secret-xyz'
83
+ };
84
+ describe('exchangeCodeForGitHubIdToken', () => {
85
+ it('returns token data when REST call succeeds', async () => {
86
+ const expectedData = {
87
+ access_token: 'gho_token',
88
+ token_type: 'bearer',
89
+ scope: 'read:user,user:email'
90
+ };
91
+ restFetchMock.mockResolvedValue({
92
+ data: expectedData,
93
+ error: null
94
+ });
95
+ const result = await exchangeCodeForGitHubIdToken(payload.code, payload.redirect_uri, payload.client_id, payload.client_secret);
96
+ expect(restFetchMock).toHaveBeenCalledWith('https://github.com/login/oauth/access_token', expect.objectContaining({
97
+ body: expect.objectContaining(payload),
98
+ form: true,
99
+ acceptJson: true
100
+ }));
101
+ expect(result).toEqual({ data: expectedData, error: null });
102
+ });
103
+ it('handles incorrect client credentials error', async () => {
104
+ const githubError = {
105
+ error: 'incorrect_client_credentials',
106
+ error_description: 'The client_id and/or client_secret passed are incorrect.'
107
+ };
108
+ restFetchMock.mockResolvedValue({
109
+ data: null,
110
+ error: githubError
111
+ });
112
+ const result = await exchangeCodeForGitHubIdToken(payload.code, payload.redirect_uri, payload.client_id, payload.client_secret);
113
+ expect(result.data).toBeNull();
114
+ expect(result.error).toBeInstanceOf(FirebaseEdgeError);
115
+ expect(result.error?.code).toBe('auth/github-incorrect-client-credentials');
116
+ expect(result.error?.message).toBe(GitHubErrorInfo.GITHUB_INCORRECT_CLIENT_CREDENTIALS.message);
117
+ });
118
+ it('handles bad verification code error', async () => {
119
+ const githubError = {
120
+ error: 'bad_verification_code',
121
+ error_description: 'The code passed is incorrect or expired.'
122
+ };
123
+ restFetchMock.mockResolvedValue({
124
+ data: null,
125
+ error: githubError
126
+ });
127
+ const result = await exchangeCodeForGitHubIdToken(payload.code, payload.redirect_uri, payload.client_id, payload.client_secret);
128
+ expect(result.data).toBeNull();
129
+ expect(result.error).toBeInstanceOf(FirebaseEdgeError);
130
+ expect(result.error?.code).toBe('auth/github-bad-verification-code');
131
+ });
132
+ });
133
+ });
134
+ describe('Google OAuth', () => {
135
+ const payload = {
136
+ code: 'auth-code',
137
+ redirect_uri: 'https://example.com/callback',
138
+ client_id: 'client-123',
139
+ client_secret: 'secret-xyz'
140
+ };
141
+ describe('exchangeCodeForGoogleIdToken', () => {
142
+ it('returns token data when REST call succeeds', async () => {
143
+ const expectedData = { id_token: 'id', access_token: 'access' };
144
+ restFetchMock.mockResolvedValue({
145
+ data: expectedData,
146
+ error: null
147
+ });
148
+ const result = await exchangeCodeForGoogleIdToken(payload.code, payload.redirect_uri, payload.client_id, payload.client_secret);
149
+ expect(restFetchMock).toHaveBeenCalledWith('https://oauth2.googleapis.com/token', expect.objectContaining({
150
+ body: expect.objectContaining(payload),
151
+ form: true
152
+ }));
153
+ expect(result).toEqual({ data: expectedData, error: null });
154
+ });
155
+ it('returns upstream error when REST call fails', async () => {
156
+ const apiError = { code: 400, message: 'invalid_grant' };
157
+ restFetchMock.mockResolvedValue({
158
+ data: null,
159
+ error: { error: apiError }
160
+ });
161
+ const result = await exchangeCodeForGoogleIdToken(payload.code, payload.redirect_uri, payload.client_id, payload.client_secret);
162
+ expect(result.data).toBeNull();
163
+ expect(result.error).toBeInstanceOf(FirebaseEdgeError);
164
+ expect(result.error?.code).toBe('auth/google-invalid-grant');
165
+ });
166
+ it('handles invalid client error', async () => {
167
+ const apiError = { code: 401, message: 'invalid_client' };
168
+ restFetchMock.mockResolvedValue({
169
+ data: null,
170
+ error: { error: apiError }
171
+ });
172
+ const result = await exchangeCodeForGoogleIdToken(payload.code, payload.redirect_uri, payload.client_id, payload.client_secret);
173
+ expect(result.data).toBeNull();
174
+ expect(result.error).toBeInstanceOf(FirebaseEdgeError);
175
+ expect(result.error?.code).toBe('auth/google-invalid-client');
176
+ });
177
+ });
178
+ describe('getToken', () => {
179
+ const serviceAccount = {
180
+ client_email: 'test@project.iam.gserviceaccount.com',
181
+ private_key: '-----BEGIN PRIVATE KEY-----\nABC\n-----END PRIVATE KEY-----\n',
182
+ token_uri: 'https://oauth2.googleapis.com/token'
183
+ };
184
+ it('requests new token with signed JWT', async () => {
185
+ const fakeFetch = vi.fn();
186
+ const tokenData = { access_token: 'ya29', expires_in: 3600 };
187
+ signJWTMock.mockResolvedValue({
188
+ data: 'signed-jwt',
189
+ error: null
190
+ });
191
+ restFetchMock.mockResolvedValue({
192
+ data: tokenData,
193
+ error: null
194
+ });
195
+ const result = await getToken(serviceAccount, fakeFetch);
196
+ expect(signJWTMock).toHaveBeenCalledWith(serviceAccount);
197
+ expect(result).toEqual({ data: tokenData, error: null });
198
+ });
199
+ it('short-circuits when signJWT returns error', async () => {
200
+ const jwtError = { code: 401, message: 'bad cert', errors: [] };
201
+ signJWTMock.mockResolvedValue({ data: null, error: jwtError });
202
+ const result = await getToken(serviceAccount);
203
+ expect(restFetchMock).not.toHaveBeenCalled();
204
+ expect(result.data).toBeNull();
205
+ expect(result.error).toBeInstanceOf(FirebaseEdgeError);
206
+ expect(result.error?.code).toBe('auth/jwt-sign-failed');
207
+ });
208
+ it('reports missing JWT data', async () => {
209
+ signJWTMock.mockResolvedValue({ data: null, error: null });
210
+ const result = await getToken(serviceAccount);
211
+ expect(result.data).toBeNull();
212
+ expect(result.error).toBeInstanceOf(FirebaseEdgeError);
213
+ expect(result.error?.code).toBe('auth/jwt-data-missing');
214
+ });
215
+ it('returns REST error payload from Google', async () => {
216
+ const apiError = { code: 503, message: 'unavailable' };
217
+ signJWTMock.mockResolvedValue({
218
+ data: 'signed-jwt',
219
+ error: null
220
+ });
221
+ restFetchMock.mockResolvedValue({
222
+ data: null,
223
+ error: { error: apiError }
224
+ });
225
+ const result = await getToken(serviceAccount);
226
+ expect(result.data).toBeNull();
227
+ expect(result.error).toBeInstanceOf(FirebaseEdgeError);
228
+ expect(result.error?.code).toBe('auth/google-temporarily-unavailable');
229
+ });
230
+ });
231
+ });
232
+ });
233
+ //# sourceMappingURL=oauth.test.js.map
@@ -0,0 +1 @@
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CAAC,CAAC;gBAEH,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,cAAc,CAAC,CAAC;gBAE9C,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;gBAC/B,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC;gBACvD,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,IAAI,CAC3B,qCAAqC,CACxC,CAAC;YACN,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -0,0 +1,95 @@
1
+ export declare const FirebaseEdgeServerErrorInfo: {
2
+ EDGE_PROVIDER_NOT_CONFIGURED: {
3
+ message: string;
4
+ code: string;
5
+ };
6
+ EDGE_GOOGLE_PROVIDER_NOT_CONFIGURED: {
7
+ message: string;
8
+ code: string;
9
+ };
10
+ EDGE_GITHUB_PROVIDER_NOT_CONFIGURED: {
11
+ message: string;
12
+ code: string;
13
+ };
14
+ EDGE_NO_PROVIDER_IN_STATE: {
15
+ message: string;
16
+ code: string;
17
+ };
18
+ EDGE_INVALID_STATE_FORMAT: {
19
+ message: string;
20
+ code: string;
21
+ };
22
+ EDGE_NO_OAUTH_TOKEN: {
23
+ message: string;
24
+ code: string;
25
+ };
26
+ EDGE_NO_EXCHANGE_DATA: {
27
+ message: string;
28
+ code: string;
29
+ };
30
+ EDGE_NO_SIGN_IN_DATA: {
31
+ message: string;
32
+ code: string;
33
+ };
34
+ EDGE_NO_ID_TOKEN: {
35
+ message: string;
36
+ code: string;
37
+ };
38
+ EDGE_NO_SESSION_COOKIE: {
39
+ message: string;
40
+ code: string;
41
+ };
42
+ EDGE_NO_CUSTOM_TOKEN_SIGNED: {
43
+ message: string;
44
+ code: string;
45
+ };
46
+ EDGE_ACCOUNT_EXISTS_DIFFERENT_METHOD: {
47
+ message: string;
48
+ code: string;
49
+ };
50
+ EDGE_SESSION_EXPIRED: {
51
+ message: string;
52
+ code: string;
53
+ };
54
+ EDGE_SESSION_INVALID: {
55
+ message: string;
56
+ code: string;
57
+ };
58
+ EDGE_SESSION_REVOKED: {
59
+ message: string;
60
+ code: string;
61
+ };
62
+ EDGE_SERVICE_ACCOUNT_MISSING: {
63
+ message: string;
64
+ code: string;
65
+ };
66
+ EDGE_FIREBASE_CONFIG_MISSING: {
67
+ message: string;
68
+ code: string;
69
+ };
70
+ EDGE_COOKIE_FUNCTIONS_MISSING: {
71
+ message: string;
72
+ code: string;
73
+ };
74
+ EDGE_FETCH_NOT_AVAILABLE: {
75
+ message: string;
76
+ code: string;
77
+ };
78
+ EDGE_ENVIRONMENT_NOT_SUPPORTED: {
79
+ message: string;
80
+ code: string;
81
+ };
82
+ EDGE_SERVER_INITIALIZATION_FAILED: {
83
+ message: string;
84
+ code: string;
85
+ };
86
+ EDGE_OPERATION_FAILED: {
87
+ message: string;
88
+ code: string;
89
+ };
90
+ EDGE_UNKNOWN_ERROR: {
91
+ message: string;
92
+ code: string;
93
+ };
94
+ };
95
+ //# sourceMappingURL=firebase-edge-errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"firebase-edge-errors.d.ts","sourceRoot":"","sources":["../src/firebase-edge-errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0GvC,CAAC"}
@@ -0,0 +1,102 @@
1
+ export const FirebaseEdgeServerErrorInfo = {
2
+ // Provider Configuration Errors
3
+ EDGE_PROVIDER_NOT_CONFIGURED: {
4
+ message: 'OAuth provider not configured for this edge server instance.',
5
+ code: 'edge/provider-not-configured'
6
+ },
7
+ EDGE_GOOGLE_PROVIDER_NOT_CONFIGURED: {
8
+ message: 'Google provider not configured.',
9
+ code: 'edge/google-provider-not-configured'
10
+ },
11
+ EDGE_GITHUB_PROVIDER_NOT_CONFIGURED: {
12
+ message: 'GitHub provider not configured.',
13
+ code: 'edge/github-provider-not-configured'
14
+ },
15
+ // OAuth Flow Errors
16
+ EDGE_NO_PROVIDER_IN_STATE: {
17
+ message: 'No provider specified in state.',
18
+ code: 'edge/no-provider-in-state'
19
+ },
20
+ EDGE_INVALID_STATE_FORMAT: {
21
+ message: 'OAuth state parameter has invalid format.',
22
+ code: 'edge/invalid-state-format'
23
+ },
24
+ EDGE_NO_OAUTH_TOKEN: {
25
+ message: 'No OAuth token obtained from provider.',
26
+ code: 'edge/no-oauth-token'
27
+ },
28
+ EDGE_NO_EXCHANGE_DATA: {
29
+ message: 'No exchange data returned from OAuth provider.',
30
+ code: 'edge/no-exchange-data'
31
+ },
32
+ EDGE_NO_SIGN_IN_DATA: {
33
+ message: 'No sign-in data obtained from authentication.',
34
+ code: 'edge/no-sign-in-data'
35
+ },
36
+ // Token and Session Errors
37
+ EDGE_NO_ID_TOKEN: {
38
+ message: 'No ID token obtained from sign-in.',
39
+ code: 'edge/no-id-token'
40
+ },
41
+ EDGE_NO_SESSION_COOKIE: {
42
+ message: 'No session cookie returned from authentication.',
43
+ code: 'edge/no-session-cookie'
44
+ },
45
+ EDGE_NO_CUSTOM_TOKEN_SIGNED: {
46
+ message: 'No custom token signed for user.',
47
+ code: 'edge/no-custom-token-signed'
48
+ },
49
+ EDGE_ACCOUNT_EXISTS_DIFFERENT_METHOD: {
50
+ message: 'Account exists with a different sign-in method.',
51
+ code: 'edge/account-exists-different-method'
52
+ },
53
+ // Session Management Errors
54
+ EDGE_SESSION_EXPIRED: {
55
+ message: 'Edge server session has expired.',
56
+ code: 'edge/session-expired'
57
+ },
58
+ EDGE_SESSION_INVALID: {
59
+ message: 'Edge server session is invalid.',
60
+ code: 'edge/session-invalid'
61
+ },
62
+ EDGE_SESSION_REVOKED: {
63
+ message: 'Edge server session has been revoked.',
64
+ code: 'edge/session-revoked'
65
+ },
66
+ // Configuration Errors
67
+ EDGE_SERVICE_ACCOUNT_MISSING: {
68
+ message: 'Service account configuration is required for edge server.',
69
+ code: 'edge/service-account-missing'
70
+ },
71
+ EDGE_FIREBASE_CONFIG_MISSING: {
72
+ message: 'Firebase configuration is required for edge server.',
73
+ code: 'edge/firebase-config-missing'
74
+ },
75
+ EDGE_COOKIE_FUNCTIONS_MISSING: {
76
+ message: 'Cookie management functions are required for edge server.',
77
+ code: 'edge/cookie-functions-missing'
78
+ },
79
+ // Runtime Environment Errors
80
+ EDGE_FETCH_NOT_AVAILABLE: {
81
+ message: 'Fetch function not available in edge environment.',
82
+ code: 'edge/fetch-not-available'
83
+ },
84
+ EDGE_ENVIRONMENT_NOT_SUPPORTED: {
85
+ message: 'Current environment is not supported for edge server.',
86
+ code: 'edge/environment-not-supported'
87
+ },
88
+ // Generic Edge Server Errors
89
+ EDGE_SERVER_INITIALIZATION_FAILED: {
90
+ message: 'Firebase edge server initialization failed.',
91
+ code: 'edge/server-initialization-failed'
92
+ },
93
+ EDGE_OPERATION_FAILED: {
94
+ message: 'Edge server operation failed.',
95
+ code: 'edge/operation-failed'
96
+ },
97
+ EDGE_UNKNOWN_ERROR: {
98
+ message: 'An unknown error occurred in Firebase edge server.',
99
+ code: 'edge/unknown-error'
100
+ }
101
+ };
102
+ //# sourceMappingURL=firebase-edge-errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"firebase-edge-errors.js","sourceRoot":"","sources":["../src/firebase-edge-errors.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACvC,gCAAgC;IAChC,4BAA4B,EAAE;QAC1B,OAAO,EAAE,8DAA8D;QACvE,IAAI,EAAE,8BAA8B;KACvC;IACD,mCAAmC,EAAE;QACjC,OAAO,EAAE,iCAAiC;QAC1C,IAAI,EAAE,qCAAqC;KAC9C;IACD,mCAAmC,EAAE;QACjC,OAAO,EAAE,iCAAiC;QAC1C,IAAI,EAAE,qCAAqC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pE,IAAI,EAAE,+BAA+B;KACxC;IAED,6BAA6B;IAC7B,wBAAwB,EAAE;QACtB,OAAO,EAAE,mDAAmD;QAC5D,IAAI,EAAE,0BAA0B;KACnC;IACD,8BAA8B,EAAE;QAC5B,OAAO,EAAE,uDAAuD;QAChE,IAAI,EAAE,gCAAgC;KACzC;IAED,6BAA6B;IAC7B,iCAAiC,EAAE;QAC/B,OAAO,EAAE,6CAA6C;QACtD,IAAI,EAAE,mCAAmC;KAC5C;IACD,qBAAqB,EAAE;QACnB,OAAO,EAAE,+BAA+B;QACxC,IAAI,EAAE,uBAAuB;KAChC;IACD,kBAAkB,EAAE;QAChB,OAAO,EAAE,oDAAoD;QAC7D,IAAI,EAAE,oBAAoB;KAC7B;CACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=firebase-edge-errors.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"firebase-edge-errors.test.d.ts","sourceRoot":"","sources":["../src/firebase-edge-errors.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,72 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ import { FirebaseEdgeError } from './auth/errors.js';
3
+ import { FirebaseEdgeServerErrorInfo } from './firebase-edge-errors.js';
4
+ describe('firebase-edge-errors', () => {
5
+ describe('FirebaseEdgeServerErrorInfo', () => {
6
+ it('contains all required error definitions', () => {
7
+ expect(FirebaseEdgeServerErrorInfo.EDGE_PROVIDER_NOT_CONFIGURED).toBeDefined();
8
+ expect(FirebaseEdgeServerErrorInfo.EDGE_GOOGLE_PROVIDER_NOT_CONFIGURED).toBeDefined();
9
+ expect(FirebaseEdgeServerErrorInfo.EDGE_GITHUB_PROVIDER_NOT_CONFIGURED).toBeDefined();
10
+ expect(FirebaseEdgeServerErrorInfo.EDGE_NO_PROVIDER_IN_STATE).toBeDefined();
11
+ expect(FirebaseEdgeServerErrorInfo.EDGE_NO_OAUTH_TOKEN).toBeDefined();
12
+ expect(FirebaseEdgeServerErrorInfo.EDGE_NO_ID_TOKEN).toBeDefined();
13
+ expect(FirebaseEdgeServerErrorInfo.EDGE_NO_SESSION_COOKIE).toBeDefined();
14
+ expect(FirebaseEdgeServerErrorInfo.EDGE_NO_CUSTOM_TOKEN_SIGNED).toBeDefined();
15
+ expect(FirebaseEdgeServerErrorInfo.EDGE_SESSION_EXPIRED).toBeDefined();
16
+ expect(FirebaseEdgeServerErrorInfo.EDGE_ACCOUNT_EXISTS_DIFFERENT_METHOD).toBeDefined();
17
+ });
18
+ it('has proper error structure for provider configuration errors', () => {
19
+ const error = FirebaseEdgeServerErrorInfo.EDGE_GOOGLE_PROVIDER_NOT_CONFIGURED;
20
+ expect(error).toHaveProperty('code');
21
+ expect(error).toHaveProperty('message');
22
+ expect(error.code).toBe('edge/google-provider-not-configured');
23
+ expect(error.message).toContain('Google');
24
+ });
25
+ it('has proper error structure for OAuth flow errors', () => {
26
+ const error = FirebaseEdgeServerErrorInfo.EDGE_NO_OAUTH_TOKEN;
27
+ expect(error).toHaveProperty('code');
28
+ expect(error).toHaveProperty('message');
29
+ expect(error.code).toBe('edge/no-oauth-token');
30
+ expect(error.message).toContain('OAuth token');
31
+ });
32
+ it('has proper error structure for session management errors', () => {
33
+ const error = FirebaseEdgeServerErrorInfo.EDGE_SESSION_EXPIRED;
34
+ expect(error).toHaveProperty('code');
35
+ expect(error).toHaveProperty('message');
36
+ expect(error.code).toBe('edge/session-expired');
37
+ expect(error.message).toContain('session');
38
+ });
39
+ });
40
+ describe('FirebaseEdgeError with edge-specific errors', () => {
41
+ it('creates proper error instance with provider configuration error', () => {
42
+ const error = new FirebaseEdgeError(FirebaseEdgeServerErrorInfo.EDGE_GOOGLE_PROVIDER_NOT_CONFIGURED);
43
+ expect(error).toBeInstanceOf(FirebaseEdgeError);
44
+ expect(error).toBeInstanceOf(Error);
45
+ expect(error.code).toBe('edge/google-provider-not-configured');
46
+ expect(error.message).toContain('Google provider not configured');
47
+ });
48
+ it('creates proper error instance with OAuth flow error', () => {
49
+ const error = new FirebaseEdgeError(FirebaseEdgeServerErrorInfo.EDGE_NO_OAUTH_TOKEN);
50
+ expect(error).toBeInstanceOf(FirebaseEdgeError);
51
+ expect(error).toBeInstanceOf(Error);
52
+ expect(error.code).toBe('edge/no-oauth-token');
53
+ expect(error.message).toContain('OAuth token obtained');
54
+ });
55
+ it('creates proper error instance with session management error', () => {
56
+ const error = new FirebaseEdgeError(FirebaseEdgeServerErrorInfo.EDGE_SESSION_EXPIRED);
57
+ expect(error).toBeInstanceOf(FirebaseEdgeError);
58
+ expect(error).toBeInstanceOf(Error);
59
+ expect(error.code).toBe('edge/session-expired');
60
+ expect(error.message).toContain('session has expired');
61
+ });
62
+ it('includes additional context when provided', () => {
63
+ const context = {
64
+ provider: 'google',
65
+ redirectUri: 'http://localhost'
66
+ };
67
+ const error = new FirebaseEdgeError(FirebaseEdgeServerErrorInfo.EDGE_GOOGLE_PROVIDER_NOT_CONFIGURED, { context });
68
+ expect(error.context).toEqual(context);
69
+ });
70
+ });
71
+ });
72
+ //# sourceMappingURL=firebase-edge-errors.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"firebase-edge-errors.test.js","sourceRoot":"","sources":["../src/firebase-edge-errors.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAExE,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IAClC,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;QACzC,EAAE,CAAC,yCAAyC,EAAE,GAAG,EAAE;YAC/C,MAAM,CACF,2BAA2B,CAAC,4BAA4B,CAC3D,CAAC,WAAW,EAAE,CAAC;YAChB,MAAM,CACF,2BAA2B,CAAC,mCAAmC,CAClE,CAAC,WAAW,EA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2
  import { FirebaseAdminAuth } from './auth/firebase-admin-auth.js';
3
3
  import { FirebaseAuth } from './auth/firebase-auth.js';
4
4
  import type { FirebaseConfig, ServiceAccount } from './auth/firebase-types.js';
5
+ import { FirebaseEdgeError } from './auth/errors.js';
5
6
  /**
6
7
  * Official Firebase OAuth providers
7
8
  */
@@ -24,14 +25,16 @@ type CookieConfig = {
24
25
  * @param config.firebaseConfig Firebase client configuration
25
26
  * @param config.providers OAuth provider configurations (Google, GitHub, etc.)
26
27
  * @param config.cookies Cookie management functions
28
+ * @param config.tenantId Optional Firebase Auth tenant ID for multi-tenancy
27
29
  * @param config.fetch Optional custom fetch implementation
28
30
  * @returns Object with authentication methods
29
31
  */
30
- export declare function createFirebaseEdgeServer({ serviceAccount, firebaseConfig, providers, cookies, fetch }: {
32
+ export declare function createFirebaseEdgeServer({ serviceAccount, firebaseConfig, providers, cookies, tenantId, fetch }: {
31
33
  serviceAccount: ServiceAccount;
32
34
  firebaseConfig: FirebaseConfig;
33
35
  providers: ProviderConfig;
34
36
  cookies: CookieConfig;
37
+ tenantId?: string;
35
38
  fetch?: typeof globalThis.fetch;
36
39
  }): {
37
40
  auth: FirebaseAuth;
@@ -50,9 +53,7 @@ export declare function createFirebaseEdgeServer({ serviceAccount, firebaseConfi
50
53
  getGoogleLoginURL: (redirect_uri: string, path: string) => Promise<string>;
51
54
  getGitHubLoginURL: (redirect_uri: string, path: string) => Promise<string>;
52
55
  signInWithCode: (code: string, redirect_uri: string, state?: string | null) => Promise<{
53
- error: Error;
54
- } | {
55
- error: string;
56
+ error: FirebaseEdgeError;
56
57
  } | {
57
58
  error: null;
58
59
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"firebase-edge-server.d.ts","sourceRoot":"","sources":["../src/firebase-edge-server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAER,UAAU,EACV,UAAU,EACb,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;A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