@o3co/create-auth-policy-verifier 0.11.0 → 0.12.0
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 +1 -1
- package/templates/standalone/README.ja.md +1 -0
- package/templates/standalone/README.md +1 -0
- package/templates/standalone/config/application.conf +11 -0
- package/templates/standalone/package.json +1 -1
- package/templates/standalone/src/__tests__/loadConfig.test.mts +2 -1
- package/templates/versions.json +3 -3
package/package.json
CHANGED
|
@@ -50,6 +50,7 @@ OAUTH_JWT_SECRET=$(openssl rand -hex 32) \
|
|
|
50
50
|
| `RULE_ON_EMPTY_RULE_SET` | `deny` | ルールが 1 つも集まらなかったときの決定(`deny` \| `allow`) |
|
|
51
51
|
| `VERIFY_MAX_BATCH_SIZE` | `50` | `POST /verify/batch` の件数上限 |
|
|
52
52
|
| `VERIFY_CREDENTIAL_TO_COLLECTORS` | `never` | `expose` は生の資格情報を `context.credential` として collector に渡す — subject として下流 API を呼ぶ collector のためだけの設定。既定では collector は検証済みクレームだけを扱う。資格情報はリプレイ可能であり、context がログに出ればそれが漏れる |
|
|
53
|
+
| `VERIFY_EVALUATION_IN_RESPONSE` | `omit` | `include` にすると、policy を背後に持つ各 Rule の `evaluation`(status と、評価した policy revision。#244)を決定の response に載せる。どの revision が操作を許可したかを記録する呼び出し側サービス向け。`decision` ログイベントにはどちらの設定でも載る。受理される token の保持者全員に「policy set がいつ変わったか」を伝えることになるので、それが問題になる環境では `HTTP_CALLER_AUTH_TOKEN` と併用する |
|
|
53
54
|
| `LOG_LEVEL` | `info` | 出力する最低レベル: `trace`\|`debug`\|`info`\|`warn`\|`error`\|`fatal`\|`silent`。decision ログのスイッチも兼ねる — [可観測性](#可観測性)を参照 |
|
|
54
55
|
|
|
55
56
|
## HS256 シークレットの強度
|
|
@@ -50,6 +50,7 @@ Individual values can also be overridden with environment variables.
|
|
|
50
50
|
| `RULE_ON_EMPTY_RULE_SET` | `deny` | Decision when no rule is collected (`deny` \| `allow`) |
|
|
51
51
|
| `VERIFY_MAX_BATCH_SIZE` | `50` | Cap on `POST /verify/batch` entries |
|
|
52
52
|
| `VERIFY_CREDENTIAL_TO_COLLECTORS` | `never` | `expose` hands collectors the raw credential as `context.credential` — only for a collector that calls a downstream API as the subject. The default keeps collectors on verified claims; the credential is replayable and a logged context would leak it |
|
|
53
|
+
| `VERIFY_EVALUATION_IN_RESPONSE` | `omit` | `include` puts each policy-backed rule's `evaluation` — its status and the policy revision it evaluated (#244) — on the decision response, for a calling service that records which revision authorized an operation. The `decision` log event carries it either way. It tells any holder of an accepted token when the policy set changed, so pair it with `HTTP_CALLER_AUTH_TOKEN` where that matters |
|
|
53
54
|
| `LOG_LEVEL` | `info` | Minimum level emitted: `trace`\|`debug`\|`info`\|`warn`\|`error`\|`fatal`\|`silent`. Also the switch for the decision log — see [Observability](#observability) |
|
|
54
55
|
|
|
55
56
|
## HS256 secret strength
|
|
@@ -369,4 +369,15 @@ verify {
|
|
|
369
369
|
# then the greppable record of that decision. Never log the field.
|
|
370
370
|
credentialToCollectors = "never"
|
|
371
371
|
credentialToCollectors = ${?VERIFY_CREDENTIAL_TO_COLLECTORS}
|
|
372
|
+
|
|
373
|
+
# Whether a decision RESPONSE carries what each policy-backed rule reported
|
|
374
|
+
# about the evaluation behind its answer — its status, and the policy revision
|
|
375
|
+
# it evaluated (#244). The `decision` log event always carries it; this is
|
|
376
|
+
# only about the wire. "omit" (the default): the response is key-for-key what
|
|
377
|
+
# it was. Set "include" when the calling service records which policy
|
|
378
|
+
# revision authorized an operation. It tells any holder of an accepted token
|
|
379
|
+
# when the policy set changed and whether a denial was a policy's or the
|
|
380
|
+
# engine failing, so pair it with `http.callerAuth` where that matters.
|
|
381
|
+
evaluationInResponse = "omit"
|
|
382
|
+
evaluationInResponse = ${?VERIFY_EVALUATION_IN_RESPONSE}
|
|
372
383
|
}
|
|
@@ -389,7 +389,7 @@ rule { collectors = [ { collector = ResourceActionScopeRuleCollector } ] }
|
|
|
389
389
|
|
|
390
390
|
const config = loadAppConfig(withoutVerify(), "development");
|
|
391
391
|
|
|
392
|
-
//
|
|
392
|
+
// Every one, spelled out. A knob that reached the shape but not the
|
|
393
393
|
// block's `.default()` literal is `undefined` here, and `toEqual` says
|
|
394
394
|
// which one.
|
|
395
395
|
expect(config.verify).toEqual({
|
|
@@ -406,6 +406,7 @@ rule { collectors = [ { collector = ResourceActionScopeRuleCollector } ] }
|
|
|
406
406
|
collectorConcurrency: 8,
|
|
407
407
|
batchConcurrency: 8,
|
|
408
408
|
credentialToCollectors: "never",
|
|
409
|
+
evaluationInResponse: "omit",
|
|
409
410
|
});
|
|
410
411
|
});
|
|
411
412
|
|
package/templates/versions.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"@o3co/auth.policy-verifier.core": "0.
|
|
3
|
-
"@o3co/auth.policy-verifier.builtins": "0.
|
|
4
|
-
"@o3co/auth.policy-verifier.server": "0.
|
|
2
|
+
"@o3co/auth.policy-verifier.core": "0.12.0",
|
|
3
|
+
"@o3co/auth.policy-verifier.builtins": "0.12.0",
|
|
4
|
+
"@o3co/auth.policy-verifier.server": "0.12.0"
|
|
5
5
|
}
|