@exabugs/dynamodb-client 1.6.0 → 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 +22 -0
- package/README.md +1 -0
- package/dist/server/handler.cjs +10 -5
- package/dist/server/handler.cjs.map +2 -2
- package/dist/server/media-handler.cjs +2 -2
- package/dist/server/media-process-handler-dlq.cjs +2 -2
- package/dist/server/media-process-handler.cjs +2 -2
- package/dist/server/utils/auth.d.ts.map +1 -1
- package/dist/server/utils/auth.js +8 -0
- package/dist/server/utils/auth.js.map +1 -1
- package/dist/server/utils/authHandler.js +1 -1
- package/dist/server/utils/authHandler.js.map +1 -1
- package/dist/sharp-layer.zip +0 -0
- package/package.json +1 -1
- package/terraform/README.md +5 -0
- package/terraform/main.tf +2 -0
- package/terraform/modules/parameter-store/README.md +2 -0
- package/terraform/modules/parameter-store/main.tf +9 -1
- package/terraform/modules/parameter-store/variables.tf +6 -0
- package/terraform/variables.tf +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,28 @@ 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
|
+
|
|
26
|
+
## [1.6.1] - 2026-10-11
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
|
|
30
|
+
- `terraform/modules/parameter-store`: **新規環境への初回デプロイで `terraform plan` が `Invalid count argument` で失敗する不具合を修正**(1.5.3〜1.6.0 が対象)。IAM認証URLのパラメータの個数を、同じ apply で作成する Function URL の属性(初回は未確定)の有無で決めていたため。確定している真偽値の変数 `create_records_iam_url_parameter` を追加し、トップの `terraform/main.tf` は `true` を渡す。変数を渡さない既存の呼び出し元は従来どおりの動作
|
|
31
|
+
|
|
10
32
|
## [1.5.3] - 2026-10-04
|
|
11
33
|
|
|
12
34
|
### 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
|
|
package/dist/server/handler.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// @exabugs/dynamodb-client v1.6.
|
|
2
|
-
// Built: 2026-10-
|
|
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.
|
|
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") {
|