solid-odrl
Use when building, parsing, evaluating, or recording ODRL usage policies, including recipient PartyCollection membership through an injected resolver.
- License 许可
- MIT
- 所属仓库
- jeswr/solid-sdk
- 最近更新
- 2026-11-15
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- solid-odrl
- description
- Use when building, parsing, evaluating, or recording ODRL usage policies, including recipient PartyCollection membership through an injected resolver.
02 资源文件 38
- 参考文档config/api-extractor.json1.0 KB
- 参考文档docs/DECISIONS.md10.7 KB
- 参考文档docs/delegation-profile.md21.1 KB
- 参考文档etc/solid-odrl.api.md13.3 KB
- 许可证LICENSE1.0 KB
- 参考文档package.json2.7 KB
- 参考文档README.md5.3 KB
- 脚本scripts/build-deps.mjs5.7 KB
- 脚本scripts/build-dist.mjs6.8 KB
- 脚本scripts/sanitize-dist.mjs14.1 KB
- 脚本src/action-provenance.ts7.2 KB
- 脚本src/compose.ts4.9 KB
- 脚本src/decision-record.ts23.0 KB
- 脚本src/delegation.ts23.5 KB
- 脚本src/evaluate.ts19.6 KB
- 脚本src/index.ts5.5 KB
- 脚本src/policy.ts28.1 KB
- 脚本src/serialize.ts1.8 KB
- 脚本src/types.ts9.1 KB
- 脚本src/vocab.ts39.5 KB
- 脚本src/wrappers.ts14.5 KB
- 其他test/__snapshots__/characterization.test.ts.snap34.9 KB
- 脚本test/action-provenance.test.ts11.6 KB
- 脚本test/characterization.test.ts19.7 KB
- 脚本test/compose.test.ts11.9 KB
- 脚本test/decision-record.test.ts37.9 KB
- 脚本test/delegation.test.ts36.7 KB
- 脚本test/dist-sanitize.test.ts13.7 KB
- 脚本test/evaluate.test.ts19.3 KB
- 脚本test/index.test.ts2.2 KB
- 脚本test/iri.test.ts21.9 KB
- 脚本test/namespaces.test.ts5.6 KB
- 脚本test/party-collection.test.ts22.9 KB
- 脚本test/policy.test.ts11.4 KB
- 参考文档tsconfig.build.json222 B
- 参考文档tsconfig.json568 B
- 参考文档tsconfig.test.json264 B
- 脚本vitest.config.ts438 B
03 SKILL.md 正文
<!-- AUTHORED-BY Codex GPT-6.1-Sol -->
ODRL policies and recipient collections
Read the repository AGENTS.md and this package's
README. This package is security-critical. Keep policy evaluation
pure and deny by default unless the result is permit; notApplicable grants
nothing. Duties are advisory unless requireDuties: true is supplied.
Use policyToRdf, policyToTurtle, and policyToJsonLd to express policies, and
parsePolicy/policyFromRdf to read them. Parsing uses @jeswr/fetch-rdf, RDF
access uses the typed wrappers in src/wrappers.ts, and serialization uses
n3.Writer through serialize. Use these paths in tests and examples too; never
hand-build triples or concatenate Turtle.
Recipient membership
Express membership as an OdrlConstraint with leftOperand: "recipient",
operator: "isPartOf", and rightOperand equal to one absolute PartyCollection
IRI. This uses standard ODRL 2.2 terms (ODRL_IS_PART_OF exports
http://www.w3.org/ns/odrl/2/isPartOf); mint no collection operators or vocabulary.
The request supplies one absolute recipient IRI in attributes.recipient.
Inject EvaluateOptions.resolvePartyCollection with signature
(collectionIri: string) => ReadonlySet<string> | undefined. Return a trusted,
stable snapshot of the collection's party IRIs, or undefined for unknown
collections. Membership is exact lexical IRI equality; do not normalize WebIDs
or infer membership from their origin. The evaluator never fetches or requires
an RDF type declaration for the collection inside the policy.
Fail closed: a missing resolver, unknown/empty collection, resolver exception,
non-member, missing/non-IRI/array recipient, or malformed collection operand
cannot satisfy membership. Only recipient is supported with isPartOf, and
its right operand must be a single IRI without a literal datatype. Serializers
reject unsupported forms. The parser retains malformed membership as an
unsatisfied constraint rather than dropping it and widening a permission.
Permissions and duties require positively satisfied membership. For prohibitions,
missing/invalid operands or unavailable membership evidence are indeterminate,
distinct from confirmed nonmembership. An otherwise applicable indeterminate
prohibition forces deny before conflict resolution, even with conflict: "perm".
A mismatched action, target, assignee, or another unsatisfied constraint rules out
the prohibition. Only confirmed matches appear in matchedProhibitions; the
decision reason explains indeterminate denials. A satisfied prohibition denies
under the default prohibit conflict strategy. With no matching or indeterminate
rules, evaluate returns notApplicable; enforcement callers must default deny.
The resolver flows through evaluate, evaluateDelegated, matchingPermissions, duty constraints,
constraintSatisfied(c, request, now, options), and recordEvaluation.
For separate decisionRecord/decisionRecordJsonLd calls, pass the same resolver
in DecisionRecordInput.resolvePartyCollection and the same evaluation clock in
evaluatedAt. Keep the snapshot stable across these calls so anonymous rules
resolve to the constraints that actually decided the result. Prefer
recordEvaluation to pass the clock and resolver together automatically.
Verification
Cover members and non-members, resolver absence/failure, malformed operands, prohibitions, duties, RDF round trips, and decision-record attribution with fixture tests. Run the package lint, build, typecheck, and test scripts in that order; follow the repository's affected and full gate requirements before finishing.
04 同仓库更多 Skills
storage-conformance
Work on @jeswr/storage-conformance, the shared storage conformance suite package in the Solid SDK workspace.
fetch-rdf-engine-tests
Maintain fetch-rdf's real Node WASM parser integration tests without introducing a reverse engine dependency in fetch-rdf.
alpha
Use when checking fixtures, including folded YAML descriptions.
widget
Use when testing package skills: YAML quoting works.
web-seo
Use when improving technical and entity SEO for a modern personal, portfolio, documentation, or marketing site, including crawlable HTML, canonical metadata, sitemap and robots, Person/ProfilePage JSON-LD, Core Web Vitals, and honest ranking expectations.
solid-wac
Use when implementing or auditing Solid server WAC authorization, ACL creation and inheritance, auxiliary-resource escalation, method-to-mode mapping, 401 versus 403 challenges, WAC-Allow, or defensive typed ACL parsing with @solid/object and @rdfjs/wrapper.