├── .circleci └── config.yml ├── .editorconfig ├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── .lintstagedrc ├── .prettierignore ├── .prettierrc ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── commitlint.config.js ├── lerna.json ├── package.json ├── packages └── @ngx-auth │ ├── auth0 │ ├── CHANGELOG.md │ ├── README.md │ ├── ng-package.json │ ├── package.json │ ├── src │ │ ├── auth0-server.service.ts │ │ ├── auth0.loader.ts │ │ ├── auth0.module.ts │ │ ├── auth0.service.ts │ │ ├── index.ts │ │ └── models │ │ │ ├── auth0-backend.ts │ │ │ └── auth0-settings.ts │ └── tests │ │ ├── __mocks__ │ │ └── auth0-js.ts │ │ ├── auth0-server.service.spec.ts │ │ ├── auth0.loader.spec.ts │ │ ├── auth0.service.spec.ts │ │ └── common.ts │ └── core │ ├── CHANGELOG.md │ ├── README.md │ ├── ng-package.json │ ├── package.json │ ├── src │ ├── auth-server.guard.ts │ ├── auth-server.service.ts │ ├── auth.guard.ts │ ├── auth.loader.ts │ ├── auth.module.ts │ ├── auth.service.ts │ ├── index.ts │ └── models │ │ ├── auth-settings.ts │ │ └── backend.ts │ ├── testing │ ├── auth.testing.module.ts │ └── mocks │ │ ├── backend-interceptor.mock.ts │ │ └── jwt-interceptor.mock.ts │ └── tests │ ├── auth-server.guard.spec.ts │ ├── auth-server.service.spec.ts │ ├── auth.guard.spec.ts │ ├── auth.loader.spec.ts │ ├── auth.service.spec.ts │ └── common.ts ├── tools ├── build │ ├── helpers.ts │ ├── packager.ts │ └── tsconfig.package.json ├── test │ └── jest.setup.ts └── tslint.json ├── tsconfig.json ├── tsconfig.lint.json ├── tslint.json └── yarn.lock /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | jobs: 3 | build: 4 | docker: 5 | - image: circleci/node:10-browsers 6 | environment: 7 | JOBS: 1 8 | steps: 9 | - checkout 10 | - run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc 11 | - run: git config --global user.email ${GH_USER_EMAIL} 12 | - run: git config --global user.name ${GH_USER_NAME} 13 | - run: sudo yarn global add greenkeeper-lockfile@1 14 | - run: sudo yarn global add lerna@3 15 | - restore_cache: 16 | keys: 17 | - deps-{{ .Branch }}-{{ checksum "yarn.lock" }} 18 | - deps- 19 | - run: yarn 20 | - save_cache: 21 | key: deps-{{ .Branch }}-{{ checksum "yarn.lock" }} 22 | paths: 'node_modules' 23 | - run: yarn ci:before 24 | - run: yarn test:ci 25 | - run: if [ ${CIRCLE_BRANCH} == "master" ]; then lerna version --create-release github --yes; fi 26 | - run: yarn build 27 | - run: yarn ci:after 28 | - run: if [ ${CIRCLE_BRANCH} == "master" ]; then lerna publish from-package --yes; fi 29 | - run: bash <(curl -s https://codecov.io/bash) 30 | - store_artifacts: 31 | path: coverage 32 | prefix: coverage 33 | - store_artifacts: 34 | path: dist 35 | prefix: dist 36 | - store_test_results: 37 | path: test-report.xml 38 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | end_of_line = lf 7 | indent_style = space 8 | indent_size = 2 9 | insert_final_newline = true 10 | trim_trailing_whitespace = true 11 | 12 | [*.md] 13 | max_line_length = 140 14 | trim_trailing_whitespace = false 15 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # More about this https://help.github.com/articles/about-codeowners/ 2 | * @fulls1z3 3 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 6 | 7 | **I'm submitting a ...** (check one with "x") 8 | ``` 9 | [ ] Regression (a behavior that used to work and stopped working in a new release) 10 | [ ] Bug report 11 | [ ] Support request => 12 | [ ] Feature request 13 | [ ] Documentation issue or request 14 | ``` 15 | 16 | **Current behavior** 17 | 18 | 19 | **Expected/desired behavior** 20 | 21 | 22 | **Minimal reproduction of the problem with instructions** 23 | 27 | 28 | **What is the motivation / use case for changing the behavior?** 29 | 30 | 31 | **Environment** 32 | * **Angular version:** X.Y.Z 33 | 34 | 35 | * **Browser:** 36 | - [ ] Chrome (desktop) version XX 37 | - [ ] Chrome (Android) version XX 38 | - [ ] Chrome (iOS) version XX 39 | - [ ] Firefox version XX 40 | - [ ] Safari (desktop) version XX 41 | - [ ] Safari (iOS) version XX 42 | - [ ] IE version XX 43 | - [ ] Edge version XX 44 | 45 | * **For Tooling issues:** 46 | - Node version: XX 47 | - Platform: 48 | 49 | * Others: 50 | 51 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ** PR Checklist 2 | Please check if your PR fulfills the following requirements: 3 | 4 | - [ ] The commit message follows our guidelines: https://github.com/fulls1z3/ngx-auth/blob/master/CONTRIBUTING.md#commit 5 | - [ ] Tests for the changes have been added (for bug fixes / features) 6 | - [ ] Docs have been added / updated (for bug fixes / features) 7 | 8 | ** PR Type 9 | What kind of change does this PR introduce? 10 | 11 | 12 | ``` 13 | [ ] Bugfix 14 | [ ] Feature 15 | [ ] Code style update (formatting, local variables) 16 | [ ] Refactoring (no functional changes, no api changes) 17 | [ ] Build related changes 18 | [ ] CI related changes 19 | [ ] Documentation content changes 20 | [ ] Other... Please describe: 21 | ``` 22 | 23 | ** What is the current behavior? 24 | 25 | 26 | Issue Number: N/A 27 | 28 | ** What is the new behavior? 29 | 30 | ** Does this PR introduce a breaking change? 31 | ``` 32 | [ ] Yes 33 | [ ] No 34 | ``` 35 | 36 | 37 | 38 | ** Other information 39 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | yarn-error.log 34 | testem.log 35 | test-report.xml 36 | /typings 37 | 38 | # System Files 39 | .DS_Store 40 | Thumbs.db 41 | -------------------------------------------------------------------------------- /.lintstagedrc: -------------------------------------------------------------------------------- 1 | { 2 | "*.{json,css,scss,md,js}": ["prettier --write", "git add"], 3 | "*.(ts)": ["prettier-tslint fix", "git add"] 4 | } 5 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # Add files here to ignore them from prettier formatting 2 | 3 | # compiled output 4 | /dist 5 | /docs 6 | /tmp 7 | /out-tsc 8 | 9 | # dependencies 10 | /node_modules 11 | 12 | # IDEs and editors 13 | /.idea 14 | .project 15 | .classpath 16 | .c9/ 17 | *.launch 18 | .settings/ 19 | *.sublime-workspace 20 | 21 | # IDE - VSCode 22 | .vscode/* 23 | !.vscode/settings.json 24 | !.vscode/tasks.json 25 | !.vscode/launch.json 26 | !.vscode/extensions.json 27 | 28 | # misc 29 | /.sass-cache 30 | /connect.lock 31 | /coverage 32 | /libpeerconnection.log 33 | npm-debug.log 34 | yarn-error.log 35 | testem.log 36 | test-report.xml 37 | /typings 38 | 39 | # System Files 40 | .DS_Store 41 | Thumbs.db 42 | 43 | # others 44 | /tools 45 | angular.json 46 | yarn.lock 47 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 140, 3 | "singleQuote": true 4 | } 5 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | # [9.0.0](https://github.com/fulls1z3/ngx-auth/compare/v8.1.0...v9.0.0) (2020-04-27) 7 | 8 | 9 | ### Features 10 | 11 | * **package:** migrate to ng9 ([0a1c4c1](https://github.com/fulls1z3/ngx-auth/commit/0a1c4c11d8cfa3e9649d713da0797b5cdd815d35)) 12 | * **package:** migrate to ng9 ([b606776](https://github.com/fulls1z3/ngx-auth/commit/b606776586c2144c3f7594591e91d800d58d450f)) 13 | 14 | 15 | ### BREAKING CHANGES 16 | 17 | * **package:** ng9 18 | * **package:** ng9 19 | 20 | 21 | 22 | 23 | 24 | # [8.1.0](https://github.com/fulls1z3/ngx-auth/compare/v8.0.1...v8.1.0) (2020-04-27) 25 | 26 | 27 | ### Bug Fixes 28 | 29 | * **packaging:** fix deployment ([#131](https://github.com/fulls1z3/ngx-auth/issues/131)) ([a43baf5](https://github.com/fulls1z3/ngx-auth/commit/a43baf5f48edf7cc200d06c08fbae005ee17e0cd)) 30 | * **packaging:** fix deployment ([#132](https://github.com/fulls1z3/ngx-auth/issues/132)) ([a769718](https://github.com/fulls1z3/ngx-auth/commit/a769718c0a2ce3e0545a23aaa2a86ee4c6a0bc51)) 31 | 32 | 33 | ### Features 34 | 35 | * **package:** migrate to ng9 ([#134](https://github.com/fulls1z3/ngx-auth/issues/134)) ([e37267e](https://github.com/fulls1z3/ngx-auth/commit/e37267ef3128ef8bb6eea38941c671e1a6010e51)) 36 | 37 | 38 | 39 | 40 | 41 | ## [8.0.1](https://github.com/fulls1z3/ngx-auth/compare/v8.0.0...v8.0.1) (2019-11-21) 42 | 43 | **Note:** Version bump only for package ngx-auth 44 | 45 | 46 | 47 | 48 | 49 | # [8.0.0](https://github.com/fulls1z3/ngx-auth/compare/v6.0.0-rc.1...v8.0.0) (2019-11-21) 50 | 51 | 52 | ### Bug Fixes 53 | 54 | * **packaging:** fix publish ([b7fb206](https://github.com/fulls1z3/ngx-auth/commit/b7fb20686ca63859ec84e0b39ee60df71e733e9b)) 55 | 56 | 57 | ### Features 58 | 59 | * **package:** upgrade to angular 8 ([5a973f6](https://github.com/fulls1z3/ngx-auth/commit/5a973f66e49aec265002f60b9cb6c39441d8884c)) 60 | 61 | 62 | ### BREAKING CHANGES 63 | 64 | * **package:** ng8 65 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | * Using welcoming and inclusive language 12 | * Being respectful of differing viewpoints and experiences 13 | * Gracefully accepting constructive criticism 14 | * Focusing on what is best for the community 15 | * Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | * Trolling, insulting/derogatory comments, and personal or political attacks 21 | * Public or private harassment 22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | * Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at mail@buraktasci.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: http://contributor-covenant.org 46 | [version]: http://contributor-covenant.org/version/1/4/ 47 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to ngx-auth 2 | 3 | We would love for you to contribute to **`ngx-auth`** and help make it even better than it is today! As a contributor, 4 | here are the guidelines we would like you to follow: 5 | 6 | - [Code of Conduct](#coc) 7 | - [Issues and Bugs](#issue) 8 | - [Feature requests](#feature) 9 | - [Submission guidelines](#submit) 10 | - [Coding rules](#rules) 11 | - [Commit message guidelines](#commit) 12 | 13 | ## Code of Conduct 14 | Help us keep **`ngx-auth`** open and inclusive. Please read and follow our [Code of Conduct][coc]. 15 | 16 | ## Found a Bug? 17 | If you find a bug in the source code, you can help us by [submitting an issue](#submit-issue) to our [GitHub Repository][github]. 18 | 19 | Even better, you can [submit a Pull Request](#submit-pr) with a fix. 20 | 21 | ## Missing a Feature? 22 | You can *request* a new feature by [submitting an issue](#submit-issue) to our GitHub Repository. 23 | 24 | If you would like to *implement* a new feature, please submit an issue with a proposal for your work first, to be sure that 25 | we can use it. 26 | 27 | Please consider what kind of change it is: 28 | * For a **Major Feature**, first open an issue and outline your proposal so that it can be discussed. 29 | This will also allow us to better coordinate our efforts, prevent duplication of work, and help you to craft the change 30 | so that it is successfully accepted into the project. 31 | * **Small Features** can be crafted and directly [submitted as a Pull Request](#submit-pr). 32 | 33 | ## Submission guidelines 34 | ### Submitting an Issue 35 | Before you submit an issue, please search the issue tracker, maybe an issue for your problem already exists and the discussion 36 | might inform you of workarounds readily available. 37 | 38 | We want to fix all the issues as soon as possible, but before fixing a bug we need to reproduce and confirm it. In order 39 | to reproduce bugs we will systematically ask you to provide a minimal reproduction scenario using http://plnkr.co. 40 | 41 | Having a live, reproducible scenario gives us wealth of important information without going back & forth to you with additional 42 | questions like: 43 | - version used 44 | - 3rd-party libraries and their versions 45 | - and most importantly: a use-case that fails 46 | 47 | A minimal reproduce scenario using http://plnkr.co/ allows us to quickly confirm a bug (or point out coding problem) as 48 | well as confirm that we are fixing the right problem. If plunker is not a suitable way to demonstrate the problem (*ex: 49 | issues related to our npm packaging*), please create a standalone git repository demonstrating the problem. 50 | 51 | We will be insisting on a minimal reproduce scenario in order to save maintainers time and ultimately be able to fix more 52 | bugs. 53 | 54 | Interestingly, from our experience users often find coding problems themselves while preparing a minimal plunk. We understand 55 | that sometimes it might be hard to extract essentials bits of code from a larger code-base but we really need to isolate 56 | the problem before we can fix it. 57 | 58 | Unfortunately we are not able to investigate / fix bugs without a minimal reproduction, so if we don't hear back from you, 59 | we are going to close an issue that don't have enough info to be reproduced. 60 | 61 | You can file new issues by filling out our [new issue form](https://github.com/fulls1z3/ngx-auth/issues/new). 62 | 63 | ### Submitting a Pull Request (PR) 64 | Before you submit your Pull Request (PR) consider the following guidelines: 65 | 66 | * Search [GitHub](https://github.com/fulls1z3/ngx-auth/pulls) for an open or closed PR that relates to your submission. 67 | You don't want to duplicate effort. 68 | * Make your changes in a new git branch: 69 | ```shell 70 | git checkout -b my-fix-branch master 71 | ``` 72 | * Create your patch, **including appropriate test cases**. 73 | * Follow our [Coding rules](#rules). 74 | * Run the full test suite and ensure that all tests pass. 75 | * Commit your changes using a descriptive commit message that follows our [commit message conventions](#commit). 76 | Adherence to these conventions is necessary because release notes are automatically generated from these messages. 77 | ```shell 78 | git commit -a 79 | ``` 80 | Note: the optional commit `-a` command line option will automatically "add" and "rm" edited files. 81 | * Push your branch to GitHub: 82 | ```shell 83 | git push origin my-fix-branch 84 | ``` 85 | * In GitHub, send a pull request to `ngx-auth:master`. 86 | * If we suggest changes then: 87 | * Make the required updates. 88 | * Re-run the test suites to ensure tests are still passing. 89 | * Rebase your branch and force push to your GitHub repository (this will update your Pull Request): 90 | ```shell 91 | git rebase master -i 92 | git push -f 93 | ``` 94 | That's it, thanks for your contribution! 95 | 96 | #### After your pull request is merged 97 | After your pull request is merged, you can safely delete your branch and pull the changes from the main (upstream) repository: 98 | * Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows: 99 | ```shell 100 | git push origin --delete my-fix-branch 101 | ``` 102 | * Check out the master branch: 103 | ```shell 104 | git checkout master -f 105 | ``` 106 | * Delete the local branch: 107 | ```shell 108 | git branch -D my-fix-branch 109 | ``` 110 | * Update your master with the latest upstream version: 111 | ```shell 112 | git pull --ff upstream master 113 | ``` 114 | 115 | ## Coding rules 116 | To ensure consistency throughout the source code, keep these rules in mind as you are working: 117 | * All features or bug fixes **must be tested** by one or more specs (unit-tests). 118 | * All public API methods **must be documented**. (Details TBC). 119 | * We follow [fulls1z3's Angular TSLint rules][angular-tslint-rules]. 120 | 121 | ## Commit message guidelines 122 | We have very precise rules over how our git commit messages can be formatted. This leads to **more readable messages** that 123 | are easy to follow when looking through the **project history**. But also, we use the git commit messages to **generate 124 | the `ngx-auth` change log**. 125 | 126 | ### Commit Message Format 127 | Each commit message consists of a **header**, a **body** and a **footer**. The header has a special format that includes 128 | a **type**, a **scope** (*when applicable*) and a **subject**: 129 | ``` 130 | (): 131 | 132 | 133 | 134 |