@pikku/kysely 0.12.13 → 0.12.14

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 CHANGED
@@ -1,3 +1,17 @@
1
+ ## 0.12.14
2
+
3
+ ### Patch Changes
4
+
5
+ - 4b5c75b: feat(auth-js): wire OIDC config (issuer/tenantId) as variables, expand provider registry
6
+ - Move `issuer` and `tenantId` out of the secret blob for OIDC providers (auth0, okta, azure-ad, keycloak, cognito, microsoft-entra-id) — they are public config URLs, not secrets. Now registered via `wireVariable` and loaded at runtime via `services.variables.get()`.
7
+ - Expand provider registry from 13 to 31 providers: reddit, notion, instagram, zoom, figma, tiktok, threads, patreon, dropbox, bitbucket, hubspot, salesforce, atlassian, strava, keycloak, cognito, microsoft-entra-id added.
8
+ - `serialize-auth-gen` emits `wireVariable({...})` declarations and `services.variables.get()` calls in the generated factory for OIDC providers.
9
+ - Integration verifier exercises real `/auth/providers` endpoint with `LocalSecretService` + `LocalVariablesService`, including a spy test proving `services.variables.get('AUTH0_ISSUER')` is called at request time.
10
+
11
+ - Updated dependencies [4b5c75b]
12
+ - Updated dependencies [4b5c75b]
13
+ - @pikku/core@0.12.27
14
+
1
15
  ## 0.12.13
2
16
 
3
17
  ### Patch Changes
@@ -24,5 +24,6 @@ export declare class KyselySecretService implements SecretService {
24
24
  hasSecret(key: string): Promise<boolean>;
25
25
  setSecret(key: string, value: unknown): Promise<void>;
26
26
  deleteSecret(key: string): Promise<void>;
27
+ getSecrets(keys: string[]): Promise<Record<string, unknown>>;
27
28
  rotateKEK(): Promise<number>;
28
29
  }
@@ -110,6 +110,24 @@ export class KyselySecretService {
110
110
  await this.db.deleteFrom('secrets').where('key', '=', key).execute();
111
111
  await this.logAudit(key, 'delete');
112
112
  }
113
+ async getSecrets(keys) {
114
+ const rows = await this.db
115
+ .selectFrom('secrets')
116
+ .select(['key', 'ciphertext', 'wrappedDek', 'keyVersion'])
117
+ .where('key', 'in', keys)
118
+ .execute();
119
+ const out = {};
120
+ for (const row of rows) {
121
+ try {
122
+ const kek = this.getKEK(row.keyVersion);
123
+ out[row.key] = await envelopeDecrypt(kek, row.ciphertext, row.wrappedDek);
124
+ }
125
+ catch {
126
+ // skip secrets that fail to decrypt
127
+ }
128
+ }
129
+ return out;
130
+ }
113
131
  async rotateKEK() {
114
132
  if (!this.previousKey) {
115
133
  throw new Error('No previousKey configured — nothing to rotate from');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pikku/kysely",
3
- "version": "0.12.13",
3
+ "version": "0.12.14",
4
4
  "author": "yasser.fadl@gmail.com",
5
5
  "license": "MIT",
6
6
  "module": "dist/src/index.js",
@@ -20,7 +20,7 @@
20
20
  "prepublishOnly": "yarn build"
21
21
  },
22
22
  "peerDependencies": {
23
- "@pikku/core": "^0.12.26"
23
+ "@pikku/core": "^0.12.27"
24
24
  },
25
25
  "dependencies": {
26
26
  "kysely": "^0.28.12"
@@ -33,5 +33,8 @@
33
33
  "kysely-postgres-js": "^3.0.0",
34
34
  "postgres": "^3.4.8",
35
35
  "typescript": "^5.9"
36
+ },
37
+ "exports": {
38
+ ".": "./dist/src/index.js"
36
39
  }
37
40
  }
@@ -149,6 +149,29 @@ export class KyselySecretService implements SecretService {
149
149
  await this.logAudit(key, 'delete')
150
150
  }
151
151
 
152
+ async getSecrets(keys: string[]): Promise<Record<string, unknown>> {
153
+ const rows = await this.db
154
+ .selectFrom('secrets')
155
+ .select(['key', 'ciphertext', 'wrappedDek', 'keyVersion'])
156
+ .where('key', 'in', keys)
157
+ .execute()
158
+
159
+ const out: Record<string, unknown> = {}
160
+ for (const row of rows) {
161
+ try {
162
+ const kek = this.getKEK(row.keyVersion)
163
+ out[row.key] = await envelopeDecrypt(
164
+ kek,
165
+ row.ciphertext,
166
+ row.wrappedDek
167
+ )
168
+ } catch {
169
+ // skip secrets that fail to decrypt
170
+ }
171
+ }
172
+ return out
173
+ }
174
+
152
175
  async rotateKEK(): Promise<number> {
153
176
  if (!this.previousKey) {
154
177
  throw new Error('No previousKey configured — nothing to rotate from')