-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 1aa2963
Showing
427 changed files
with
28,234 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
end_of_line = lf | ||
indent_size = 4 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.js] | ||
quote_type = single | ||
|
||
[*.md] | ||
max_line_length = off | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
### IDE | ||
.vscode/ | ||
.idea/ | ||
|
||
### Node | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
lerna-debug.log* | ||
.changelog | ||
node_modules/ | ||
|
||
### Build | ||
lib/ | ||
build/ | ||
dist/ | ||
old/ | ||
tmp/ | ||
.tmp | ||
.rpt2_cache/ | ||
es5/ | ||
es2015/ | ||
bundles/ | ||
typings/ | ||
coverage/ | ||
packages/**/LICENSE | ||
examples/**/LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
sudo: false | ||
language: node_js | ||
node_js: | ||
- '8.9.4' | ||
cache: | ||
yarn: true | ||
directories: | ||
- node_modules | ||
notifications: | ||
email: false | ||
branches: | ||
only: | ||
- master | ||
except: | ||
- /^v\d+\.\d+\.\d+$/ | ||
before_install: | ||
- curl -o- -L https://yarnpkg.com/install.sh | bash | ||
- export PATH=$HOME/.yarn/bin:$PATH | ||
|
||
install: yarn install --frozen-lockfile | ||
|
||
script: yarn ci:script | ||
after_success: yarn ci:after |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
workspaces-experimental true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright © 2017 Yisrael Eliav | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Authllizer | ||
[](https://travis-ci.org/yisraelx/authllizer) | ||
[](https://codecov.io/gh/yisraelx/authllizer) | ||
[](https://github.com/yisraelx/authllizer/blob/master/LICENSE) | ||
[](http://commitizen.github.io/cz-cli/) | ||
|
||
### Authllizer is a authentication framework for the client-side of javascript applications, written in typescript. | ||
|
||
## Packages | ||
* [@authllizer/core](https://www.npmjs.com/package/@authllizer/core) - Authllizer Library | ||
* [@authllizer/ng](https://www.npmjs.com/package/@authllizer/ng) - Authllizer Module for AngularJs | ||
* [@authllizer/ngx](https://www.npmjs.com/package/@authllizer/ngx) - Authllizer Module for Angular X | ||
* [@authllizer/vue](https://www.npmjs.com/package/@authllizer/vue) - Authllizer Plugin for VueJs | ||
|
||
## Examples | ||
There are example projects in the [source code](https://github.com/yisraelx/authllizer/blob/master/examples). | ||
* [AngularJs](https://github.com/yisraelx/authllizer/blob/master/examples/client/ng) | ||
* [Angular X](https://github.com/yisraelx/authllizer/blob/master/examples/client/ngx) | ||
* [Ionic](https://github.com/yisraelx/authllizer/blob/master/examples/client/ionic) | ||
* [VueJs](https://github.com/yisraelx/authllizer/blob/master/examples/client/vue) | ||
* [Electron](https://github.com/yisraelx/authllizer/blob/master/examples/client/electron) | ||
|
||
## Docs | ||
There is [docs and examples](https://github.com/yisraelx/authllizer/blob/master/docs) but it is very limited hope that it will change later and welcome to help with the matter. | ||
|
||
## Scripts | ||
* bootstrap - for install and link all the dependencies in all packages in the repo (with yarn workspace). | ||
* cm - for commit with commitizen for conventional changelog. | ||
* lint - run tslint an all the *.ts file in the packages. | ||
* test - run test on all packages. | ||
|
||
## Test | ||
There are partial tests, welcome to help add tests and improve existing tests (the goal is for full coverage). | ||
```sh | ||
$ npm install | ||
$ npm test | ||
``` | ||
|
||
## TODO: | ||
* Add example for | ||
- [ ] React | ||
* Add dialog for | ||
- [ ] React Native | ||
- [ ] Native Script | ||
|
||
## Credits | ||
This library is based on AngularJs [Satellizer](https://github.com/sahat/satellizer) library developed by [Sahat Yalkabov](https://github.com/sahat). | ||
|
||
## License | ||
Copyright © 2017 [Yisrael Eliav](https://github.com/yisraelx), | ||
Licensed under the [MIT license](https://github.com/yisraelx/authllizer/blob/master/LICENSE). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
extends: [ | ||
'@commitlint/config-angular' | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import resolve from 'rollup-plugin-node-resolve'; | ||
import commonjs from 'rollup-plugin-commonjs'; | ||
import sourceMaps from 'rollup-plugin-sourcemaps'; | ||
import typescript from 'rollup-plugin-typescript2'; | ||
import minify from 'rollup-plugin-minify'; | ||
import * as _ from 'lodash'; | ||
import {join} from 'path'; | ||
|
||
let PKG = require(join(process.cwd(), 'package.json')); | ||
|
||
let banner = `/** | ||
* ${PKG.name} (${PKG.homepage}) | ||
* @version ${PKG.version} | ||
* @license ${PKG.license} | ||
* @copyright ${PKG.author.name} <${PKG.author.email}> (${PKG.author.url}) | ||
*/`; | ||
|
||
let globals = _.get(PKG, 'rollup.globals', {}); | ||
|
||
export default { | ||
input: `./src/index.ts`, | ||
output: [ | ||
{ | ||
file: PKG.browser, | ||
name: `authllizer.${_.camelCase(PKG.name.replace(/@?authllizer[-\/]?/g, ''))}`, | ||
format: 'umd', | ||
exports: 'named', | ||
banner, | ||
sourcemap: true, | ||
globals | ||
} | ||
], | ||
external: _.keys(globals), | ||
plugins: [ | ||
typescript({ | ||
tsconfigOverride: { | ||
compilerOptions: { | ||
target: 'es5' | ||
} | ||
}, | ||
useTsconfigDeclarationDir: true, | ||
clean: true | ||
}), | ||
commonjs(), | ||
resolve(), | ||
sourceMaps(), | ||
minify({umd: PKG.browser.replace('.js', '.min.js')}) | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
## Docs | ||
* [Authllizer](https://github.com/yisraelx/authllizer/blob/master/docs/authllizer.md) | ||
* [Adapter](https://github.com/yisraelx/authllizer/blob/master/docs/adapter.md) | ||
* [Dialog](https://github.com/yisraelx/authllizer/blob/master/docs/dialog.md) | ||
* [Http](https://github.com/yisraelx/authllizer/blob/master/docs/http.md) | ||
* [Interceptor](https://github.com/yisraelx/authllizer/blob/master/docs/interceptor.md) | ||
* [Provider](https://github.com/yisraelx/authllizer/blob/master/docs/provider.md) | ||
* [Storage](https://github.com/yisraelx/authllizer/blob/master/docs/storage.md) | ||
* [Token](https://github.com/yisraelx/authllizer/blob/master/docs/token.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# Adapter | ||
The Adapter is the component that bridges the Authllizer to api on your server side or your authentication service | ||
|
||
|
||
You can use the Authllizer BackendAdapter (most cases of use) | ||
```ts | ||
import { Authllizer, BackendAdapter } from '@authllizer/core'; | ||
|
||
new Authllizer({ | ||
adapter: BackendAdapter, // the default is BackendAdapter | ||
// ... | ||
}); | ||
``` | ||
With options | ||
```ts | ||
import { Authllizer, BackendAdapter, IBackendAdapterOptions } from '@authllizer/core'; | ||
|
||
new Authllizer({ | ||
adapter: BackendAdapter.extend({ | ||
baseUrl: 'https://example.com/auth', // the default is '/auth' | ||
tokenPath: 'data.token', // the default is 'access_token' - { "access_token": "***" } | ||
// ... | ||
} as IBackendAdapterOptions), | ||
// ... | ||
}); | ||
``` | ||
or | ||
```ts | ||
import { Authllizer, BackendAdapter, IBackendAdapterOptions } from '@authllizer/core'; | ||
|
||
export interface ISomeServiceAdapterOptions extends IBackendAdapterOptions{ | ||
apiKey?: string; | ||
} | ||
|
||
export class SomeServiceAdapter extends LocalAdapter{ | ||
|
||
static extend: (options: ISomeServiceAdapterOptions) => typeof SomeServiceAdapter; | ||
|
||
baseUrl = 'https://someservice.com'; | ||
signIn = '/login'; | ||
signOut = { | ||
url: '/logout' | ||
httpOptions: { | ||
params: {foo: 'bar'} | ||
} | ||
}; | ||
|
||
set apiKey(apiKey: string){ | ||
this.defaultRequestOptions.params.apiKey = apiKey; | ||
} | ||
|
||
} | ||
``` | ||
or you can create an adapter according to your needs | ||
```ts | ||
import { IAdapter } from '@authllizer/core'; | ||
|
||
export class SomeServiceAdapter implements IAdapter{ | ||
// ... | ||
} | ||
``` | ||
|
||
If you created Adapter for an service (authentication, dbs, etc.), then you might want to publish it to npm, so that other users can easily connect to this service. | ||
|
||
Recommended settings on publishing to npm: | ||
```json | ||
// package.json | ||
{ | ||
"name": "authllizer-< service name >-adapter", // authllizer-some-adapter | ||
"keywords": [ "authllizer", "authllizer-adapter"] | ||
} | ||
``` |
Oops, something went wrong.