@jskit-ai/oidc-issuer-core 0.1.20 → 0.1.22

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/oidc-issuer-core",
3
- "version": "0.1.20",
3
+ "version": "0.1.22",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "test": "jskit test"
@@ -113,16 +113,16 @@
113
113
  }
114
114
  },
115
115
  "dependencies": {
116
- "@jskit-ai/database-runtime": "0.1.261",
117
116
  "jose": "6.2.12",
118
117
  "knex": "^3.1.0",
119
118
  "nodemailer": "10.2.1",
120
119
  "oidc-provider": "9.12.2"
121
120
  },
122
121
  "devDependencies": {
123
- "@jskit-ai/auth-provider-local-core": "0.2.15"
122
+ "@jskit-ai/auth-provider-local-core": "0.2.17"
124
123
  },
125
124
  "peerDependencies": {
126
- "@jskit-ai/kernel": "0.2.12"
125
+ "@jskit-ai/database-runtime": "0.1.263",
126
+ "@jskit-ai/kernel": "0.2.14"
127
127
  }
128
128
  }
@@ -2,7 +2,8 @@
2
2
  "private": true,
3
3
  "type": "module",
4
4
  "dependencies": {
5
- "@jskit-ai/database-runtime-mysql": "0.1.259",
6
- "@jskit-ai/oidc-issuer-core": "0.1.20"
5
+ "@jskit-ai/database-runtime": "0.1.263",
6
+ "@jskit-ai/database-runtime-mysql": "0.1.261",
7
+ "@jskit-ai/oidc-issuer-core": "0.1.22"
7
8
  }
8
9
  }
@@ -1,3 +1,5 @@
1
+ // readable-check: allow no-direct-knex - infrastructure: the accounts hub's own sign-in accounts (oidc_issuer_accounts), the identity backend of its OpenID provider
2
+
1
3
  import { readFileSync } from "node:fs";
2
4
  import { createAccountId, hashPassword, verifyPassword } from "./crypto.js";
3
5
  import { hubEnglish } from "./hubTexts.js";
@@ -1,3 +1,5 @@
1
+ // readable-check: allow no-direct-knex - infrastructure: node-oidc-provider's storage adapter, which keeps the provider's protocol models (interactions, sessions, grants, codes and tokens) in oidc_issuer_models through the library's adapter interface
2
+
1
3
  const MODELS_TABLE = "oidc_issuer_models";
2
4
 
3
5
  function toDate(value) {
@@ -1,3 +1,5 @@
1
+ // readable-check: allow no-direct-knex - infrastructure: the OpenID provider's registered relying-party clients (oidc_issuer_clients) and the protocol models they own, the provider's protocol state
2
+
1
3
  import { isLoopbackHostname } from "./config.js";
2
4
  import { MODELS_TABLE } from "./adapter.js";
3
5
 
@@ -1,3 +1,5 @@
1
+ // readable-check: allow no-direct-knex - infrastructure: the accounts hub's single-use emailed link tokens (oidc_issuer_email_tokens), protocol state of its confirmation, recovery and Google-link flows
2
+
1
3
  import { randomToken, sha256 } from "./crypto.js";
2
4
 
3
5
  const EMAIL_TOKENS_TABLE = "oidc_issuer_email_tokens";
@@ -47,4 +49,4 @@ function createEmailTokenStore({ knex, now }) {
47
49
  });
48
50
  }
49
51
 
50
- export { createEmailTokenStore };
52
+ export { EMAIL_TOKENS_TABLE, createEmailTokenStore };
package/src/server/hub.js CHANGED
@@ -1,3 +1,4 @@
1
+ // readable-check: allow no-direct-knex - infrastructure: the accounts hub, which hands the application's Knex to its own protocol stores
1
2
  import { createAccountStore } from "./accounts.js";
2
3
  import { createKnexAdapterClass, deleteExpiredModels } from "./adapter.js";
3
4
  import { createClientStore } from "./clients.js";
@@ -1,3 +1,5 @@
1
+ // readable-check: allow no-direct-knex - infrastructure: the accounts hub's own browser sessions and settings, kept as models in node-oidc-provider's oidc_issuer_models table beside the provider's protocol state
2
+
1
3
  import { MODELS_TABLE } from "./adapter.js";
2
4
  import { randomToken, sha256 } from "./crypto.js";
3
5
 
@@ -1,3 +1,4 @@
1
+ // readable-check: allow no-direct-knex - infrastructure: an operator's one-off import of accounts into the hub's own account table
1
2
  import { createAccountStore, isEmail, normalizeEmail } from "./accounts.js";
2
3
  import { systemClock } from "./clock.js";
3
4
 
@@ -1,5 +1,20 @@
1
+ import { ACCOUNTS_TABLE } from "./accounts.js";
2
+ import { MODELS_TABLE } from "./adapter.js";
3
+ import { CLIENTS_TABLE } from "./clients.js";
4
+ import { EMAIL_TOKENS_TABLE } from "./emailTokens.js";
5
+ import { RATE_LIMITS_TABLE } from "./rateLimits.js";
6
+ import { SIGNING_KEYS_TABLE } from "./signingKeys.js";
7
+
1
8
  export { HubConfigError, resolveHubConfig } from "./config.js";
2
9
  export { hashPassword, verifyPassword } from "./crypto.js";
3
10
  export { describeImport, importAccounts } from "./importAccounts.js";
4
11
  export { HUB_GLOBAL_PATHS, createOidcIssuer } from "./issuer.js";
5
12
  export { runPreviewIdentityCommand } from "./previewIdentity.js";
13
+
14
+ // The tables the accounts hub keeps outside table resources (its OpenID provider's protocol state, signing keys, own
15
+ // accounts and rate limits), for an app test's expectEveryTableOwned infrastructureTables.
16
+ const OIDC_ISSUER_INFRASTRUCTURE_TABLES = Object.freeze([
17
+ ACCOUNTS_TABLE, CLIENTS_TABLE, EMAIL_TOKENS_TABLE, MODELS_TABLE, RATE_LIMITS_TABLE, SIGNING_KEYS_TABLE
18
+ ]);
19
+
20
+ export { OIDC_ISSUER_INFRASTRUCTURE_TABLES };
@@ -1,3 +1,4 @@
1
+ // readable-check: allow no-direct-knex - infrastructure: the OpenID provider's entry, which hands the application's Knex to the hub
1
2
  import { RegistrationError, validateRegistrationMetadata } from "./clients.js";
2
3
  import { systemClock } from "./clock.js";
3
4
  import { resolveHubConfig, resolveHubDevAuth } from "./config.js";
@@ -1,3 +1,5 @@
1
+ // readable-check: allow no-direct-knex - infrastructure: hands the application's Knex to the accounts hub, the OpenID provider whose protocol state, signing keys, identity backend and rate limits the data-access spec keeps as infrastructure
2
+
1
3
  import { defineProvider } from "@jskit-ai/kernel/shared/capabilities";
2
4
  import { createOidcIssuer } from "../issuer.js";
3
5
 
@@ -1,3 +1,5 @@
1
+ // readable-check: allow no-direct-knex - infrastructure: the accounts hub's fixed-window rate-limit counters (oidc_issuer_rate_limits), each hit counted under its row's lock in a transaction of its own
2
+
1
3
  const RATE_LIMITS_TABLE = "oidc_issuer_rate_limits";
2
4
 
3
5
  const LIMITS = Object.freeze({
@@ -51,4 +53,4 @@ function createRateLimiter({ knex, now }) {
51
53
  });
52
54
  }
53
55
 
54
- export { createRateLimiter };
56
+ export { RATE_LIMITS_TABLE, createRateLimiter };
@@ -1,3 +1,5 @@
1
+ // readable-check: allow no-direct-knex - infrastructure: the OpenID provider's encrypted ID token signing keys (oidc_issuer_signing_keys), rotated and published in its JWKS
2
+
1
3
  import { exportJWK, generateKeyPair } from "jose";
2
4
  import { HubConfigError } from "./config.js";
3
5
  import { decrypt, deriveKey, encrypt, randomToken } from "./crypto.js";
@@ -86,4 +88,4 @@ function createSigningKeyStore({ knex, secret, now }) {
86
88
  });
87
89
  }
88
90
 
89
- export { createSigningKeyStore };
91
+ export { SIGNING_KEYS_TABLE, createSigningKeyStore };