├── .gitattributes ├── .github ├── pr-labeler.yml └── workflows │ ├── cron-dependency-checker-workflow.yml │ ├── issue-assigned-workflows.yml │ ├── issue-open-workflows.yml │ ├── on-push-tags.yml │ ├── on-version-update.yml │ ├── pr-labeled-at-develop-workflows.yml │ ├── pr-open-to-demos.yml │ ├── pr-open-to-master-workflows.yml │ └── pr-open-workflows.yml ├── .gitignore ├── .run ├── env.run.xml ├── install.run.xml ├── outdated.run.xml ├── postmanDevelop.run.xml ├── postmanLocal.run.xml ├── start.run.xml ├── startLocal.run.xml └── update.run.xml ├── LICENSE ├── README.md ├── app.json ├── app ├── consumer │ └── auth-queue.consumer.ts ├── controller │ ├── auth.controller.ts │ ├── info.controller.ts │ ├── social-login.controller.ts │ └── two-factor.controller.ts ├── enum │ ├── social-login.enum.ts │ └── user-role.enum.ts ├── interface │ ├── auth-token.interface.ts │ └── two-factor-code.interface.ts ├── repository │ ├── social-login.repository.ts │ ├── token.repository.ts │ ├── two-factor.repository.ts │ └── user.repository.ts └── route │ ├── auth.route.ts │ ├── index.route.ts │ ├── info.route.ts │ ├── monitor.route.ts │ ├── social-login.route.ts │ └── two-factor-code.route.ts ├── assets ├── requests │ ├── auth-requests.rest │ ├── info-requests.rest │ ├── monitor-requests.rest │ ├── social-login-requests.rest │ ├── team-requests.rest │ └── two-factor-requests.rest ├── sql │ └── preload.tables.psql ├── test-results │ ├── postman-dark.html │ └── postman.html └── tests │ ├── regression-tests │ └── postman │ │ ├── README.md │ │ ├── auth-server-regression.postman_collection.json │ │ ├── auth-server-regression.postman_environment_develop.json │ │ └── auth-server-regression.postman_environment_local.json │ └── stress-tests │ └── login.jmx ├── auth-server.main.ts ├── dependency-checker.ts ├── docs ├── OUTDATED.md ├── REGRESSION_TESTS.md └── SOCIAL_LOGIN.md ├── env.sh ├── environment.ts ├── package.json ├── tsconfig.json ├── version-generator.ts └── version.ts /.gitattributes: -------------------------------------------------------------------------------- 1 | assets/* linguist-vendored -------------------------------------------------------------------------------- /.github/pr-labeler.yml: -------------------------------------------------------------------------------- 1 | bug: 'bug/*' 2 | dependency: 'dependency/*' 3 | documentation: 'documentation/*' 4 | feature: 'feature/*' 5 | hotfix: 'hotfix/*' 6 | quality: 'quality/*' 7 | workflow: 'workflow/*' 8 | -------------------------------------------------------------------------------- /.github/workflows/cron-dependency-checker-workflow.yml: -------------------------------------------------------------------------------- 1 | name: Cron Dependency Checker Workflow 2 | 3 | on: 4 | schedule: 5 | - cron: '0 4 * * 1' 6 | 7 | jobs: 8 | cron-dependency-checker: 9 | name: 'Cron Dependency Checker' 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Checkout Repo 13 | uses: actions/checkout@v2 14 | with: 15 | token: ${{ secrets.MASTER_BRANCH_ACCESS_TOKEN }} 16 | 17 | - name: Install Node 18 | uses: actions/setup-node@v1 19 | with: 20 | node-version: 16 21 | 22 | - name: NPM Install 23 | run: npm i 24 | - name: Npm Outdated 25 | run: npm run outdated 26 | 27 | - name: Check for Changes 28 | run: | 29 | if git diff --exit-code; then 30 | echo "changes_exist=false" >> $GITHUB_ENV 31 | else 32 | echo "changes_exist=true" >> $GITHUB_ENV 33 | fi 34 | 35 | - name: Git Commit and Push 36 | if: ${{ env.changes_exist == 'true' }} 37 | run: | 38 | git config --global user.email "98660390+oth-service-user@users.noreply.github.com" 39 | git config --global user.name "OTH Service User" 40 | git commit -am "Workflow/dependency check" 41 | git push 42 | -------------------------------------------------------------------------------- /.github/workflows/issue-assigned-workflows.yml: -------------------------------------------------------------------------------- 1 | name: Issue Assigned Workflows 2 | 3 | on: 4 | issues: 5 | types: [ assigned ] 6 | 7 | jobs: 8 | automate-project-columns: 9 | name: 'Automate Project Columns' 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - name: Move Issue to In-Progress 14 | uses: alex-page/github-project-automation-plus@v0.3.0 15 | with: 16 | project: Open Template Hub Servers 17 | column: In progress 18 | repo-token: ${{ secrets.MASTER_BRANCH_ACCESS_TOKEN }} 19 | -------------------------------------------------------------------------------- /.github/workflows/issue-open-workflows.yml: -------------------------------------------------------------------------------- 1 | name: Issue Open Workflows 2 | 3 | on: 4 | issues: 5 | types: [ opened ] 6 | 7 | jobs: 8 | automate-project-columns: 9 | name: "Automate Project Columns" 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - name: Move Issue to In-Progress 14 | uses: alex-page/github-project-automation-plus@v0.3.0 15 | with: 16 | project: Open Template Hub Servers 17 | column: To do 18 | repo-token: ${{ secrets.MASTER_BRANCH_ACCESS_TOKEN }} 19 | 20 | milestone-binder: 21 | name: "Milestone Binder" 22 | runs-on: ubuntu-latest 23 | 24 | steps: 25 | - name: Set Milestone of the Issue 26 | uses: Code-Hex/auto-milestone-binder@v1.0.1 27 | with: 28 | github-token: ${{ secrets.MASTER_BRANCH_ACCESS_TOKEN }} 29 | -------------------------------------------------------------------------------- /.github/workflows/on-push-tags.yml: -------------------------------------------------------------------------------- 1 | name: On Push Tags Workflows 2 | 3 | on: 4 | push: 5 | tags: 6 | - '*' 7 | 8 | jobs: 9 | tagged-release: 10 | name: 'Tagged Release' 11 | runs-on: 'ubuntu-latest' 12 | 13 | steps: 14 | - name: Generate Release From Tag 15 | uses: 'marvinpinto/action-automatic-releases@latest' 16 | with: 17 | repo_token: '${{ secrets.MASTER_BRANCH_ACCESS_TOKEN }}' 18 | prerelease: false 19 | -------------------------------------------------------------------------------- /.github/workflows/on-version-update.yml: -------------------------------------------------------------------------------- 1 | name: On Version Update Workflows 2 | 3 | on: 4 | push: 5 | paths-ignore: 6 | - 'package.json' 7 | branches: 8 | - 'master' 9 | 10 | jobs: 11 | bump-version: 12 | name: 'Update Version' 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - name: Checkout Repo 17 | uses: actions/checkout@v2 18 | with: 19 | token: ${{ secrets.MASTER_BRANCH_ACCESS_TOKEN }} 20 | 21 | - name: Install Node 22 | uses: actions/setup-node@v1 23 | with: 24 | node-version: 16 25 | 26 | - name: Bump Version and Create Tag 27 | uses: phips28/gh-action-bump-version@master 28 | with: 29 | tag-prefix: '' 30 | token: ${{ secrets.MASTER_BRANCH_ACCESS_TOKEN }} 31 | 32 | create-version-update-pr: 33 | name: 'Create Version Update PR' 34 | runs-on: ubuntu-latest 35 | needs: bump-version 36 | 37 | steps: 38 | - name: Checkout Repo 39 | uses: actions/checkout@v2 40 | with: 41 | token: ${{ secrets.MASTER_BRANCH_ACCESS_TOKEN }} 42 | ref: develop 43 | 44 | - name: Hard Reset Develop from Master 45 | run: | 46 | git fetch origin master:master 47 | git reset --hard master 48 | 49 | - name: Create PR 50 | uses: peter-evans/create-pull-request@v3 51 | with: 52 | token: ${{ secrets.MASTER_BRANCH_ACCESS_TOKEN }} 53 | branch: workflow/version-update 54 | delete-branch: true 55 | base: develop 56 | title: 'Workflow/version update' 57 | -------------------------------------------------------------------------------- /.github/workflows/pr-labeled-at-develop-workflows.yml: -------------------------------------------------------------------------------- 1 | name: PR Labeled at Develop Workflows 2 | 3 | on: 4 | pull_request: 5 | types: 6 | - labeled 7 | branches: 8 | - develop 9 | 10 | jobs: 11 | auto-merge: 12 | name: 'Auto Merge' 13 | runs-on: ubuntu-latest 14 | steps: 15 | - name: automerge 16 | uses: 'pascalgn/automerge-action@v0.14.3' 17 | env: 18 | GITHUB_TOKEN: '${{ secrets.MASTER_BRANCH_ACCESS_TOKEN }}' 19 | MERGE_LABELS: 'workflow' 20 | MERGE_COMMIT_MESSAGE: 'Auto merge for PR with workflow label' 21 | MERGE_FORKS: 'false' 22 | MERGE_RETRY_SLEEP: '60000' 23 | -------------------------------------------------------------------------------- /.github/workflows/pr-open-to-demos.yml: -------------------------------------------------------------------------------- 1 | name: PR Open To Demos Workflows 2 | 3 | on: 4 | pull_request: 5 | types: [ opened ] 6 | branches: 7 | - demo/* 8 | 9 | jobs: 10 | reset-demo-from-develop: 11 | name: 'Reset Demo From Develop' 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Checkout Repo 15 | uses: actions/checkout@v2 16 | with: 17 | token: ${{ secrets.MASTER_BRANCH_ACCESS_TOKEN }} 18 | ref: ${{ github.event.pull_request.base.ref }} 19 | - name: Hard Reset Demo From Develop 20 | run: | 21 | git fetch origin develop:develop 22 | git reset --hard origin/develop 23 | git push -f 24 | -------------------------------------------------------------------------------- /.github/workflows/pr-open-to-master-workflows.yml: -------------------------------------------------------------------------------- 1 | name: PR Open to Master Workflows 2 | 3 | on: 4 | pull_request: 5 | types: [ opened ] 6 | branches: 7 | - master 8 | 9 | jobs: 10 | postman-test-run: 11 | name: "Postman Regression Test" 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - name: Checkout Repo 16 | uses: actions/checkout@v2 17 | with: 18 | token: ${{ secrets.MASTER_BRANCH_ACCESS_TOKEN }} 19 | ref: develop 20 | 21 | - name: Install Node 22 | uses: actions/setup-node@v1 23 | with: 24 | node-version: 16 25 | 26 | - name: Install Newman 27 | run: | 28 | npm install -g newman 29 | npm install -g newman-reporter-htmlextra 30 | 31 | - name: Run Regression Tests 32 | run: | 33 | npm install 34 | npm run-script postmanDevelop --adminAuthToken=admin-auth-token=${{ secrets.ADMIN_AUTH_TOKEN }} --responseEncryptionSecret=response-encryption-secret=${{ secrets.RESPONSE_ENCRYPTION_SECRET }} 35 | 36 | - name: Upload Test Results 37 | uses: actions/upload-artifact@v2 38 | with: 39 | name: PostmanReports 40 | path: ./assets/test-results 41 | -------------------------------------------------------------------------------- /.github/workflows/pr-open-workflows.yml: -------------------------------------------------------------------------------- 1 | name: PR Open Workflows 2 | 3 | on: 4 | pull_request: 5 | types: [ opened ] 6 | branches-ignore: [ 'workflow/dependency-update' ] 7 | 8 | jobs: 9 | pr-labeler: 10 | name: 'Add Label to PR' 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - name: Add Label to PR 15 | uses: TimonVS/pr-labeler-action@v3 16 | env: 17 | GITHUB_TOKEN: ${{ secrets.MASTER_BRANCH_ACCESS_TOKEN }} 18 | 19 | automate-project-columns: 20 | name: 'Automate Project Columns' 21 | runs-on: ubuntu-latest 22 | 23 | steps: 24 | - name: Move PR to In-Progress 25 | uses: alex-page/github-project-automation-plus@v0.3.0 26 | with: 27 | project: Open Template Hub Servers 28 | column: In progress 29 | repo-token: ${{ secrets.MASTER_BRANCH_ACCESS_TOKEN }} 30 | 31 | milestone-binder: 32 | name: 'Milestone Binder' 33 | runs-on: ubuntu-latest 34 | 35 | steps: 36 | - name: Set Milestone of the PR 37 | uses: Code-Hex/auto-milestone-binder@v1.0.1 38 | with: 39 | github-token: ${{ secrets.MASTER_BRANCH_ACCESS_TOKEN }} 40 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Out folder 29 | out/ 30 | 31 | # Vscode 32 | .vscode/ 33 | 34 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 35 | .grunt 36 | 37 | # Bower dependency directory (https://bower.io/) 38 | bower_components 39 | 40 | # node-waf configuration 41 | .lock-wscript 42 | 43 | # Compiled binary addons (https://nodejs.org/api/addons.html) 44 | build/Release 45 | 46 | # Dependency directories 47 | node_modules/ 48 | jspm_packages/ 49 | 50 | # TypeScript v1 declaration files 51 | typings/ 52 | 53 | # TypeScript cache 54 | *.tsbuildinfo 55 | 56 | # Optional npm cache directory 57 | .npm 58 | 59 | # Optional eslint cache 60 | .eslintcache 61 | 62 | # Microbundle cache 63 | .rpt2_cache/ 64 | .rts2_cache_cjs/ 65 | .rts2_cache_es/ 66 | .rts2_cache_umd/ 67 | 68 | # Optional REPL history 69 | .node_repl_history 70 | 71 | # Output of 'npm pack' 72 | *.tgz 73 | 74 | # Yarn Integrity file 75 | .yarn-integrity 76 | 77 | # dotenv environment variables file 78 | .env 79 | .env.test 80 | 81 | # parcel-bundler cache (https://parceljs.org/) 82 | .cache 83 | 84 | # Next.js build output 85 | .next 86 | 87 | # Nuxt.js build / generate output 88 | .nuxt 89 | dist 90 | 91 | # Gatsby files 92 | .cache/ 93 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 94 | # https://nextjs.org/blog/next-9-1#public-directory-support 95 | # public 96 | 97 | # vuepress build output 98 | .vuepress/dist 99 | 100 | # Serverless directories 101 | .serverless/ 102 | 103 | # FuseBox cache 104 | .fusebox/ 105 | 106 | # DynamoDB Local files 107 | .dynamodb/ 108 | 109 | # TernJS port file 110 | .tern-port 111 | 112 | package-lock.json 113 | 114 | .idea/* 115 | icon.png 116 | -------------------------------------------------------------------------------- /.run/env.run.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 17 | 18 | -------------------------------------------------------------------------------- /.run/install.run.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.run/outdated.run.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |