@adonisjs/auth
Advanced tools
Comparing version 3.1.0 to 4.0.0
# The MIT License | ||
Copyright 2018 Harminder Virk, contributors | ||
Copyright 2019 Harminder virk, contributors | ||
@@ -5,0 +5,0 @@ 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: |
145
package.json
{ | ||
"name": "@adonisjs/auth", | ||
"version": "3.1.0", | ||
"version": "4.0.0", | ||
"description": "Offical authentication provider for Adonis framework", | ||
"main": "index.js", | ||
"main": "build/providers/AuthProvider.js", | ||
"files": [ | ||
"src", | ||
"providers", | ||
"templates", | ||
"instructions.js", | ||
"instructions.md" | ||
"build/adonis-typings", | ||
"build/providers", | ||
"build/src", | ||
"build/templates" | ||
], | ||
"directories": { | ||
"test": "test" | ||
}, | ||
"types": "build/adonis-typings/index.d.ts", | ||
"scripts": { | ||
"mrm": "mrm --preset=@adonisjs/mrm-preset", | ||
"pretest": "npm run lint", | ||
"test:local": "FORCE_COLOR=true node bin/index.js --local", | ||
"test": "nyc node japaFile.js", | ||
"test:win": "node ./node_modules/japa-cli/index.js", | ||
"coverage": "nyc report --reporter=text-lcov | coveralls", | ||
"test": "node japaFile.js", | ||
"lint": "tslint --project tsconfig.json", | ||
"clean": "del build", | ||
"copyfiles": "copyfiles \"templates/**/*.txt\" build", | ||
"compile": "npm run lint && npm run clean && tsc", | ||
"build": "npm run compile && npm run copyfiles", | ||
"commit": "git-cz", | ||
"lint": "standard" | ||
"release": "np", | ||
"version": "npm run build" | ||
}, | ||
@@ -32,3 +32,3 @@ "keywords": [ | ||
], | ||
"author": "adonisjs", | ||
"author": "adonisjs,virk", | ||
"license": "MIT", | ||
@@ -43,24 +43,47 @@ "repository": { | ||
"devDependencies": { | ||
"@adonisjs/fold": "^4.0.9", | ||
"@adonisjs/lucid": "^6.1.2", | ||
"@adonisjs/mrm-preset": "^1.0.13", | ||
"@adonisjs/sink": "^1.0.17", | ||
"commitizen": "^2.10.1", | ||
"cookie": "^0.3.1", | ||
"coveralls": "^3.0.2", | ||
"cz-conventional-changelog": "^2.1.0", | ||
"edge.js": "^1.1.4", | ||
"fs-extra": "^7.0.0", | ||
"japa": "^2.0.3", | ||
"japa-cli": "^1.0.1", | ||
"macroable": "^1.0.0", | ||
"mrm": "^1.2.1", | ||
"node-req": "^2.1.1", | ||
"nyc": "^13.0.1", | ||
"pkg-ok": "^2.2.0", | ||
"semver": "^5.5.1", | ||
"sqlite3": "^4.0.2", | ||
"standard": "^12.0.1", | ||
"supertest": "^3.3.0" | ||
"@adonisjs/core": "^5.0.0-preview.5", | ||
"@adonisjs/encryption": "^1.0.4", | ||
"@adonisjs/events": "^1.0.7", | ||
"@adonisjs/fold": "^6.3.4", | ||
"@adonisjs/hash": "^1.0.12", | ||
"@adonisjs/lucid": "^7.6.3", | ||
"@adonisjs/mrm-preset": "^2.2.4", | ||
"@adonisjs/profiler": "^2.0.0", | ||
"@adonisjs/session": "^2.3.3", | ||
"@phc/bcrypt": "^1.0.2", | ||
"@poppinss/dev-utils": "^1.0.4", | ||
"@types/node": "^13.9.2", | ||
"commitizen": "^4.0.3", | ||
"copyfiles": "^2.2.0", | ||
"cz-conventional-changelog": "^3.1.0", | ||
"del-cli": "^3.0.0", | ||
"doctoc": "^1.4.0", | ||
"husky": "^4.2.3", | ||
"japa": "^3.0.1", | ||
"mrm": "^2.1.0", | ||
"np": "^5.2.1", | ||
"pino-pretty": "^3.6.1", | ||
"reflect-metadata": "^0.1.13", | ||
"set-cookie-parser": "^2.4.3", | ||
"sqlite3": "^4.1.1", | ||
"supertest": "^4.0.2", | ||
"ts-node": "^8.7.0", | ||
"tslint": "^6.1.0", | ||
"tslint-eslint-rules": "^5.4.0", | ||
"typescript": "^3.8.3" | ||
}, | ||
"nyc": { | ||
"exclude": [ | ||
"test" | ||
], | ||
"extension": [ | ||
".ts" | ||
] | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "doctoc README.md --title='## Table of contents' && git add README.md", | ||
"commit-msg": "node ./node_modules/@adonisjs/mrm-preset/validateCommit/conventional/validate.js" | ||
} | ||
}, | ||
"config": { | ||
@@ -71,22 +94,36 @@ "commitizen": { | ||
}, | ||
"nyc": { | ||
"exclude": [ | ||
"test" | ||
] | ||
"np": { | ||
"contents": ".", | ||
"anyBranch": false | ||
}, | ||
"standard": { | ||
"globals": [ | ||
"use" | ||
"dependencies": { | ||
"@poppinss/hooks": "^1.0.3", | ||
"@poppinss/utils": "^2.1.2", | ||
"array-to-sentence": "^2.0.0", | ||
"jose": "^1.25.0" | ||
}, | ||
"publishConfig": { | ||
"access": "public", | ||
"tag": "alpha" | ||
}, | ||
"adonisjs": { | ||
"templates": { | ||
"config": [ | ||
{ | ||
"src": "config.txt", | ||
"dest": "auth" | ||
} | ||
], | ||
"contracts": [ | ||
{ | ||
"src": "contract.txt", | ||
"dest": "auth" | ||
} | ||
] | ||
}, | ||
"types": "@adonisjs/auth", | ||
"providers": [ | ||
"@adonisjs/auth" | ||
] | ||
}, | ||
"dependencies": { | ||
"@adonisjs/generic-exceptions": "^2.0.1", | ||
"basic-auth": "^2.0.1", | ||
"debug": "^4.0.1", | ||
"jsonwebtoken": "^8.3.0", | ||
"lodash": "^4.17.11", | ||
"ms": "^2.1.1", | ||
"resetable": "^1.0.3", | ||
"uuid": "^3.3.2" | ||
} | ||
} |
105
README.md
@@ -1,94 +0,39 @@ | ||
# AdonisJs Auth 🔒 | ||
> Fully blown authentication provider for Adonis framework | ||
<!-- START doctoc generated TOC please keep comment here to allow auto update --> | ||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> | ||
## Table of contents | ||
[![NPM Version][npm-image]][npm-url] | ||
[![Build Status][travis-image]][travis-url] | ||
[![Appveyor][appveyor-image]][appveyor-url] | ||
[![Coveralls][coveralls-image]][coveralls-url] | ||
- [@adonisjs/auth](#adonisjsauth) | ||
- [Change log](#change-log) | ||
- [Contributing](#contributing) | ||
- [Authors & License](#authors--license) | ||
<!-- END doctoc generated TOC please keep comment here to allow auto update --> | ||
Adonisjs auth is an authentication provider to add authentication layer to your apps. | ||
# @adonisjs/auth | ||
<img src="http://res.cloudinary.com/adonisjs/image/upload/q_100/v1497112678/adonis-purple_pzkmzt.svg" width="200px" align="right" hspace="30px" vspace="50px"> | ||
[![circleci-image]][circleci-url] | ||
[![npm-image]][npm-url] | ||
![](https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript) | ||
## What's in the box? | ||
## Change log | ||
1. Support for multiple authentication schemes like **Jwt**, **Sessions**, **Basic auth** and **Personal API tokens**. | ||
2. Support for Lucid and Database serializer. | ||
3. Easy to extend API to add your own serializers and schemes. | ||
4. Runtime middleware. | ||
The change log can be found in the [CHANGELOG.md](CHANGELOG.md) file. | ||
## Installation | ||
You can install the package from npm. | ||
```bash | ||
adonis install @adonisjs/auth | ||
``` | ||
## Contributing | ||
Make sure to read [instructions.md](instructions.md) file. | ||
Everyone is welcome to contribute. Please go through the following guides, before getting started. | ||
## Node/OS Target | ||
1. [Contributing](https://adonisjs.com/contributing) | ||
2. [Code of conduct](https://adonisjs.com/code-of-conduct) | ||
This repo/branch is supposed to run fine on all major OS platforms and targets `Node.js >=7.0` | ||
## Development | ||
## Authors & License | ||
[Harminder virk](https://github.com/Harminder virk) and [contributors](https://github.com/adonisjs/adonis-auth/graphs/contributors). | ||
Great! If you are planning to contribute to the framework, make sure to adhere to following conventions, since a consistent code-base is always joy to work with. | ||
MIT License, see the included [MIT](LICENSE.md) file. | ||
Run the following command to see list of available npm scripts. | ||
[circleci-image]: https://img.shields.io/circleci/project/github/adonisjs/adonis-auth/master.svg?style=for-the-badge&logo=circleci | ||
[circleci-url]: https://circleci.com/gh/adonisjs/adonis-auth "circleci" | ||
``` | ||
npm run | ||
``` | ||
### Tests & Linting | ||
1. Lint your code using standardJs. Run `npm run lint` command to check if there are any linting errors. | ||
2. Make sure you write tests for all the changes/bug fixes. | ||
3. Also you can write **regression tests**, which shows that something is failing but doesn't breaks the build. Which is actually a nice way to show that something fails. Regression tests are written using `test.failing()` method. | ||
4. Make sure all the tests are passing on `travis` and `appveyor`. | ||
### General Practices | ||
Since Es6 is in, you should strive to use latest features. For example: | ||
1. Use `Spread` over `arguments` keyword. | ||
2. Never use `bind` or `call`. After calling these methods, we cannot guarantee the scope of any methods and in AdonisJs codebase we do not override the methods scope. | ||
3. Make sure to write proper docblock. | ||
## Issues & PR | ||
It is always helpful if we try to follow certain practices when creating issues or PR's, since it will save everyone's time. | ||
1. Always try creating regression tests when you find a bug (if possible). | ||
2. Share some context on what you are trying to do, with enough code to reproduce the issue. | ||
3. For general questions, please create a forum thread. | ||
4. When creating a PR for a feature, make sure to create a parallel PR for docs too. | ||
## Regression Tests | ||
Regression tests are tests, which shows how a piece of code fails under certain circumstance, but the beauty is even after the failure, the test suite will never fail. Actually is a nice way to notify about bugs, but making sure everything is green. | ||
The regression tests are created using | ||
``` | ||
test.failing('2 + 2 is always 4, but add method returns 6', (assert) => { | ||
assert.true(add(2, 2), 4) | ||
}) | ||
``` | ||
Now since the `add` method has a bug, it will return `6` instead of `4`. But the build will pass. | ||
[appveyor-image]: https://img.shields.io/appveyor/ci/thetutlage/adonis-auth/master.svg?style=flat-square | ||
[appveyor-url]: https://ci.appveyor.com/project/thetutlage/adonis-auth | ||
[npm-image]: https://img.shields.io/npm/v/@adonisjs/auth.svg?style=flat-square | ||
[npm-url]: https://npmjs.org/package/@adonisjs/auth | ||
[travis-image]: https://img.shields.io/travis/adonisjs/adonis-auth/master.svg?style=flat-square | ||
[travis-url]: https://travis-ci.org/adonisjs/adonis-auth | ||
[coveralls-image]: https://img.shields.io/coveralls/adonisjs/adonis-auth/develop.svg?style=flat-square | ||
[coveralls-url]: https://coveralls.io/github/adonisjs/adonis-auth | ||
[npm-image]: https://img.shields.io/npm/v/@adonisjs/auth.svg?style=for-the-badge&logo=npm | ||
[npm-url]: https://npmjs.org/package/@adonisjs/auth "npm" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4
72932
30
29
1849
40
1
+ Added@poppinss/hooks@^1.0.3
+ Added@poppinss/utils@^2.1.2
+ Addedarray-to-sentence@^2.0.0
+ Addedjose@^1.25.0
+ Added@panva/asn1.js@1.0.0(transitive)
+ Added@poppinss/hooks@1.1.3(transitive)
+ Added@poppinss/utils@2.5.10(transitive)
+ Addedarray-to-sentence@2.0.0(transitive)
+ Addedbuffer-alloc@1.2.0(transitive)
+ Addedbuffer-alloc-unsafe@1.1.0(transitive)
+ Addedbuffer-fill@1.0.0(transitive)
+ Addedfast-safe-stringify@2.1.1(transitive)
+ Addedfs-readdir-recursive@1.1.0(transitive)
+ Addedjose@1.28.2(transitive)
+ Addedklona@2.0.6(transitive)
+ Addedrequire-all@3.0.0(transitive)
+ Addedresolve-from@5.0.0(transitive)
- Removed@adonisjs/generic-exceptions@^2.0.1
- Removedbasic-auth@^2.0.1
- Removeddebug@^4.0.1
- Removedjsonwebtoken@^8.3.0
- Removedlodash@^4.17.11
- Removedms@^2.1.1
- Removedresetable@^1.0.3
- Removeduuid@^3.3.2
- Removed@adonisjs/generic-exceptions@2.0.1(transitive)
- Removedbasic-auth@2.0.1(transitive)
- Removedbuffer-equal-constant-time@1.0.1(transitive)
- Removedclone@2.1.2(transitive)
- Removedcross-env@5.2.1(transitive)
- Removedcross-spawn@6.0.6(transitive)
- Removeddebug@4.4.0(transitive)
- Removedecdsa-sig-formatter@1.0.11(transitive)
- Removedisexe@2.0.0(transitive)
- Removedjsonwebtoken@8.5.1(transitive)
- Removedjwa@1.4.1(transitive)
- Removedjws@3.2.2(transitive)
- Removedlodash@4.17.21(transitive)
- Removedlodash.includes@4.3.0(transitive)
- Removedlodash.isboolean@3.0.3(transitive)
- Removedlodash.isinteger@4.0.4(transitive)
- Removedlodash.isnumber@3.0.3(transitive)
- Removedlodash.isplainobject@4.0.6(transitive)
- Removedlodash.isstring@4.0.1(transitive)
- Removedlodash.once@4.1.1(transitive)
- Removednice-try@1.0.5(transitive)
- Removednode-exceptions@3.0.0(transitive)
- Removedpath-key@2.0.1(transitive)
- Removedresetable@1.0.3(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedsemver@5.7.2(transitive)
- Removedshebang-command@1.2.0(transitive)
- Removedshebang-regex@1.0.0(transitive)
- Removedupcast@2.1.2(transitive)
- Removeduuid@3.4.0(transitive)
- Removedwhich@1.3.1(transitive)