@jskit-ai/auth-core 0.1.129 → 0.1.132

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.
@@ -1,7 +1,7 @@
1
1
  export default Object.freeze({
2
2
  "packageVersion": 1,
3
3
  "packageId": "@jskit-ai/auth-core",
4
- "version": "0.1.129",
4
+ "version": "0.1.132",
5
5
  "kind": "runtime",
6
6
  "dependsOn": [
7
7
  "@jskit-ai/value-app-config-shared"
@@ -74,7 +74,7 @@ export default Object.freeze({
74
74
  "mutations": {
75
75
  "dependencies": {
76
76
  "runtime": {
77
- "@jskit-ai/kernel": "0.1.132",
77
+ "@jskit-ai/kernel": "0.1.134",
78
78
  "@fastify/cookie": "^11.0.2",
79
79
  "@fastify/csrf-protection": "^7.1.0",
80
80
  "@fastify/rate-limit": "^10.3.0"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/auth-core",
3
- "version": "0.1.129",
3
+ "version": "0.1.132",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "test": "node --test"
@@ -56,7 +56,7 @@
56
56
  "./shared/commands/authSessionReadCommand": "./src/shared/commands/authSessionReadCommand.js"
57
57
  },
58
58
  "dependencies": {
59
- "@jskit-ai/kernel": "0.1.132",
59
+ "@jskit-ai/kernel": "0.1.134",
60
60
  "@fastify/cookie": "^11.0.2",
61
61
  "@fastify/csrf-protection": "^7.1.0",
62
62
  "@fastify/rate-limit": "^10.3.0",
@@ -16,9 +16,13 @@ const AUTH_DEV_LOGIN_AS_MESSAGES = createCommandMessages({
16
16
  email: {
17
17
  pattern: "Enter a valid email address.",
18
18
  default: "Enter a valid email address."
19
+ },
20
+ login: {
21
+ pattern: "Provide a valid login name.",
22
+ default: "Provide a valid login name."
19
23
  }
20
24
  },
21
- defaultMessage: "Provide a valid user id or email."
25
+ defaultMessage: "Provide a valid user id, email, or login name."
22
26
  });
23
27
 
24
28
  const authDevLoginAsBodyValidator = deepFreeze({
@@ -30,6 +34,12 @@ const authDevLoginAsBodyValidator = deepFreeze({
30
34
  email: {
31
35
  ...authEmailValidator,
32
36
  required: false
37
+ },
38
+ login: {
39
+ type: "string",
40
+ required: false,
41
+ minLength: 1,
42
+ maxLength: 120
33
43
  }
34
44
  }),
35
45
  mode: "patch",
@@ -37,7 +47,7 @@ const authDevLoginAsBodyValidator = deepFreeze({
37
47
  ...AUTH_DEV_LOGIN_AS_MESSAGES,
38
48
  keywords: {
39
49
  ...AUTH_DEV_LOGIN_AS_MESSAGES.keywords,
40
- anyOf: "Provide a user id or email."
50
+ anyOf: "Provide a user id, email, or login name."
41
51
  }
42
52
  }
43
53
  });
@@ -13,6 +13,7 @@ import { authPasswordRecoveryCompleteCommand } from "../src/shared/commands/auth
13
13
  import { authPasswordResetCommand } from "../src/shared/commands/authPasswordResetCommand.js";
14
14
  import { authLogoutCommand } from "../src/shared/commands/authLogoutCommand.js";
15
15
  import { authSessionReadCommand } from "../src/shared/commands/authSessionReadCommand.js";
16
+ import { authDevLoginAsCommand } from "../src/shared/commands/authDevLoginAsCommand.js";
16
17
 
17
18
  test("auth commands expose canonical operation validator messages", () => {
18
19
  const commands = {
@@ -77,6 +78,15 @@ test("auth command body validators lowercase email inputs", () => {
77
78
  }
78
79
  });
79
80
 
81
+ test("dev login-as accepts an application login selector", () => {
82
+ const result = authDevLoginAsCommand.operation.body.schema.patch({
83
+ login: "merc"
84
+ });
85
+
86
+ assert.equal(result.validatedObject.login, "merc");
87
+ assert.deepEqual(result.errors, {});
88
+ });
89
+
80
90
  test("auth session and oauth start commands expose explicit nested response schemas", () => {
81
91
  const sessionResponseSchema = resolveStructuredSchemaTransportSchema(
82
92
  authSessionReadCommand.operation.response,