Skip to content

Commit

Permalink
feat(#5): wire up auth0 on frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
meatwallace committed May 1, 2024
1 parent b105a89 commit aa7b6ee
Show file tree
Hide file tree
Showing 273 changed files with 5,743 additions and 1,902 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ jobs:
with:
fetch-depth: 0

- name: Setup Dotenv
run: |
echo "${{ secrets.DOTENV_APP_WEB_DEV }}" > projects/app-web/.env.development.local
echo "${{ secrets.DOTENV_APP_WEB_E2E }}" > projects/app-web-e2e/.env
echo "${{ secrets.DOTENV_DB_POSTGRES }}" > projects/db-postgres/.env.production
- name: Setup Node
uses: actions/setup-node@v3
with:
Expand Down Expand Up @@ -61,6 +67,13 @@ jobs:
- name: E2E Tests
run: yarn nx affected -t e2e

- name: Upload Videos Of Failed E2E
uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-results
path: projects/app-web-e2e/.test-results

- name: Record Affected Projects
id: record-affected-projects
if: ${{ github.ref_name == 'main' }}
Expand All @@ -76,9 +89,7 @@ jobs:

- name: Deploy Postgres Migrations
if: ${{ github.ref_name == 'main' && contains(steps.record-affected-projects.outputs.affected-projects, 'db-postgres') }}
run: |
echo "${{secrets.DOTENV_DB_POSTGRES }}" > projects/db-postgres/.env.production
yarn postgres:migrations-run:prod
run: yarn postgres:migrations-run:prod

- name: Deploy API Service
if: ${{ github.ref_name == 'main' && contains(steps.record-affected-projects.outputs.affected-projects, 'service-api') }}
Expand Down
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,21 @@ node_modules
# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings
*.timestamp*.mjs

# Test Output
/coverage
**/.test-results

# System Files
.DS_Store
Thumbs.db
*Zone.Identifier

# caches
.cache
Expand All @@ -47,3 +51,5 @@ Thumbs.db
# secrets
projects/db-postgres/.env.production
projects/service-*/.env.production
projects/app-web-e2e/.env
**/.env*.local
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
yarn dlx lint-staged --concurrent false --relative
yarn dlx lint-staged --concurrent false --relative --allow-empty
2,733 changes: 1,616 additions & 1,117 deletions .pnp.cjs

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/cuid-npm-3.0.0-66e229f427-e1cac04b8d.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/msw-npm-1.3.3-7cd6e8f445-0c63b282a5.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified .yarn/install-state.gz
Binary file not shown.
61 changes: 61 additions & 0 deletions .yarn/patches/mock-jwks-npm-3.1.0-131e3bbc29.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
diff --git a/build/index.d.ts b/build/index.d.ts
index 575dc0e00c51ac7dac66c4e4885c2414ee98fa91..50717f586aba777a4239b726a90347d9c3dcea45 100644
--- a/build/index.d.ts
+++ b/build/index.d.ts
@@ -1,5 +1,8 @@
import { JwtPayload } from 'jsonwebtoken';
+import { HttpHandler } from 'msw';
+
declare const createJWKSMock: (jwksBase: string, jwksPath?: string) => {
+ handler: HttpHandler
start: () => void;
stop: () => void;
kid: () => string;
diff --git a/build/index.js b/build/index.js
index 289a2dac6cd569eef5dbc9329914a7517b442829..bfe7abde0ad358d21b707cc2fa69f721b02b8955 100644
--- a/build/index.js
+++ b/build/index.js
@@ -1,13 +1,20 @@
import { createJWKS, createKeyPair, signJwt } from './tools.js';
import { setupServer } from 'msw/node';
-import { rest } from 'msw';
+import { http, HttpResponse } from 'msw';
+
const createJWKSMock = (jwksBase, jwksPath = '/.well-known/jwks.json') => {
const keypair = createKeyPair();
const JWKS = createJWKS({
...keypair,
jwksOrigin: jwksBase,
});
- const server = setupServer(rest.get(new URL(jwksPath, jwksBase).href, (_, res, ctx) => res(ctx.status(200), ctx.json(JWKS))));
+
+ // we patch & expose the actual msw handler so we can plug it into our own server rather than
+ // creating a conflicting instance. we also bump the msw version to match our own to avoid any
+ // compatibility issues.
+ const handler = http.get(new URL(jwksPath, jwksBase).href, () => HttpResponse.json(JWKS));
+
+ const server = setupServer(handler);
const kid = () => JWKS.keys[0].kid;
const start = () => {
server.listen({ onUnhandledRequest: 'bypass' });
@@ -17,6 +24,7 @@ const createJWKSMock = (jwksBase, jwksPath = '/.well-known/jwks.json') => {
};
const token = (token = {}) => signJwt(keypair.privateKey, token, kid());
return {
+ handler,
start,
stop,
kid,
diff --git a/package.json b/package.json
index e5a5c2fc6b6b5dfec0c88bbf2adf4a88ba33e18b..412355319913b9b7a3743974c47d29fb834c9a93 100644
--- a/package.json
+++ b/package.json
@@ -91,7 +91,7 @@
"dependencies": {
"base64-url": "^2.3.3",
"jsonwebtoken": "^9.0.0",
- "msw": "^1.2.2",
+ "msw": "2.2.14",
"node-forge": "^1.3.1",
"node-rsa": "^1.1.1"
},
Loading

0 comments on commit aa7b6ee

Please sign in to comment.