diff --git a/LICENSE b/LICENSE index 261eeb9..37916e4 100644 --- a/LICENSE +++ b/LICENSE @@ -199,3 +199,27 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + +The IP address handling implementation is derived from node-ip by Fedor Indutny. +Its original and generated forms are licensed under the MIT License below. + +Copyright Fedor Indutny, 2012. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the +following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index 46158e7..af93e7f 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,45 @@ -# Node-Casbin + + +# Apache Casbin (Incubating) — Node-Casbin + +Apache Casbin (Incubating) is an effort undergoing incubation at the Apache Software Foundation (ASF), sponsored by the Apache Incubator PMC. + +Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. + +While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF. + +Earlier package publications form the legacy Casbin community release history. Their presence in a registry does not establish Apache release approval. Apache releases require project and Incubator approval of the exact source distribution. + [![GitHub Actions](https://github.com/apache/casbin-node-casbin/workflows/main/badge.svg)](https://github.com/apache/casbin-node-casbin/actions) [![Coverage Status](https://codecov.io/gh/apache/casbin-node-casbin/branch/master/graph/badge.svg)](https://codecov.io/gh/apache/casbin-node-casbin) [![Release](https://img.shields.io/github/release/apache/casbin-node-casbin.svg)](https://github.com/apache/casbin-node-casbin/releases/latest) [![NPM version][npm-image]][npm-url] [![NPM download][download-image]][download-url] -[![install size](https://packagephobia.now.sh/badge?p=casbin)](https://packagephobia.now.sh/result?p=casbin) +[![install size](https://packagephobia.now.sh/badge?p=apache-casbin)](https://packagephobia.now.sh/result?p=apache-casbin) [![Discord](https://img.shields.io/discord/1022748306096537660?logo=discord&label=discord&color=5865F2)](https://discord.gg/S5UjpzGZjN) -[npm-image]: https://img.shields.io/npm/v/casbin.svg?style=flat-square -[npm-url]: https://npmjs.org/package/casbin -[download-image]: https://img.shields.io/npm/dm/casbin.svg?style=flat-square -[download-url]: https://npmjs.org/package/casbin +[npm-image]: https://img.shields.io/npm/v/apache-casbin.svg?style=flat-square +[npm-url]: https://npmjs.org/package/apache-casbin +[download-image]: https://img.shields.io/npm/dm/apache-casbin.svg?style=flat-square +[download-url]: https://npmjs.org/package/apache-casbin **News**: still worry about how to write the correct `node-casbin` policy? [Casbin online editor](https://casbin.apache.org/editor) is coming to help! @@ -39,10 +67,10 @@ https://casbin.apache.org/docs/overview ```shell script # NPM -npm install casbin --save +npm install apache-casbin --save # Yarn -yarn add casbin +yarn add apache-casbin ``` ## Get started @@ -51,9 +79,9 @@ New a `node-casbin` enforcer with a model file and a policy file, see [Model](#o ```node.js // For Node.js: -const { newEnforcer } = require('casbin'); +const { newEnforcer } = require('apache-casbin'); // For browser: -// import { newEnforcer } from 'casbin'; +// import { newEnforcer } from 'apache-casbin'; const enforcer = await newEnforcer('basic_model.conf', 'basic_policy.csv'); ``` @@ -130,3 +158,11 @@ If you have any issues or feature requests, please contact us. PR is welcomed. - https://github.com/apache/casbin-node-casbin/issues - https://discord.gg/S5UjpzGZjN + +## Runtime requirements + +The runtime dependency supports Node.js 20 or 22 and later. Build and development tools require a current Node.js 20 LTS release or later. + +## Package-name migration + +The next approved distribution uses `apache-casbin` in place of the historical npm package `casbin`. The API is unchanged by the name migration. After the approved package is published, update dependency declarations and imports to `apache-casbin`, regenerate your lockfile and check that adapters use the same core package instance. Existing `casbin` releases remain available; updating that old dependency does not automatically switch packages. Do not install both core identities in one application. Candidates are for review, not installation from npm. diff --git a/package.json b/package.json index 6abf1da..56a0258 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { - "name": "casbin", - "version": "5.43.0", - "description": "An authorization library that supports access control models like ACL, RBAC, ABAC in Node.JS", + "name": "apache-casbin", + "version": "5.52.0", + "description": "Apache Casbin (Incubating): An authorization library that supports access control models like ACL, RBAC, ABAC in Node.JS", "main": "lib/cjs/index.js", "typings": "lib/cjs/index.d.ts", "module": "lib/esm/index.mjs", @@ -57,7 +57,10 @@ }, "files": [ "lib", - "examples" + "examples", + "LICENSE", + "NOTICE", + "DISCLAIMER" ], "homepage": "https://casbin.apache.org", "repository": {