Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

epic: Server rewrite #10

Merged
merged 61 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
197654a
Replace hardcoded values with ENV variables and starts implementing l…
Danziger Jul 5, 2024
2f181aa
Implement a mocked/local version of KMS client to easily run the serv…
Danziger Jul 8, 2024
31c48d0
Remove old TODO.
Danziger Jul 8, 2024
97fab7e
Implement JWT validation using Auth0's middleware and JWKS client and…
Danziger Jul 11, 2024
9a15deb
Remove TODOs from README.
Danziger Jul 11, 2024
df9d57f
Add idToken in all calls to logRequestSuccess.
Danziger Jul 11, 2024
ec02249
Remove unused import.
Danziger Jul 11, 2024
c7de33a
Reformat code.
Danziger Jul 11, 2024
066f4d9
Remove audience from token verification.
Danziger Jul 11, 2024
65c5d7c
Improve server error handling.
Danziger Jul 12, 2024
12cf5dc
Re-implement asyncHandler with working TS types.
Danziger Jul 12, 2024
0cf6211
Finish Config wrapper for ENV variables.
Danziger Jul 12, 2024
ae06ce3
Remove some old comments / unused code.
Danziger Jul 12, 2024
6e009a4
Remove unused dependencies.
Danziger Jul 12, 2024
929e7c1
Add Auth0's actions.
Danziger Jul 15, 2024
be5e9e7
Add missing fields in IdTokenWithData.
Danziger Jul 15, 2024
99132a8
Add missing fields in IdTokenWithData.
Danziger Jul 15, 2024
a699825
Improve custom error implementation.
Danziger Jul 15, 2024
d0ff5ca
Update dev script to use Bun's watch mode.
Danziger Jul 15, 2024
0d43b72
Remove create-bundle-and-sign endpoint as it was not used anyway.
Danziger Jul 15, 2024
816b8bf
Add some changes to the actions to work with query and body data.
Danziger Jul 16, 2024
1e71199
Improve b64 encoding type and parsing.
Danziger Jul 18, 2024
d45e859
Update handlers to be compatible with the old request and response fo…
Danziger Sep 2, 2024
0d7587a
Update server code to import keys (instead of creating them).
Danziger Sep 2, 2024
35b352d
Move all KMS path bits to CONFIG and conditionally create import jobs…
Danziger Sep 3, 2024
bfa3092
Mock KMS functions needed to import keys.
Danziger Sep 4, 2024
3e9dd5a
Reorganize createUser and import key functions and handlers and creat…
Danziger Sep 4, 2024
393f224
Improve normalization / serialization of binary data.
Danziger Sep 4, 2024
f77978c
Add toLegacyBufferObject() util function.
Danziger Sep 5, 2024
32e7afe
Update debugging code.
Danziger Sep 5, 2024
213867f
Update config.utils.ts KMS credentials validation.
Danziger Sep 5, 2024
5152f9f
Merge pull request #11 from Othent/feature/import-keys-poc
Danziger Sep 5, 2024
1938d8e
Add TODO.
Danziger Sep 5, 2024
7684152
Document old vs new server and SDK interfaces.
Danziger Sep 5, 2024
6c2ce0c
Add Zod schemas for createUser(), encrypt(), decryt() and sign().
Danziger Sep 6, 2024
2c78380
Update Zod schemas.
Danziger Sep 6, 2024
803c982
Fix KMS client mock.
Danziger Sep 6, 2024
957187e
Fix KMS mock.
Danziger Sep 9, 2024
aa01c2a
Update KMS mock return value types.
Danziger Sep 9, 2024
3a42bcd
Add unit tests for encrypt().
Danziger Sep 10, 2024
eca56b6
Add tests for decrypt().
Danziger Sep 11, 2024
267a8ee
Finishes all tests and validation (verifySignature to be fixed).
Danziger Sep 11, 2024
a4d43dd
Fix sign() tests.
Danziger Sep 11, 2024
df8ff86
Fix typo.
Danziger Sep 11, 2024
0e5db6a
Update encrypt(), decryp() and sign() to return/send B64String.
Danziger Sep 11, 2024
1d1f8c1
createUser() returns the IdToken's data.
Danziger Sep 12, 2024
49a447f
Separate auth0.types from auth0.utils.
Danziger Sep 12, 2024
4f8086d
Fix imports.
Danziger Sep 12, 2024
45802f9
Remove exact() from validators.
Danziger Sep 12, 2024
5db2dd2
Remove console.log()s.
Danziger Sep 12, 2024
6635744
Fix test NPM script.
Danziger Sep 12, 2024
eaa7c7f
Fix test setup.
Danziger Sep 12, 2024
349857a
Update src/lib/utils/kms/google-kms.utils.ts
Danziger Sep 16, 2024
aeab154
Update .env.example.
Danziger Sep 16, 2024
222d8fe
Update Auth0 M2M API URL.
Danziger Sep 16, 2024
f01a9f2
Add developer error message about time synching with KMS.
Danziger Sep 16, 2024
1b6b652
Update GitHub actions.
Danziger Sep 23, 2024
a0b5abe
Update all commands in test-server.yml.
Danziger Sep 23, 2024
2a95c7a
Merge pull request #16 from Othent/feature/update-github-actions
Danziger Sep 23, 2024
faf6819
Update engines.
Danziger Sep 23, 2024
96fe5ae
Update engines.
Danziger Sep 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{sh,bash}]
end_of_line = lf
6 changes: 4 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
auth0ClientId=''
auth0ClientDomain='auth.othent.io'

auth0ClientId='uXkRmJoIa0NfzYgYEDAgj6Rss4wR1tIc'

auth0ClientSecret=''

Expand All @@ -8,7 +10,7 @@ googleCredentials=`{}`

signKeyVersion=''

PORT=''
PORT='3010'

mongoDBUsername=''

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
run: npm install
- name: 🧪 Run tests
env:
auth0ClientDomain: ${{ secrets.AUTH0CLIENTDOMAIN }}
auth0ClientId: ${{ secrets.AUTH0CLIENTID }}
auth0ClientSecret: ${{ secrets.AUTH0CLIENTSECRET }}
kmsProjectId: ${{ secrets.KMSPROJECTID }}
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,16 @@
"cors": "^2.8.5",
"dotenv": "^16.3.1",
"express": "^4.18.2",
"express-jwt": "^8.4.1",
"google-auth-library": "^9.11.0",
"jsonwebtoken": "^9.0.2",
"jwk-to-pem": "^2.0.5",
"jwks-rsa": "^3.1.0",
"mongodb": "^6.3.0",
"multer": "^1.4.5-lts.1",
"pem-jwk": "^2.0.0"
},
"devDependencies": {
"tsup": "^8.0.1",
"@types/body-parser": "^1.19.4",
"@types/cors": "^2.8.15",
"@types/express": "^4.17.20",
Expand All @@ -68,6 +70,7 @@
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"tslib": "^2.6.2",
"tsup": "^8.0.1",
"typescript": "^5.2.2"
}
}
Loading
Loading