{"_id":"@dokieli/web-access-control","name":"@dokieli/web-access-control","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@dokieli/web-access-control","version":"1.0.0","description":"Web Access Control (WAC) client library: WAC-Allow header interpretation, effective ACL resource discovery, authorization queries, and pure ACL patch planning. The library allows clients to use their own RDF parsers and HTTP stacks.","type":"module","packageManager":"yarn@4.17.0","author":{"name":"dokieli"},"license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/dokieli/web-access-control.git"},"bugs":{"url":"https://github.com/dokieli/web-access-control/issues"},"homepage":"https://dokieli.github.io/web-access-control/","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"publishConfig":{"access":"public"},"scripts":{"build":"tsc","docs":"typedoc","prepare":"tsc","lint":"eslint .","lint:fix":"eslint . --fix","test":"vitest run","test:all":"vitest run && tsc --noEmit"},"keywords":["access control","acl","authorization","n3-patch","sparql-update","turtle","typescript","w3c","wac","web access control","web standards"],"devDependencies":{"@types/n3":"^1.26.1","@types/node":"^25.5.2","@types/rdfjs__data-model":"^2","@typescript-eslint/parser":"^8.63.0","eslint":"^10.6.0","eslint-plugin-license-header":"^0.9.0","typedoc":"^0.28.20","typescript":"^6.0.2","vitest":"^3.0.0"},"dependencies":{"@rdfjs/data-model":"^2.1.1","@rdfjs/types":"^2.0.1","n3":"^2.2.0"},"_id":"@dokieli/web-access-control@1.0.0","gitHead":"6cdb883bafb94ab531cee9450a1d7856df0daec7","_nodeVersion":"22.11.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-KEmpqbEtGTxk2+YUK69GHWwgO5c34foOF6AClTfvqk3O9r5RaEAYa+L0sRaOLfWs1eCXt/quqqFpFzEwC7IP6Q==","shasum":"0f3821998e1f852f141fd247172f1543810603ba","tarball":"https://registry.npmjs.org/@dokieli/web-access-control/-/web-access-control-1.0.0.tgz","fileCount":42,"unpackedSize":94370,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIADmAbwXbTf6OgSyqurYPGyBJ0BsDvrq4Jzjfd3XTCwNAiEAq3DPfc85WVLFiapFs+1sFHa0UeFVDv3MkUZa+/tsTMM="}]},"_npmUser":{"name":"virginiabalseiro","email":"info@virginiabalseiro.com"},"directories":{},"maintainers":[{"name":"virginiabalseiro","email":"info@virginiabalseiro.com"},{"name":"csarven","email":"info@csarven.ca"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/web-access-control_1.0.0_1787136017183_0.7812293669974373"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-19T10:40:16.666Z","1.0.0":"2026-08-19T10:40:17.337Z","modified":"2026-08-19T10:40:17.639Z"},"maintainers":[{"name":"virginiabalseiro","email":"info@virginiabalseiro.com"},{"name":"csarven","email":"info@csarven.ca"}],"description":"Web Access Control (WAC) client library: WAC-Allow header interpretation, effective ACL resource discovery, authorization queries, and pure ACL patch planning. The library allows clients to use their own RDF parsers and HTTP stacks.","homepage":"https://dokieli.github.io/web-access-control/","keywords":["access control","acl","authorization","n3-patch","sparql-update","turtle","typescript","w3c","wac","web access control","web standards"],"repository":{"type":"git","url":"git+https://github.com/dokieli/web-access-control.git"},"author":{"name":"dokieli"},"bugs":{"url":"https://github.com/dokieli/web-access-control/issues"},"license":"Apache-2.0","readme":"# dokieli Web Access Control\n\n[Web Access Control](https://solidproject.org/TR/wac) (WAC) implementation for clients to read and change access controls to resources. Supports inspection of authorization rules, planning of authorizations, patching of resources, and allows clients to use their own RDF parsers and HTTP stacks.\n\n* [Code of Conduct](https://github.com/dokieli/web-access-control/blob/main/CODE-OF-CONDUCT.md)\n* [Contributing Guide](https://github.com/dokieli/web-access-control/blob/main/CONTRIBUTING.md)\n* [API Reference](https://dokieli.github.io/web-access-control/)\n* [Security Policy](https://github.com/dokieli/web-access-control/blob/main/SECURITY.md)\n\n## License\n\n* Source code is licensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0).\n* Unless otherwise noted, images and other media assets are licensed under the [Creative Commons Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0/).\n\n## Installation\n\n```sh\nnpm install @dokieli/web-access-control\n```\n\nor\n\n```sh\nyarn install @dokieli/web-access-control\n```\n\n```js\nimport { findEffectiveACL, isPublic, modesFor } from '@dokieli/web-access-control';\n\nconst ctx = await findEffectiveACL('https://example.org/article', { fetch });\n\nmodesFor(ctx, 'https://example.org/giuseppina#i');\nisPublic(ctx);\n```\n\n```js\nimport { applyPlan, planGrant, planRevoke, Public } from '@dokieli/web-access-control';\n\nconst plan = planGrant(ctx, { type: 'agent', iri: 'https://example.org/liliano#i' }, ['Read', 'Write']);\n\nawait applyPlan(plan, { fetch });\n\nawait applyPlan(planRevoke(ctx, Public), { fetch });\n```\n\n## Documentation\n\nSee [API Reference](https://dokieli.github.io/web-access-control/) and [Examples](https://github.com/dokieli/web-access-control/blob/main/examples/).\n\n## Features\n\n* Effective ACL resource discovery via `Link rel=\"acl\"`.\n* Interprets `WAC-Allow` header.\n* Queries the authorizations governing a resource.\n* Pure patch planners for granting and revoking access, copying inherited container ACLs.\n* Supports client and issuer [access conditions](https://solid.github.io/web-access-control-spec/#access-conditions).\n* Adapts to server's acceptable `PATCH` media types (N3 Patch or SPARQL 1.1 Update).\n* Authentication left to the caller via an injected `fetch`.\n* Reads Turtle out of the box, or any serialization via a caller-supplied parser returning RDF/JS quads.\n\n## Specifications\n\n* [Web Access Control](https://solidproject.org/TR/wac) and the [Editor's Draft](https://solid.github.io/web-access-control-spec/)\n* Solid Protocol's [N3 Patch](https://solidproject.org/TR/protocol#n3-patch)\n* W3C [SPARQL 1.1 Update](https://www.w3.org/TR/sparql11-update/)\n* [RDF/JS: Data model specification](http://rdf.js.org/data-model-spec/)\n\n## Conformance\n\nWhat the library implements WAC's [Editor's Draft](https://solid.github.io/web-access-control-spec/):\n\n* **WAC**: discovery via `Link rel=acl`; determining the [effective ACL resource](https://solid.github.io/web-access-control-spec/#effective-acl-resource); the [`acl` vocabulary](https://www.w3.org/ns/auth/acl); `WAC-Allow` groups and modes.\n* **N3 Patch**: exactly one patch resource per document with a blank node subject, no blank nodes in the formulae, every variable bound in `solid:where`.\n* **SPARQL 1.1 Update**: ground `DELETE DATA`/`INSERT DATA`, and the `DELETE {} INSERT {} WHERE {}` form when a plan carries `where` patterns.\n\nWhere the specifications are silent, the library is opinionated. WAC does not require a particular way to write ACL resources. So, `PATCH` with `Accept-Patch` negotiation is this library's choice, as is trying `HEAD` before `GET` for discovery. All planner behavior is policy: copy-on-write when access is inherited, splitting multi-subject rules, rewriting modes in place, skipping rules a patch cannot address, and no mode implication (`Write` does not imply `Read`).\n\nThe library determines parent containers based on RFC 3986's notion of `/`s representing hierarchical syntactic convention. Other methods, e.g., `rel=\"up\"`, are [considered](https://github.com/dokieli/web-access-control/issues/1).\n\n[Conditional authorizations](https://solid.github.io/web-access-control-spec/#access-conditions) implements work in progress.Its security considerations shape the planners: a server without condition support evaluates an authorization with its conditions ignored, granting more than stated, so conditions are attached automatically only when the ACL resource advertises support, an explicit request to write them to one that does not is refused, and cloned authorizations always keep their conditions.\n\n## Contributing\n\nSee the [Contributing Guide](CONTRIBUTING.md) for development setup, tests, and commit conventions.\n\n## Supported By\n\n* This project was funded by [NLnet](https://nlnet.nl/) (2025-09–2026-08) as part of [NLnet Dokieli Collaborative](https://nlnet.nl/project/Dokieli-Collaborative/).\n\n## Support the project\n\nHelp the project grow by sponsoring it on [Open Collective](https://opencollective.com/dokieli/) or reach out to us.\n","readmeFilename":"README.md","_rev":"1-a37a9a8dd51fffcad4c18b1028fc6f26"}