@o3co/auth-provider-foundation 0.16.0 → 0.17.0-rc.2

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 (39) hide show
  1. package/README.ja.md +154 -29
  2. package/README.md +482 -45
  3. package/config/reference.conf +20 -0
  4. package/dist/endpointUrl.d.mts +21 -47
  5. package/dist/endpointUrl.d.mts.map +1 -1
  6. package/dist/endpointUrl.mjs +23 -50
  7. package/dist/index.d.mts +5 -1
  8. package/dist/index.d.mts.map +1 -1
  9. package/dist/index.mjs +18 -35
  10. package/dist/mfa/HttpMfaFactorStore.d.mts +55 -0
  11. package/dist/mfa/HttpMfaFactorStore.d.mts.map +1 -0
  12. package/dist/mfa/HttpMfaFactorStore.mjs +183 -0
  13. package/dist/mfa/markEnrolled.d.mts +4 -0
  14. package/dist/mfa/markEnrolled.d.mts.map +1 -0
  15. package/dist/mfa/markEnrolled.mjs +31 -0
  16. package/dist/mfa/module.d.mts +27 -0
  17. package/dist/mfa/module.d.mts.map +1 -0
  18. package/dist/mfa/module.mjs +56 -0
  19. package/dist/mfa/section.d.mts +45 -0
  20. package/dist/mfa/section.d.mts.map +1 -0
  21. package/dist/mfa/section.mjs +99 -0
  22. package/dist/mfa/storeFailure.d.mts +52 -0
  23. package/dist/mfa/storeFailure.d.mts.map +1 -0
  24. package/dist/mfa/storeFailure.mjs +107 -0
  25. package/dist/repositories/HttpUserRepository.d.mts +54 -79
  26. package/dist/repositories/HttpUserRepository.d.mts.map +1 -1
  27. package/dist/repositories/HttpUserRepository.mjs +117 -413
  28. package/dist/repositories/storeErrors.d.mts +18 -27
  29. package/dist/repositories/storeErrors.d.mts.map +1 -1
  30. package/dist/repositories/storeErrors.mjs +30 -40
  31. package/dist/repositories/wwwAuthenticate.d.mts.map +1 -1
  32. package/dist/repositories/wwwAuthenticate.mjs +12 -16
  33. package/dist/storeTransport.d.mts +97 -0
  34. package/dist/storeTransport.d.mts.map +1 -0
  35. package/dist/storeTransport.mjs +290 -0
  36. package/dist/testing/index.d.mts +28 -0
  37. package/dist/testing/index.d.mts.map +1 -0
  38. package/dist/testing/index.mjs +58 -0
  39. package/package.json +18 -7
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/testing/index.mts"],"names":[],"mappings":"AAgBA;;;GAGG;AAEH,OAAO,EACN,mCAAmC,EACnC,KAAK,4BAA4B,EACjC,MAAM,oBAAoB,CAAC;AAI5B,4FAA4F;AAC5F,QAAA,MAAM,wBAAwB,+IAMpB,CAAC;AAEX,4EAA4E;AAC5E,MAAM,MAAM,4BAA4B,GAAG,QAAQ,CAClD,MAAM,CAAC,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAC1D,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC7C,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,4BAA4B,EAAE,OAAO,CAAC,CAAC,CAAC,EAC5E,KAAK,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAM,GAC3C;IAAE,QAAQ,CAAC,CAAC,mCAAmC,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;CAAE,CAMvF;AAED;;;;;;GAMG;AACH,wBAAgB,kCAAkC,CACjD,IAAI,EAAE,OAAO,CAAC,4BAA4B,CAAC,EAC3C,KAAK,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAM,GAC3C,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAMnC"}
@@ -0,0 +1,58 @@
1
+ /*
2
+ * Copyright 2026 1o1 Co. Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /**
17
+ * `@o3co/auth-provider-foundation/testing`: what a test uses to configure
18
+ * this package's modules. Test code imports it; production code never does.
19
+ */
20
+ import { FOUNDATION_MFA_FACTOR_STORE_SECTION, } from "../mfa/section.mjs";
21
+ const URL_KEYS = ["listUrl", "createUrl", "updateUrl", "deleteUrl"];
22
+ /** The Store URLs the `"http"` user adapter's builder reads (`registerBuiltinAdapters`). */
23
+ const USER_REPOSITORY_URL_KEYS = [
24
+ "authenticateUrl",
25
+ "authenticateByTokenUrl",
26
+ "linkFederatedIdentityUrl",
27
+ "findSubjectByFederatedIdentityUrl",
28
+ "markMfaEnrolledUrl",
29
+ ];
30
+ /**
31
+ * The `foundation-mfa-factor-store` section as a configuration fragment to
32
+ * lay over a test's configuration: the four URLs `urls` holds — a fake
33
+ * Store's `urls` included, its other endpoints left behind — and `extra`
34
+ * as given.
35
+ */
36
+ export function foundationMfaFactorStoreConfig(urls, extra = {}) {
37
+ const section = {};
38
+ for (const key of URL_KEYS) {
39
+ if (urls[key] !== undefined)
40
+ section[key] = urls[key];
41
+ }
42
+ return { [FOUNDATION_MFA_FACTOR_STORE_SECTION]: { ...section, ...extra } };
43
+ }
44
+ /**
45
+ * The user repository's `http` block, as the `"http"` builder reads it: the
46
+ * Store URLs `urls` holds — a fake Store's `urls` included, its MFA factor
47
+ * endpoints left behind — and `extra` as given. A test hands it to the
48
+ * `"http"` builder, or to `foundationMfaFactorStoreModule` as its
49
+ * `storeTransport`.
50
+ */
51
+ export function foundationUserRepositoryHttpConfig(urls, extra = {}) {
52
+ const block = {};
53
+ for (const key of USER_REPOSITORY_URL_KEYS) {
54
+ if (urls[key] !== undefined)
55
+ block[key] = urls[key];
56
+ }
57
+ return { ...block, ...extra };
58
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@o3co/auth-provider-foundation",
3
3
  "description": "Production HTTP user-authentication adapter for auth.provider",
4
- "version": "0.16.0",
4
+ "version": "0.17.0-rc.2",
5
5
  "license": "Apache-2.0",
6
6
  "engines": {
7
7
  "node": ">=22.0.0"
@@ -13,10 +13,16 @@
13
13
  ".": {
14
14
  "import": "./dist/index.mjs",
15
15
  "types": "./dist/index.d.mts"
16
- }
16
+ },
17
+ "./testing": {
18
+ "import": "./dist/testing/index.mjs",
19
+ "types": "./dist/testing/index.d.mts"
20
+ },
21
+ "./reference.conf": "./config/reference.conf"
17
22
  },
18
23
  "files": [
19
24
  "dist",
25
+ "config",
20
26
  "README.md"
21
27
  ],
22
28
  "repository": {
@@ -30,15 +36,20 @@
30
36
  "default": "./dist/*"
31
37
  }
32
38
  },
39
+ "dependencies": {
40
+ "zod": "^4.6.5"
41
+ },
33
42
  "peerDependencies": {
34
- "@o3co/auth-provider-core": "^0.16.0"
43
+ "@o3co/auth-provider-core": "^0.17.0-rc.2"
35
44
  },
36
45
  "devDependencies": {
37
- "@types/node": "^26.5.1",
46
+ "@types/node": "^26.6.3",
38
47
  "msw": "^2.15.0",
39
- "vitest": "^5.0.0",
40
- "@vitest/coverage-v8": "^5.0.0",
41
- "@o3co/auth-provider-core": "0.16.0"
48
+ "vitest": "^5.0.2",
49
+ "@vitest/coverage-v8": "^5.0.2",
50
+ "@o3co/ts.hocon": "^1.13.0",
51
+ "@o3co/auth-provider-test-kit": "0.17.0-rc.2",
52
+ "@o3co/auth-provider-core": "0.17.0-rc.2"
42
53
  },
43
54
  "scripts": {
44
55
  "prebuild": "rimraf dist",