Files
knowledge-governance/internal/objectgateway/claim_context.go
T
姚章浩 5eef13b615 feat(object-gateway): 统一对象写网关与不可变治理日志
方案A:所有对象写入经 loopback 网关,持久计划/grant/intent/逐版本 receipt 与
attempt→grant delivery 落在治理 PG;scope 由 provider+endpoint+bucket 决定,
同一物理桶只允许一个写域。版本 append 不等于 CAS,未锚定计划在首笔业务写前拒绝。

本提交只含网关与其适配层接线、协议文档;生产独占、凭据切换与桶设置未改动。
2026-11-01 11:35:05 +08:00

16 lines
454 B
Go

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
}