Commit Graph

49 Commits

Author SHA1 Message Date
renovate[bot]
99782e4ede fix(deps): update dependency fastify to v4.18.0 2023-06-11 03:56:47 +00:00
Oliver Eyton-Williams
65239ee68b feat(api): allow redirection with message (#50525)
Co-authored-by: Muhammed Mustafa <MuhammedElruby@gmail.com>
2023-06-07 15:30:12 +02:00
renovate[bot]
b16f7fe042 fix(deps): update prisma monorepo to v4.15.0 2023-06-04 01:52:16 +00:00
Sem Bauke
c5deeccd3f feat: update my username endpoint (#50271)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2023-06-02 07:04:50 +02:00
Oliver Eyton-Williams
39857b5aa4 test(api): schema security (#50413)
* test: confirm all schemas pass basic validation

* refactor: use tested schemas in routes

* chore: move ajv to dev deps
2023-05-24 09:31:13 -07:00
renovate[bot]
78f31aa966 fix(deps): update prisma monorepo to v4.14.1 2023-05-20 15:42:06 +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
renovate[bot]
0fef335292 fix(deps): update dependency @immobiliarelabs/fastify-sentry to v6 (#50388)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-16 15:21:28 -07:00
renovate[bot]
dd7e7b58f2 fix(deps): update dependency @fastify/middie to 8.3 (#50384)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-15 13:43:53 +03:00
renovate[bot]
decb2e87b6 fix(deps): update dependency fastify to v4.17.0 (#50230)
* fix(deps): update dependency fastify to v4.17.0

* add missing code in error object

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Sboonny <muhammed@freecodecamp.org>
2023-05-15 11:17:09 +03:00
renovate[bot]
e2716c35ea fix(deps): update prisma monorepo to v4.14.0 (#50377)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-15 11:12:59 +03:00
renovate[bot]
427414a24b chore(deps): update dependency @fastify/type-provider-typebox to v3.2.0 2023-05-07 08:05:16 +00:00
renovate[bot]
dd931ab4a1 fix(deps): update dependency @fastify/middie to 8.2 2023-05-07 05:43:12 +00: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
1567894c36 fix(api): use connection string from .env (#50201) 2023-04-27 23:06:43 +01:00
renovate[bot]
cf8dc73fae fix(deps): update prisma monorepo to v4.13.0 2023-04-27 05:32:16 +00:00
renovate[bot]
998069441e chore(deps): update dependency @fastify/type-provider-typebox to v3.1.0 2023-04-23 22:27:54 +00:00
Muhammed Mustafa
daa23a3d83 feat(api): swap to immobiliarelabs sentry plugin (#50041) 2023-04-17 13:10:23 -07:00
renovate[bot]
59743ad3fb fix(deps): update dependency @sentry/node to v7.48.0 2023-04-15 22:45:37 +00:00
renovate[bot]
9d3bf49ed8 fix(deps): update prisma monorepo to v4.12.0 (#50018)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-10 19:26:23 +05:30
renovate[bot]
ad1ba2e982 fix(deps): update dependency @sentry/node to v7.47.0 2023-04-09 13:58:10 +00:00
renovate[bot]
5b2c82d29f chore(deps): update dependency ts-jest to v29.1.0 2023-04-09 03:31:24 +00: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
renovate[bot]
b48d12714a fix(deps): update dependency @sinclair/typebox to v0.26.6 (#49855)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2023-04-03 09:13:36 +00: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
renovate[bot]
afa246942e fix(deps): update dependency fastify to v4.15.0 2023-03-26 15:59:50 +00:00
renovate[bot]
7f21c5b4ae fix(deps): update dependency nodemon to v2.0.22 2023-03-26 03:01:14 +00:00
Niraj Nandish
1dcba784fd feat(api): API documentation with Swagger UI (#49791) 2023-03-24 10:00:51 +01:00
Oliver Eyton-Williams
a0f958189e chore: update api test suite and include it in run test (#49794) 2023-03-23 16:57:11 +00:00
Oliver Eyton-Williams
36b06be8ce chore: extend lint:ts to cover api (#49793)
* fix: include express-session types + suppress err

* chore: add api to lint:ts

* fix: remove unnecessary typeRoots config
2023-03-22 17:59:46 +05:30
renovate[bot]
607111978a fix(deps): update prisma monorepo to v4.11.0 (#49758)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-19 12:25:26 +05:30
Oliver Eyton-Williams
17d7fc0af5 feat(api): use pino-pretty for dev logging (#49713)
feat: use pino-pretty for dev logging
2023-03-16 15:42:01 +00:00
Tom
7aeb4ab76b feat(api): setup jest in new api (#49709)
* feat(api): setup jest in new api

* feat: sample tests
2023-03-16 20:33:40 +05:30
Oliver Eyton-Williams
c2d149ba85 feat(api): create a demo type provider for typebox (#49536)
* feat: create a demo type provider for typebox

* feat: validate reply + share type

* fix: prettify
2023-03-15 14:21:25 +00:00
Oliver Eyton-Williams
fa7955dc75 feat(api): add prisma as orm (#49413) 2023-03-14 17:29:55 +00:00
renovate[bot]
748dea033c fix(deps): update dependency fastify to v4.14.1 2023-03-11 19:45:28 +00:00
Niraj Nandish
4769a448e1 feat(api): sessions management (#49499)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2023-03-09 20:36:33 +05:30
renovate[bot]
933b909111 fix(deps): update dependency fastify to v4.14.0 2023-03-05 10:44:01 +00:00
renovate[bot]
72321ad76b fix(deps): update dependency nodemon to v2.0.21 2023-03-04 17:30:13 +00:00
Oliver Eyton-Williams
d7848ae01a feat: migrate to pnpm for better workspace DX (#49293)
* feat: npm -> pnpm 

This resolves the issues with the gatsby client (gatsby-plugin-pnpm
deals with the fact that gatsby is relying on its own dependencies
being de-duped)
and challenge-editor (which doesn't seem to want to automatically install
codemirror and needed its own eslint config)

* fix: correct mocha path for curriculum tests

* fix: use select workspace with -F not -w

* fix: reorganise packages and restrict hoisting

pnpm works best if the workspaces keep their own dependencies, since
dependencies are not flattened and then what node resolves from a
require is predictable.

@types seem to be a special case and more care is required to prevent
them getting smushed together in the root (hence the .npmrc)

* fix: add types for tools + root

* fix: decouple challenge-auditor from client

* fix: add ui-components types

* fix(client): use the latest types for react 16

* fix: prettify

* fix: prettierignore pnpm-lock

* fix: relax hoisting

Turns out pnpm works just fine with types. I don't know what was going
wrong before, but there are no-longer any type conflicts.

* fix: add @redux-saga/core to fix eslint issue

It seems to only be redux-saga that import/named can't cope with, so it
is probably okay to work around this one.

* chore: add chai to tools/scripts/build

* fix: add store to root for cypress

* fix: allow cypress to download binaries

If we want to keep preventing cypress from downloading binaries, we can
figure out a workaround, but I'm allowing it to ease the transition to
pnpm.

My guess about why this is happening is that npm triggers Cypress's
postinstall script, but pnpm does not (because pnpm install only
installs if necessary, perferring to link)

* chore: re-enable pre/post scripts

* fix: update build scripts for client

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>

* chore: update engines to use pnpm


* fix: enable choice of (super)block for tests

Only 'nix machines for now.

* chore: pin pnpm to version 7

* chore: remove last npms

Except web + curriculum-server. I'll update them when I start work on
them again.

* fix: lockfile check to catch any package-locks

* fix(action): install pnpm for upcoming tests

* chore: add nodemon to new api

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
2023-03-02 18:17:44 +00:00
renovate[bot]
e0975e21e5 fix(deps): update dependency fastify to v4.13.0 2023-02-26 07:19:37 +00:00
renovate[bot]
b36bf511d5 fix(deps): update dependency @fastify/mongodb to v6.2.0 (#49512)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-02-25 17:49:32 +02:00
renovate[bot]
ab2b6907d2 fix(deps): update dependency fastify to v4.10.2 [security] 2023-02-24 22:43:58 +00:00
Mrugesh Mohapatra
7199f033fb feat(next-api): basic authentication setup (#49378)
* feat(next-api): add fastify-auth0-verify plugin

* feat(next-api): add fastify-jwt-authz plugin

* feat(next-api): accept privacy endpoint with scopes support

* fix(next-api): ignore eslint and ts errors

They will be fixed in a future PR when the package with errors has been updated

Co-authored-by: Niraj Nandish <nirajnandish@icloud.com>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2023-02-24 17:26:40 +05:30
Oliver Eyton-Williams
f35ab4d0ba refactor: clean up types and tsconfig (#49360) 2023-02-24 17:25:53 +05:30
Shaun Hamilton
37ed23ef38 feat(api): add node:test (#48437) 2023-02-24 17:25:22 +05:30
Shaun Hamilton
f7644bec68 feat(api): example middleware (#48434)
* feat(api): add middleware example

* feat(api): add `@fastify/middie`, reorder for alphabetness

* [skip-ci] [skip ci]
2023-02-24 17:25:21 +05:30
Shaun Hamilton
6d46f61fe9 refactor(api): shiny new api (#48432) 2023-02-24 17:23:15 +05:30