Commit Graph

28 Commits

Author SHA1 Message Date
Muhammed Mustafa
086ff36333 feat(api): get certslug route (#50515)
Co-authored-by: Sboonny <muhammed@freecodecamp.org>
Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
Co-authored-by: moT01 <20648924+moT01@users.noreply.github.com>
2024-04-11 12:27:46 +05:30
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
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
Oliver Eyton-Williams
056ac85e52 chore: delete auth0 PKCE routes (#53820) 2024-02-22 22:44:13 +05:30
Niraj Nandish
be00d5f3bb feat: mobile login enpoint (#51829)
Co-authored-by: Mrugesh Mohapatra <noreply@mrugesh.dev>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2023-11-08 19:07:57 +00:00
Shaun Hamilton
3cc47929cf fix: remove unused ts-ignore 2023-11-08 10:11:28 +02:00
Oliver Eyton-Williams
a23a92fb8a feat(api): allow client to signin/signout (#51679) 2023-10-04 09:34:23 -05:00
Oliver Eyton-Williams
25ff25e74f feat(api): remove csrf protection from get-session-user (#51615) 2023-10-03 16:17:00 -05: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
Naomi Carrigan
0aa1ad0d09 feat: require JSDoc in new api (#50429)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2023-08-03 21:50:54 +05:30
Oliver Eyton-Williams
5482650dd0 feat(api): project-completed (#50701)
Co-authored-by: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com>
Co-authored-by: Niraj Nandish <nirajnandish@icloud.com>
2023-07-17 12:03:17 +04:00
Muhammed Mustafa
ea45dc84b7 feat(api): add :email unsubscribe/:email to the deprecated (#50497)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2023-06-22 10:25:40 -05:00
Sem Bauke
f3385dda8e feat: /status/ping endpoint (#50697) 2023-06-14 19:27:10 +04:00
Sem Bauke
754ae54387 feat: add /add-donation endpoint (#50441)
Co-authored-by: Muhammed Mustafa <MuhammedElruby@gmail.com>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2023-06-07 14:04:32 +02:00
Oliver Eyton-Williams
30419c2e20 refactor: register fastify-sentry directly (#50622) 2023-06-06 13:45:12 +02:00
Niraj Nandish
94534382ae fix(api): rename account delete endpoint (#50485) 2023-05-23 21:37:29 -07:00
Niraj Nandish
999d8a6c03 feat(api): create account delete endpoint (#50304)
* feat(api): create account delete endpoint

---------

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2023-05-18 17:01:21 +03: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
Niraj Nandish
5bc14c21b9 feat: deprecated endpoint (#50403)
* feat: deprecated endpoints
2023-05-17 10:24:57 +03:00
Niraj Nandish
032f9d95ae feat(api): add update privacy terms endpoint (#50300)
* feat: move update privacy terms route

* test: update privacy terms route tests

* feat: add /settings prefix to settings route

* fix: updated routes in tests

* Revert "fix: updated routes in tests"

This reverts commit 4a1305e135.

* Revert "feat: add /settings prefix to settings route"

This reverts commit 2a0d4566fe.
2023-05-15 13:21:32 -07:00
Oliver Eyton-Williams
7572f99f74 refactor(api): remove unused endpoints (#50252)
Also adds "dev" as an alias because I keep trying to use it.
2023-05-02 19:54:05 +03:00
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
Sem Bauke
a1504eed2a feat: update my theme endpoint (#50183)
Co-authored-by: Shaun Hamilton <ShaunSHamilton@users.noreply.github.com>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
Co-authored-by: Muhammed Mustafa <muhammed@freecodecamp.org>
Co-authored-by: Tom <moT01@users.noreply.github.com>
2023-04-25 18:01:32 +02:00
Sem Bauke
a980ac03e5 feat: introduce /update-my-profileui route in new API (#49827)
* feat: add response codes

* fix: update TypeBox imports

* refactor: convert inject based tests to supertest

* feat: require authentication to use route

* test: confirm db is updated as expected

* fix: respond appropriately on error

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
Co-authored-by: Niraj Nandish <nirajnandish@icloud.com>
Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>
2023-04-18 15:01:26 +00:00
Oliver Eyton-Williams
71d5a67745 feat(api): add security headers (#49995)
* feat(api): add security headers

Includes the OWASP recommended headers for REST APIs. Taken from
https://cheatsheetseries.owasp.org/cheatsheets/REST_Security_Cheat_Sheet.html#security-headers

* test: check OWASP headers appear on GET / request

* fix: only enable Strict-Transport-Security in prod
2023-04-13 10:16:58 +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