证据时点与用途
原能力
核对材料版本、可得时间与许可范围,保留结论引用时的快照。(细化版 p.14–15)
首选项目
DVC(Apache-2.0)。 DVC
匹配范围
版本记录和对象授权判断支持快照与访问。
源码
DVC · def to_lockfile(
dvc/stage/serialize.py · 195–208 行。 在 GitHub 查看源码 · 许可证与声明
源码片段
def to_lockfile(stage: "PipelineStage", **kwargs) -> dict:
assert stage.name
return {stage.name: to_single_stage_lockfile(stage, **kwargs)}
def to_single_stage_file(stage: "Stage", **kwargs):
state = stage.dumpd(**kwargs)
# When we load a stage we parse yaml with a fast parser, which strips
# off all the comments and formatting. To retain those on update we do
# a trick here:
# - reparse the same yaml text with a slow but smart ruamel yaml parser
# - apply changes to a returned structure
# - serialize it
OpenFGA · func (s *Server) Check(
pkg/server/check.go · 37–50 行。 在 GitHub 查看源码 · 许可证与声明
源码片段
func (s *Server) Check(ctx context.Context, req *openfgav1.CheckRequest) (*openfgav1.CheckResponse, error) {
const methodName = "check"
startTime := time.Now()
tk := req.GetTupleKey()
ctx, span := tracer.Start(ctx, apimethod.Check.String(), trace.WithAttributes(
attribute.KeyValue{Key: "store_id", Value: attribute.StringValue(req.GetStoreId())},
attribute.KeyValue{Key: "object", Value: attribute.StringValue(tk.GetObject())},
attribute.KeyValue{Key: "relation", Value: attribute.StringValue(tk.GetRelation())},
attribute.KeyValue{Key: "user", Value: attribute.StringValue(tk.GetUser())},
attribute.KeyValue{Key: "consistency", Value: attribute.StringValue(req.GetConsistency().String())},
))
defer span.End()
实现与验收要点
获取时点、真实用途权源、过期及撤销后的证据效力。