@exabugs/dynamodb-client 1.6.1 → 1.6.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.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.6.2] - 2026-10-11
11
+
12
+ ### Security
13
+
14
+ - `COGNITO_CLIENT_ID` 未設定のとき、JWT の `aud` 検証が無効であることを示す**警告ログ**を出す(コールドスタートごとに1回)。挙動は変えない。未設定だと同じユーザープールの別アプリクライアントのトークンも通る
15
+ - デバッグログ(`Cognito JWT verified`)から `email` を除いた(個人情報。追跡は `sub`)
16
+
17
+ ### CI
18
+
19
+ - リポジトリを非公開にしたため、`npm publish` から `--provenance` を外した(provenance は公開リポジトリでのみ生成できる)。公開リポジトリに戻す場合は復活させる
20
+
21
+ ### Docs
22
+
23
+ - `docs/AUTHORIZATION.md` を新設: 認可モデル(JWT の有効性しか検証しない)、管理者専用ユーザープール、フェデレーションログインの許可制(Pre Token Generation の例)、`aud` 検証、MFA の限界、チェックリスト
24
+ - `terraform/README.md`: pnpm 利用時、版を上げた後は `.terraform/modules` を削除して `terraform init` する注意を追加。`terraform/variables.tf` の `cognito_client_id` の説明を明確化
25
+
10
26
  ## [1.6.1] - 2026-10-11
11
27
 
12
28
  ### Fixed
package/README.md CHANGED
@@ -194,6 +194,7 @@ const article = await articles.findOne({ title: 'Hello DynamoDB' });
194
194
  - **[Architecture](docs/ARCHITECTURE.md)** - System architecture and design
195
195
  - **[Client Usage](docs/CLIENT_USAGE.md)** - Client-side API guide
196
196
  - **[React Admin Integration](docs/react-admin-integration.md)** - Admin UI setup and many-to-many relationships
197
+ - **[Authorization & Secure Setup](docs/AUTHORIZATION.md)** - 認可モデルと安全な構成(必読。JWT の有効性しか検証しない/管理者専用ユーザープール/`aud` 検証)
197
198
  - **[Deployment](docs/DEPLOYMENT.md)** - Production deployment guide
198
199
  - **[Terraform Modules](terraform/README.md)** - Infrastructure as Code
199
200
 
@@ -1,5 +1,5 @@
1
- // @exabugs/dynamodb-client v1.6.1
2
- // Built: 2026-10-11T12:45:55.244Z
1
+ // @exabugs/dynamodb-client v1.6.2
2
+ // Built: 2026-10-11T14:15:49.129Z
3
3
  "use strict";
4
4
  var __create = Object.create;
5
5
  var __defProp = Object.defineProperty;
@@ -38417,6 +38417,12 @@ var verifierInstance = null;
38417
38417
  function getVerifier(userPoolId, clientId) {
38418
38418
  if (!verifierInstance) {
38419
38419
  logger21.debug("Creating JWT verifier instance", { userPoolId, clientId });
38420
+ if (!clientId) {
38421
+ logger21.warn(
38422
+ "COGNITO_CLIENT_ID is not set: JWT audience (aud) verification is DISABLED. Tokens issued to ANY app client of this user pool are accepted. Set cognito_client_id (Terraform) / COGNITO_CLIENT_ID in production. See docs/AUTHORIZATION.md",
38423
+ { userPoolId }
38424
+ );
38425
+ }
38420
38426
  verifierInstance = CognitoJwtVerifier.create({
38421
38427
  userPoolId,
38422
38428
  tokenUse: "id",
@@ -38513,8 +38519,7 @@ async function handleCognitoAuthentication(authHeader, requestId) {
38513
38519
  const jwtPayload = await verifyAuthHeader(authHeader, userPoolId, clientId);
38514
38520
  logger22.debug("Cognito JWT verified", {
38515
38521
  requestId,
38516
- sub: jwtPayload.sub,
38517
- email: jwtPayload.email
38522
+ sub: jwtPayload.sub
38518
38523
  });
38519
38524
  }
38520
38525
  __name(handleCognitoAuthentication, "handleCognitoAuthentication");
@@ -38701,7 +38706,7 @@ async function handler(event) {
38701
38706
  return createCorsResponse(HTTP_STATUS.OK);
38702
38707
  }
38703
38708
  if (event.requestContext.http.method === "GET" && event.requestContext.http.path === "/version") {
38704
- const version = "1.6.1";
38709
+ const version = "1.6.2";
38705
38710
  return createSuccessResponse({ version, timestamp: (/* @__PURE__ */ new Date()).toISOString() }, requestId);
38706
38711
  }
38707
38712
  if (event.requestContext.http.method !== "POST") {