@jskit-ai/auth-provider-supabase-core 0.1.147 → 0.1.149

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/auth-provider-supabase-core",
3
- "version": "0.1.147",
3
+ "version": "0.1.149",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "test": "node --test"
@@ -12,8 +12,8 @@
12
12
  "./client": "./src/client/index.js"
13
13
  },
14
14
  "dependencies": {
15
- "@jskit-ai/auth-core": "0.1.148",
16
- "@jskit-ai/kernel": "0.1.150",
15
+ "@jskit-ai/auth-core": "0.1.150",
16
+ "@jskit-ai/kernel": "0.1.152",
17
17
  "@supabase/supabase-js": "^2.57.4",
18
18
  "jose": "^6.1.0",
19
19
  "json-rest-schema": "^1.0.17",
@@ -97,8 +97,8 @@
97
97
  "mutations": {
98
98
  "dependencies": {
99
99
  "runtime": {
100
- "@jskit-ai/auth-core": "0.1.148",
101
- "@jskit-ai/kernel": "0.1.150",
100
+ "@jskit-ai/auth-core": "0.1.150",
101
+ "@jskit-ai/kernel": "0.1.152",
102
102
  "dotenv": "^16.4.5",
103
103
  "@supabase/supabase-js": "^2.57.4",
104
104
  "jose": "^6.1.0"
@@ -674,8 +674,9 @@ function createService(options) {
674
674
  if (!actor) {
675
675
  return result;
676
676
  }
677
+ const { profile: _profile, ...authResult } = result;
677
678
  return normalizeAuthResult({
678
- ...result,
679
+ ...authResult,
679
680
  actor
680
681
  });
681
682
  }
@@ -774,7 +775,7 @@ function createService(options) {
774
775
  throw new AppError(401, "Authentication required.");
775
776
  }
776
777
 
777
- const passwordSignInPolicy = await resolvePasswordSignInPolicyForUserId(devAuthResult.profile.id);
778
+ const passwordSignInPolicy = await resolvePasswordSignInPolicyForUserId(devAuthResult.actor.id);
778
779
  const authMethodsStatus = buildAuthMethodsStatusFromProviderIds([AUTH_METHOD_PASSWORD_PROVIDER], {
779
780
  ...passwordSignInPolicy,
780
781
  oauthProviders: authOAuthProviders
@@ -91,6 +91,7 @@ function createServiceFixture(overrides = {}) {
91
91
  devAuthBypassSecret: DEV_AUTH_SECRET,
92
92
  userProfilesRepository: createUserProfilesRepository(),
93
93
  userProfileSyncService: createUserProfileSyncService(),
94
+ profileProjectionEnabled: true,
94
95
  ...overrides
95
96
  });
96
97
  }
@@ -103,7 +104,7 @@ test("dev auth bootstrap can issue and authenticate a local session without Supa
103
104
  userId: "7"
104
105
  });
105
106
 
106
- assert.equal(loginResult.profile.id, "7");
107
+ assert.equal(loginResult.actor.id, "7");
107
108
  assert.match(loginResult.session.access_token, /^jskit-dev\./);
108
109
  assert.match(loginResult.session.refresh_token, /^jskit-dev\./);
109
110
 
@@ -117,8 +118,8 @@ test("dev auth bootstrap can issue and authenticate a local session without Supa
117
118
  );
118
119
 
119
120
  assert.equal(authResult.authenticated, true);
120
- assert.equal(authResult.profile.id, "7");
121
- assert.equal(authResult.profile.email, "ada@example.com");
121
+ assert.equal(authResult.actor.id, "7");
122
+ assert.equal(authResult.actor.email, "ada@example.com");
122
123
  assert.equal(authResult.session, null);
123
124
  });
124
125
 
@@ -138,7 +139,7 @@ test("dev auth bootstrap resolves security status without Supabase", async () =>
138
139
  );
139
140
 
140
141
  const passwordMethod = securityStatus.authMethods.find((method) => method.id === "password");
141
- assert.equal(securityStatus.authPolicy.minimumEnabledMethods, 1);
142
+ assert.equal(securityStatus.policy.minimumEnabledMethods, 1);
142
143
  assert.equal(passwordMethod?.configured, true);
143
144
  assert.equal(passwordMethod?.enabled, true);
144
145
  });
@@ -170,8 +171,8 @@ test("dev auth bootstrap supports email lookup", async () => {
170
171
  email: "ADA@EXAMPLE.COM"
171
172
  });
172
173
 
173
- assert.equal(result.profile.id, "7");
174
- assert.equal(result.profile.email, "ada@example.com");
174
+ assert.equal(result.actor.id, "7");
175
+ assert.equal(result.actor.email, "ada@example.com");
175
176
  });
176
177
 
177
178
  test("dev auth bootstrap rejects a missing or incorrect exchange secret", async () => {
@@ -192,7 +193,7 @@ test("dev auth bootstrap rejects a missing or incorrect exchange secret", async
192
193
  );
193
194
  });
194
195
 
195
- test("dev auth bootstrap canonicalizes producer profiles before returning them", async () => {
196
+ test("dev auth bootstrap returns the canonical actor", async () => {
196
197
  const rawProfile = createProfile({
197
198
  email: " ADA@EXAMPLE.COM ",
198
199
  username: " Ada ",
@@ -212,16 +213,17 @@ test("dev auth bootstrap canonicalizes producer profiles before returning them",
212
213
  userId: "7"
213
214
  });
214
215
 
215
- assert.deepEqual(loginResult.profile, {
216
+ assert.deepEqual(loginResult.actor, {
216
217
  id: "7",
218
+ authIdentityId: "supabase:supabase-user-7",
219
+ provider: "supabase",
220
+ providerUserId: "supabase-user-7",
217
221
  email: "ada@example.com",
218
- username: "ada",
219
222
  displayName: "Ada Example",
220
- authProvider: "supabase",
221
- authProviderUserSid: "supabase-user-7",
222
- avatarStorageKey: "avatars/7.png",
223
- avatarVersion: "7"
223
+ appUserId: "7",
224
+ profileSource: "users"
224
225
  });
226
+ assert.equal(Object.hasOwn(loginResult, "profile"), false);
225
227
  });
226
228
 
227
229
  test("dev auth bootstrap rejects non-local requests and clears leaked dev sessions", async () => {