Commit Graph

25 Commits

Author SHA1 Message Date
Oliver Eyton-Williams
56e520b2e4 refactor(api): provide default env values (#57986) 2025-01-08 21:39:40 +05:30
Oliver Eyton-Williams
d3cfb8ed0f fix(api): make log level + flags optional (#57978) 2025-01-07 17:52:21 +02:00
Shaun Hamilton
a477643d7d chore(api): add log level configuration 2025-01-02 18:21:55 +05:30
Shaun Hamilton
55deb556ce feat(api): add sentry event route 2025-01-02 18:21:54 +05:30
Mrugesh Mohapatra
4d4e617b7d fix(sentry): use environments 2025-01-02 18:21:54 +05:30
Shaun Hamilton
423db476de chore(api): enable exam environment endpoints in prod (#57604) 2024-12-19 15:13:39 +05:30
Oliver Eyton-Williams
f2ec6d6dd5 feat(api): env var to control exam environment (#56701) 2024-10-16 21:48:04 +02:00
Shaun Hamilton
7f1a6e553f chore(api): add request/response shadow dev tool (#56628) 2024-10-11 09:32:20 -07:00
Lars Kappert
d32e57813e chore: update Knip to v5 (#56244) 2024-09-26 13:12:00 +02:00
Oliver Eyton-Williams
e94080add5 feat(api): implement authorization code flow in the new api (#55413) 2024-07-24 20:08:10 +03:00
Oliver Eyton-Williams
5fcdfe0ec2 fix(api): control host with env var (#55439) 2024-07-08 18:09:18 +05:30
Oliver Eyton-Williams
4c412bff9a chore(api): remove unused session handling (#55240) 2024-06-20 20:18:16 +02:00
Oliver Eyton-Williams
6fe2b0811f fix(mailhog): use docker network address in containers (#54877) 2024-05-23 11:21:32 +02:00
Oliver Eyton-Williams
84a81c842b fix(api): remove cookie domain in development (#54518) 2024-04-26 08:32:46 -07:00
Oliver Eyton-Williams
aacfb281fb feat(api): use jwt_access_token (in development) (#53997)
Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>
2024-03-20 13:47:12 +02:00
Oliver Eyton-Williams
9f71d1c3ac test: stop mocking env vars in jest.utils (#53985) 2024-03-07 08:36:06 +01:00
Shaun Hamilton
bbc1ffa489 feat(api): add PUT /certificate/verify (#51507)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2024-02-28 16:01:35 +00:00
Ahmad Abdolsaheb
0060e78715 feat(api): add POST /donate/charge-stripe-card (#51348)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2023-10-06 12:56:26 +00:00
Oliver Eyton-Williams
f3da82518a feat(api): email service (#50637)
Co-authored-by: Naomi Carrigan <nhcarrigan@gmail.com>
2023-08-04 18:57:59 -07:00
Oliver Eyton-Williams
16c0949a4b feat(api): user/user-token (#50721)
Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
2023-06-29 10:36:44 +00:00
Oliver Eyton-Williams
c3c912db07 feat(api): add csrf protection (#50275)
Co-authored-by: Sboonny <muhammed@freecodecamp.org>
2023-05-18 17:06:40 +05:30
Oliver Eyton-Williams
46cdfd7802 feat(api): add CORS headers (#50120)
* test: allow mocking of env vars

Since utils/env is a module, we can mock it to control env vars in
tests. However, it's not compatible with building the server in
setupFilesAfterEnv, so, instead, we can use a utility function to keep
things DRY.

* fix: update type of fastifyTestInstance

* chore: add comment about sts preload

* chore: rename header plugin

* test: add get util + provide origin on request

* feat: add cors headers

* chore: add TODO
2023-04-26 09:02:12 +02:00
Muhammed Mustafa
1d8e9fb0b7 feat(api): create sentry plugin (#49731)
* feat(api): add sentry plugin

Apply suggestions from code review

Revert "feat(api): add sentry plugin"

This reverts commit fcde4ee03e9b83e335a6a2bccd490490e9993597.

install sentryNode

WIP: create sentry debug

WIP: find out why use errorhandler isn't typed correct

install sentry

add the deleted sentry code

create sentry plugin

* fix error found through sentry

* Polish sentry plugin

Co-authored-by: Niraj Nandish <nirajnandish@icloud.com>

* duplicate the changes made in the other plugin

* add done to seterrorHandler

* Fix a typo in sentry option

Co-authored-by: Naomi Carrigan <nhcarrigan@gmail.com>

* Stop the dns from running if a DSN wasn't provided

Co-authored-by: Naomi Carrigan <nhcarrigan@gmail.com>

* Polish the function and check the variable value

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>

* check the dsn dashboard in the env

* export dsn value if it isn't sentrydashboard

Co-authored-by: Naomi Carrigan <nhcarrigan@gmail.com>

* when the value is undefined init errors

* revert the if statement

* throw an error whenever an environment variable is not right

---------

Co-authored-by: Niraj Nandish <nirajnandish@icloud.com>
Co-authored-by: Naomi Carrigan <nhcarrigan@gmail.com>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2023-04-05 08:35:23 -07:00
Oliver Eyton-Williams
06d4076a45 feat(api): dev login (#49880)
Co-authored-by: Mrugesh Mohapatra <hi@mrugesh.dev>
2023-03-29 18:08:38 +05:30
Oliver Eyton-Williams
a128dd8fcd chore(api): compile TS into /dist (#49812
* chore: compile TS into /dist

Having the output co-located with the source meant that the js would be
imported by default. Given that we don't recompile on source changes,
this means the server got 'stuck' at the point of compilation and would
only register changes on build.

Also, compiling to a dist directory should make it easier to build when
we want to deploy. That said, the motivation is mostly DX.

* fix: put schema.prisma in the default location
2023-03-28 19:42:20 +05:30