feat(object-gateway): 统一对象写网关与不可变治理日志

方案A:所有对象写入经 loopback 网关,持久计划/grant/intent/逐版本 receipt 与
attempt→grant delivery 落在治理 PG;scope 由 provider+endpoint+bucket 决定,
同一物理桶只允许一个写域。版本 append 不等于 CAS,未锚定计划在首笔业务写前拒绝。

本提交只含网关与其适配层接线、协议文档;生产独占、凭据切换与桶设置未改动。
This commit is contained in:
姚章浩
2026-11-01 11:35:05 +08:00
parent d0c6d57283
commit 5eef13b615
29 changed files with 3287 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
package objectgateway
import "context"
type claimContextKey struct{}
// WithClaim is set by the owned-attempt runner, never from an HTTP caller's
// proposed plan. The controller independently checks every field against PG.
func WithClaim(ctx context.Context, c Claim) context.Context {
return context.WithValue(ctx, claimContextKey{}, c)
}
func ClaimFromContext(ctx context.Context) Claim {
c, _ := ctx.Value(claimContextKey{}).(Claim)
return c
}