@ankhorage/infra 0.3.2 → 0.3.4
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.
- package/CHANGELOG.md +12 -0
- package/README.md +2 -2
- package/dist/adapters/minikube/auth/supabase/index.d.ts.map +1 -1
- package/dist/adapters/minikube/auth/supabase/index.js +14 -163
- package/dist/adapters/minikube/auth/supabase/index.js.map +1 -1
- package/dist/adapters/minikube/auth/supabase/profile.d.ts +21 -0
- package/dist/adapters/minikube/auth/supabase/profile.d.ts.map +1 -0
- package/dist/adapters/minikube/auth/supabase/profile.js +452 -0
- package/dist/adapters/minikube/auth/supabase/profile.js.map +1 -0
- package/dist/adapters/minikube/authz/cerbos/index.d.ts +1 -1
- package/dist/adapters/minikube/authz/cerbos/index.d.ts.map +1 -1
- package/dist/adapters/minikube/authz/cerbos/index.js +5 -3
- package/dist/adapters/minikube/authz/cerbos/index.js.map +1 -1
- package/dist/adapters/minikube/authz/index.d.ts +1 -1
- package/dist/adapters/minikube/authz/index.d.ts.map +1 -1
- package/dist/adapters/minikube/authz/index.js +1 -1
- package/dist/adapters/minikube/authz/index.js.map +1 -1
- package/dist/adapters/minikube/base/index.d.ts.map +1 -1
- package/dist/adapters/minikube/base/index.js +850 -54
- package/dist/adapters/minikube/base/index.js.map +1 -1
- package/dist/adapters/minikube/index.js +2 -1
- package/dist/adapters/minikube/index.js.map +1 -1
- package/dist/infraValidation.js +1 -1
- package/dist/infraValidation.js.map +1 -1
- package/dist/project.d.ts.map +1 -1
- package/dist/project.js +1 -18
- package/dist/project.js.map +1 -1
- package/dist/testSupport.d.ts.map +1 -1
- package/dist/testSupport.js +0 -6
- package/dist/testSupport.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +2 -2
- package/src/adapters/minikube/auth/supabase/index.test.ts +152 -18
- package/src/adapters/minikube/auth/supabase/index.ts +18 -205
- package/src/adapters/minikube/auth/supabase/profile.integration.test.ts +860 -0
- package/src/adapters/minikube/auth/supabase/profile.ts +526 -0
- package/src/adapters/minikube/authz/cerbos/index.ts +7 -5
- package/src/adapters/minikube/authz/index.ts +2 -2
- package/src/adapters/minikube/base/index.test.ts +100 -6
- package/src/adapters/minikube/base/index.ts +880 -54
- package/src/adapters/minikube/index.ts +3 -1
- package/src/index.test.ts +13 -2
- package/src/infraValidation.ts +1 -1
- package/src/project.ts +2 -22
- package/src/testSupport.ts +0 -6
- package/src/types.ts +1 -1
|
@@ -89,7 +89,9 @@ function collectProviders(manifest: InfraManifestInput): string[] {
|
|
|
89
89
|
const providers = new Set<string>();
|
|
90
90
|
|
|
91
91
|
if (manifest.auth?.provider) providers.add(manifest.auth.provider);
|
|
92
|
-
if (manifest.auth?.authorization
|
|
92
|
+
if (manifest.auth?.authorization?.engine) {
|
|
93
|
+
providers.add(manifest.auth.authorization.engine);
|
|
94
|
+
}
|
|
93
95
|
if (manifest.database?.provider) providers.add(manifest.database.provider);
|
|
94
96
|
if (manifest.storage?.provider) providers.add(manifest.storage.provider);
|
|
95
97
|
if (manifest.state?.provider) providers.add(manifest.state.provider);
|
package/src/index.test.ts
CHANGED
|
@@ -257,9 +257,20 @@ describe('generateInfrastructure', () => {
|
|
|
257
257
|
);
|
|
258
258
|
expect(supabaseLocalEnvScript?.executable).toBe(true);
|
|
259
259
|
expect(supabaseLocalEnvScript?.content).toContain('supabase status -o env');
|
|
260
|
-
expect(supabaseLocalEnvScript?.content).toContain(
|
|
261
|
-
|
|
260
|
+
expect(supabaseLocalEnvScript?.content).toContain(
|
|
261
|
+
'supabase --workdir "${SUPABASE_PROJECT_DIR}" init --yes',
|
|
262
|
+
);
|
|
263
|
+
expect(supabaseLocalEnvScript?.content).toContain(
|
|
264
|
+
'supabase --workdir "${SUPABASE_PROJECT_DIR}" start',
|
|
265
|
+
);
|
|
266
|
+
expect(supabaseLocalEnvScript?.content).toContain(
|
|
267
|
+
'supabase --workdir "${SUPABASE_PROJECT_DIR}" migration up --local',
|
|
268
|
+
);
|
|
262
269
|
expect(supabaseLocalEnvScript?.content).toContain('SUPABASE_PROJECT_DIR');
|
|
270
|
+
expect(supabaseLocalEnvScript?.content).toContain(
|
|
271
|
+
'SUPABASE_PROJECT_DIR="${SUPABASE_PROJECT_DIR:-${ROOT_DIR}}"',
|
|
272
|
+
);
|
|
273
|
+
expect(supabaseLocalEnvScript?.content).toContain('supabase CLI >= 2.106.0 is required');
|
|
263
274
|
expect(supabaseLocalEnvScript?.content).toContain('SUPABASE_LOCAL_ANALYTICS_PORT');
|
|
264
275
|
expect(supabaseLocalEnvScript?.content).toContain('export SUPABASE_LOCAL_ANALYTICS_PORT');
|
|
265
276
|
expect(supabaseLocalEnvScript?.content).toContain(
|
package/src/infraValidation.ts
CHANGED
|
@@ -55,7 +55,7 @@ export function validateInfraSupport(manifest: InfraManifestInput): readonly str
|
|
|
55
55
|
);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
const authzEngine = manifest.auth?.authorization
|
|
58
|
+
const authzEngine = manifest.auth?.authorization?.engine;
|
|
59
59
|
if (authzEngine !== undefined && !isSupported(authzEngine, AUTHZ_ENGINES)) {
|
|
60
60
|
warnings.push(
|
|
61
61
|
warningForUnsupportedValue({
|
package/src/project.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AppManifest,
|
|
1
|
+
import type { AppManifest, NavigatorSpec } from '@ankhorage/contracts';
|
|
2
2
|
import { promises as fs } from 'fs';
|
|
3
3
|
import path from 'path';
|
|
4
4
|
|
|
@@ -87,12 +87,6 @@ function createFallbackManifest(projectId: string): AppManifest {
|
|
|
87
87
|
defaultLocale: 'en',
|
|
88
88
|
locales: ['en'],
|
|
89
89
|
},
|
|
90
|
-
authFlow: {
|
|
91
|
-
signInRoute: '/sign-in',
|
|
92
|
-
signOutRoute: '/sign-out',
|
|
93
|
-
postSignInRoute: '/',
|
|
94
|
-
unauthorizedRoute: '/sign-in',
|
|
95
|
-
},
|
|
96
90
|
},
|
|
97
91
|
};
|
|
98
92
|
}
|
|
@@ -216,8 +210,7 @@ function isSettingsRecord(value: unknown): value is AppManifest['settings'] {
|
|
|
216
210
|
return (
|
|
217
211
|
isRecord(value) &&
|
|
218
212
|
(value.apiBaseUrl === undefined || typeof value.apiBaseUrl === 'string') &&
|
|
219
|
-
isLocalizationRecord(value.localization)
|
|
220
|
-
isAuthFlowConfig(value.authFlow)
|
|
213
|
+
isLocalizationRecord(value.localization)
|
|
221
214
|
);
|
|
222
215
|
}
|
|
223
216
|
|
|
@@ -230,19 +223,6 @@ function isLocalizationRecord(value: unknown): value is AppManifest['settings'][
|
|
|
230
223
|
);
|
|
231
224
|
}
|
|
232
225
|
|
|
233
|
-
function isAuthFlowConfig(value: unknown): value is AuthFlowConfig {
|
|
234
|
-
return (
|
|
235
|
-
isRecord(value) &&
|
|
236
|
-
typeof value.signInRoute === 'string' &&
|
|
237
|
-
typeof value.postSignInRoute === 'string' &&
|
|
238
|
-
(value.signUpRoute === undefined || typeof value.signUpRoute === 'string') &&
|
|
239
|
-
(value.signOutRoute === undefined || typeof value.signOutRoute === 'string') &&
|
|
240
|
-
(value.forgotPasswordRoute === undefined || typeof value.forgotPasswordRoute === 'string') &&
|
|
241
|
-
(value.otpRoute === undefined || typeof value.otpRoute === 'string') &&
|
|
242
|
-
(value.unauthorizedRoute === undefined || typeof value.unauthorizedRoute === 'string')
|
|
243
|
-
);
|
|
244
|
-
}
|
|
245
|
-
|
|
246
226
|
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
247
227
|
return typeof value === 'object' && value !== null;
|
|
248
228
|
}
|
package/src/testSupport.ts
CHANGED
|
@@ -101,12 +101,6 @@ export function createAppManifest(
|
|
|
101
101
|
defaultLocale: 'en',
|
|
102
102
|
locales: ['en'],
|
|
103
103
|
},
|
|
104
|
-
authFlow: {
|
|
105
|
-
signInRoute: '/sign-in',
|
|
106
|
-
signOutRoute: '/sign-out',
|
|
107
|
-
postSignInRoute: '/',
|
|
108
|
-
unauthorizedRoute: '/sign-in',
|
|
109
|
-
},
|
|
110
104
|
},
|
|
111
105
|
};
|
|
112
106
|
}
|
package/src/types.ts
CHANGED