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

chore(build): add mergify workflow #385

Merged
merged 2 commits into from
Mar 18, 2022
Merged

chore(build): add mergify workflow #385

merged 2 commits into from
Mar 18, 2022

Conversation

seaerchin
Copy link
Contributor

Problem

duplicate of this

Copy link
Contributor

@alexanderleegs alexanderleegs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@seaerchin seaerchin merged commit 2f06b40 into develop Mar 18, 2022
@seaerchin seaerchin deleted the chore/add-mergify branch March 18, 2022 04:32
This was referenced Mar 24, 2022
alexanderleegs added a commit that referenced this pull request Mar 28, 2022
* Fix/retrieve last updated time (#354)

* Fix: use pushed_at instead of updated_at

* Fix: getLastUpdated endpoint

* Fix: prepend unique prefix for release script (#370)

* 0.1.0

* Refactor/auth (#328)

* Feat: Add Auth service

* Feat: add auth router

* Feat: add auth endpoints

* Feat: convert auth middleware to use dependency injection

* feat: add tests for new auth router and service

* Fix: add updated auth router endpoints to auth middleware

* Refactor: verifyJwt into separate helper method

* Nit: add exports for constants

* Nit: add helper function for secure and comments for time

* Style: early return

* Style: test styling

* Nit: adjust comments for importing error

* Nit: adjust unknown route comment

* Nit: return early

* Nit: link issue

* Refactor: move isSecure to utils

* Style: early return

* Nit: remove irrelevant comment

* Refactor/separate auth initialisation (#377)

* Chore: remove unused index router

* Refactor: initialise middleware outside of server.js

* Refactor: move unknown route check to server.js

* Refactor: import auth middleware directly in routers

* Chore: remove noverify method

* Refactor/sites (#341)

* Feat: add sitesService

* Feat: add sites router

* Feat: add site endpoints

* Tests: add tests

* Fix: use pushed_at instead of updated_at

* Style: add spacing to tests

* Style: object destructuring

* Style: return type and map

* Fix: return last updated time instead of string representing time and update tests

* Feat: throw 404 error if no staging url found

* Style: destructuring response

* Feat: add access check in github service

* Fix: tests

* Fix: test comment

* Rebase: use auth verify middleware in sites router

* Fix: test for config priority

* Fix: use originalUrl instead of url (#388)

* fix: order of ping (#392)

* 0.2.0

* chore(build): add mergify workflow (#385)

* chore(add mergify): add mergify workflow

* chore(mergify): remove extra build step

* Fix: use existing githubservice instead of axiosinstance to check for user access

* Refactor: move new logic from auth route into authService

* refactor: shift auth middleware methods to authMiddlewareService

* Fix: await method

* Rebase: inject site token middleware into routers

This commit also adds a path prefix for each router when using the middleware - I realised that we were previously hitting verifyJwt multiple times because a request would sequentially hit all routers until it reached the correct one - given that there was no check on the verifyJwt use in each router, it was called repeatedly

* Fix: add auth middleware to users router

* Fix: auth route and service tests

* Feat: use dependency injection for middleware and identity services

* Refactor: move v2 endpoints into subrouters

* Refactor: use subrouters for v1 endpoints

* Fix: tests

* Fix: move identity constants to fixtures

* Fix: test folder name

* Nit: variable and function name

* Nit: add comments

* Chore: store repeated params in variable

* Nit: test name

* Nit: spacing

* Nit: separate condition for readability

* Chore: remove unnecessary error throwing

* Chore: add comment on error transformation

* Chore: add log statements for errors

* Fix: set userId in res.locals instead of in req

* Nit: add log statement for error

* Nit: add proper error message for not logged in error

* Fix: rebase errors

* Chore: update comment

* Chore: update error message

* Fix: router path

* Chore: update comment

* Chore: update error messages

* Fix: log error instead of providing information in error

Co-authored-by: seaerchin <[email protected]>
seaerchin added a commit that referenced this pull request Mar 30, 2022
* feat: add sequelize and pg libraries

* feat: add sequelize migrations configuration

* feat: add sequelize models for identity

* feat: add database migrations to create tables

* feat: init database connection before starting server

* refactor: capitalize enum values and change to admin or user

* fix: use correct key in db config for username

* feat: add local dev postgres through docker compose

* refactor: remove repo_name column

* feat: add unique index on email

* feat: add SiteService

* feat: add AuthService

* feat: add middleware to inject site access token

* refactor: change variable casing of imported services

* feat: add scaffold for AuthService otp methods

* feat: add UserService

* feat: extend auth middleware to check for isomer user id

* feat: add routes for send and verify otp

* feat: implement actual totp methods

* feat: implement check for whether otp can be sent

* feat: add validator for email format

* feat: implement mail client using postman transactional api

* feat: implement TokenStore

* refactor: initialize services from module index

* fix: use correct expiry value

* feat: add github_id column to user model

* feat: allow email to be null

* feat: create user with github id

* feat: apply verifyJwt for otp routes

* feat: add methods for update and find by github id

* feat: whitelist only by domain

* feat: return email in whoami response

* feat: add verifyOtp endpoint

* refactor: rename to email otp methods

* refactor: move otp routes to /user

* refactor: move identity services to module

* refactor: move email verification methods to user service

* feat: add verification for contact number

* feat: use bad request error

* chore: upgrade sequelize

* refactor: use router pattern for users routes

* fix: undefined reference to usersService

* chore: add sms cred name to example env file

* feat: track last logged in date time

* feat: update err message for non-govt emails

* build(pcakage-lock): update build deps

this commit is from running npm i - there should be no breakage and should be safe to rollback.

* feat(identity): add types (#367)

* build(src): add tsconfig and deletes jsconfig

* build(package): install ts in dev deps

* feat(eslint): adds config for ts

* feat(eslint): adds config for ts

* refactor(authservice): add types to auth service

* refactor(mailclient): add types

* chore(package-lock): remove trailing comma

* build(package): installed ts import resolver

* chore(eslint): update eslint to recognise imports properly

* refactor(smsclient): add types for smsclient

* refactor(tokenstore): add ts

* refactor(totpgenerator): add ts

* chore(eslint/tsconfig): update to recognise @database paths

* chore(services/identity): changed to new imports for TS

* build(tsconfig): changed module to cjs and changed to import statements

* build(package): removed sequelize cli

* feat(identity): unit tests for services (#369)

* build(package/): installed jest-mock-axios

* build(package): installed ts-jest and removed jest config in package.json

* test(jest.config,.js): added jest config

this resolves ts files so that jest can handle them and ts-jest can provide proper typings. the
module name mapping is relocated here

* test(authservice): add spec

* refactor(mailclient): changed mailclient so that initialization fails if api key is empty

* test(mailclient): add tests and axios mock

* refactor(constants): add constants for tests

* refactor(smsclient): change api key retrieval to be done at constructor to allow for tesing

* test(smsclient): add test

* test(tokenstore): added tests

* build(paths): add mocks to path

* chore(tokenstore): update naming for clarity

* chore(totpgenerator): changed access values

* test(totpgenerator): add tests

* refactor(mailclient): changed mailclient initialization for better readability

* refactor: use sequelize-typescript (#374)

* build(deps): add sequelize-typescript and required deps

As described in https://www.npmjs.com/package/sequelize-typescript

* chore(tsconfig): add required flags

Also specified in sequelize-typescript docs

* refactor: convert config file to ts

* refactor: convert db model files into ts

* refactor: use sequelize-ts in server.js

* build(package): installed ts-node-dev

* build(tsconfig): updates tsconfig with ts-node options

we forc ets node to require tsconfig/paths to allow for path aliasing. this is because typescript
requires that the runtime (node/ts-node) does the path aliasing, rather than ts. hence, requiring
tsconfig/paths allows us to use path alias at runtime.

additionally, we add a transpileOnly option. This prevents ts-node from typechecking and transpiles to js only, which increases its transpilation speed.

another option, swc, was also added. this option uses the rust swc compiler for ts, which is significantly faster than the other compilers. this should speed up transpilation speed.

* fix(server): fixed import of logger and sequelize

sequelize (the class) is not a default export and has been changed accordingly. also, logger has
been changed from morgan to winston (the one in our package) as morgan is less powerful than winston

* chore(loaders/www): removed extra loader in www as we now perform it in server

* chore(logger): fixed exports

* fix(pcakage): update build scripts to use ts-node for start

* build(package): install swc transpiler

* revert(database/config): rollback to .js to avoid migration having issues

* feat(identity): add types to last 2 services (#376)

* refactor(server): separated out sequelize from server.js

* chore(services/identity): update to use esm export

chore(tokenstore): use esm export

* refactor(userservice): convert to ts

refactor(userservice): update to ts

* refactor(sitesservice): use ts

* refactor(identity): migrate index to ts

* refactor(server): use new export from identity

* chore(totpgenerator): relaxed typing

* refactor(identity): add comments and rename function

* fix(databse/index): add typecast

* fix(database/config): updated exports

* fix(totpgenerator): made expiry required

* test(identity): add unit tests for user/sites service (#378)

* refactor(server): separated out sequelize from server.js

* build(package): removed sequelize cli

* build(package/): installed jest-mock-axios

* build(package): installed ts-jest and removed jest config in package.json

* test(jest.config,.js): added jest config

this resolves ts files so that jest can handle them and ts-jest can provide proper typings. the
module name mapping is relocated here

* refactor(usersservice): refactor to take in instance of sequelize for ease of testing

* refactor(database): defer sequelization initialization to caller

this allows us to pass in base models at run time rather than statically deciding at compile time.
this is useful when we want to test services that require a db but we wish to mock the db

* test(usersservice): add test

* refactor(sitesservice): change types; add non-null assertion (TO BE REMOVED LATER)

* refactor(sitesservice): propagate null value upwards

* fix(auth): set accessToken only if siteAccessToken exists

* test(sitesservice): add tests

* build(package): installed missing ts-node-dev dependency

* chore(database): allow additional dbconfig for testing

* chore(sequelizerc): removed extra .js

* fix(usersservice): removed extra dot in default whitelist

* feat(identity): add types to user router (#380)

* build(types): installed express and jest typings

* feat(types): add more types

* refactor(req): changed setting userId on req to res.locals

* build(package): installed type-fest

* fix(usersservice): update typing for updateUserByGitHubId

* refactor(users): shift to ts

* refactor(users): fixed typing

Co-authored-by: seaerchin <[email protected]>
Co-authored-by: seaerchin <[email protected]>

Co-authored-by: Preston Lim <[email protected]>

* test(identity): integration tests for user routes (#382)

* build(package): installed sqlite3 and types

* chore(users): removed extra await

* build(build deps): installed umzug (query interface for sequelize)

* chore(package): update test command to use test env

* feat(docker-compose): update to have another test db

* test(jest.config.js): setup global setup/teardown files for integraiton

* chore(config): add path aliases

* build(tests): add setup/teardown scripts for integration

* chore(tests): add logs for setup/teardown

* test(users): add integration tests!!!!!!

* test(usersservice): update test to fit new api

* chore(.env.test): add test env file

* fix(services/identity/index): fixed typing of mockMailer

* chore(constants): shift test constants to tests folder

* chore(constants): add new bearertokenheader

* chore(testss): miinor test fixes

* fix(users.spec): remove explicit mocking for otplib in integration testing

* chore(users): remove extra console log

* chore(users.spec): shift into integration

* Refactor/move identity to v2 endpoints (#368)

* Fix/retrieve last updated time (#354)

* Fix: use pushed_at instead of updated_at

* Fix: getLastUpdated endpoint

* Fix: prepend unique prefix for release script (#370)

* 0.1.0

* Refactor/auth (#328)

* Feat: Add Auth service

* Feat: add auth router

* Feat: add auth endpoints

* Feat: convert auth middleware to use dependency injection

* feat: add tests for new auth router and service

* Fix: add updated auth router endpoints to auth middleware

* Refactor: verifyJwt into separate helper method

* Nit: add exports for constants

* Nit: add helper function for secure and comments for time

* Style: early return

* Style: test styling

* Nit: adjust comments for importing error

* Nit: adjust unknown route comment

* Nit: return early

* Nit: link issue

* Refactor: move isSecure to utils

* Style: early return

* Nit: remove irrelevant comment

* Refactor/separate auth initialisation (#377)

* Chore: remove unused index router

* Refactor: initialise middleware outside of server.js

* Refactor: move unknown route check to server.js

* Refactor: import auth middleware directly in routers

* Chore: remove noverify method

* Refactor/sites (#341)

* Feat: add sitesService

* Feat: add sites router

* Feat: add site endpoints

* Tests: add tests

* Fix: use pushed_at instead of updated_at

* Style: add spacing to tests

* Style: object destructuring

* Style: return type and map

* Fix: return last updated time instead of string representing time and update tests

* Feat: throw 404 error if no staging url found

* Style: destructuring response

* Feat: add access check in github service

* Fix: tests

* Fix: test comment

* Rebase: use auth verify middleware in sites router

* Fix: test for config priority

* Fix: use originalUrl instead of url (#388)

* fix: order of ping (#392)

* 0.2.0

* chore(build): add mergify workflow (#385)

* chore(add mergify): add mergify workflow

* chore(mergify): remove extra build step

* Fix: use existing githubservice instead of axiosinstance to check for user access

* Refactor: move new logic from auth route into authService

* refactor: shift auth middleware methods to authMiddlewareService

* Fix: await method

* Rebase: inject site token middleware into routers

This commit also adds a path prefix for each router when using the middleware - I realised that we were previously hitting verifyJwt multiple times because a request would sequentially hit all routers until it reached the correct one - given that there was no check on the verifyJwt use in each router, it was called repeatedly

* Fix: add auth middleware to users router

* Fix: auth route and service tests

* Feat: use dependency injection for middleware and identity services

* Refactor: move v2 endpoints into subrouters

* Refactor: use subrouters for v1 endpoints

* Fix: tests

* Fix: move identity constants to fixtures

* Fix: test folder name

* Nit: variable and function name

* Nit: add comments

* Chore: store repeated params in variable

* Nit: test name

* Nit: spacing

* Nit: separate condition for readability

* Chore: remove unnecessary error throwing

* Chore: add comment on error transformation

* Chore: add log statements for errors

* Fix: set userId in res.locals instead of in req

* Nit: add log statement for error

* Nit: add proper error message for not logged in error

* Fix: rebase errors

* Chore: update comment

* Chore: update error message

* Fix: router path

* Chore: update comment

* Chore: update error messages

* Fix: log error instead of providing information in error

Co-authored-by: seaerchin <[email protected]>

* Fix: merge errors

* Fix: modify sequelizerc file to use config.js (#406)

* feat(identity): infrastructure changes (#405)

* chore(www.js): rename www -> www.js for ts to transpile it

* build(package): changed start commands and added a build script

the start command is retrieved from:
https://stackoverflow.com/questions/61342753/paths-from-tsconfig-json-doesnt-work-after-tsc

this is required because ts doesn't destructure the path aliases into the actual imports.

* build(tsocnfig): updated tsconfig to emit

this won't affect npm run dev as we are using ts-node and it will transpile on the fly

* ci(ci): add step to build

* chore(gitignore): ignore build drivre

* fix(tsconfig): remove swc :(

swc transpiles experimental flags (metadata/decorators) wrongly; this results in
sequelize-typescript being transpiled wrongly

* chore(authmiddlewareservice): remove logging of cookies

* Fix: set reply_to param for OTP email (#408)

* Fix: set reply_to param for OTP email

* Chore: use support@isomer instead

* Chore: update email to noreply

* Fix: ping endpoint order (#407)

Co-authored-by: Lam Kee Wei <[email protected]>
Co-authored-by: Preston Lim <[email protected]>
Co-authored-by: Alexander Lee <[email protected]>
harishv7 pushed a commit that referenced this pull request Feb 17, 2023
* chore(add mergify): add mergify workflow

* chore(mergify): remove extra build step
harishv7 pushed a commit that referenced this pull request Feb 17, 2023
* feat: add sequelize and pg libraries

* feat: add sequelize migrations configuration

* feat: add sequelize models for identity

* feat: add database migrations to create tables

* feat: init database connection before starting server

* refactor: capitalize enum values and change to admin or user

* fix: use correct key in db config for username

* feat: add local dev postgres through docker compose

* refactor: remove repo_name column

* feat: add unique index on email

* feat: add SiteService

* feat: add AuthService

* feat: add middleware to inject site access token

* refactor: change variable casing of imported services

* feat: add scaffold for AuthService otp methods

* feat: add UserService

* feat: extend auth middleware to check for isomer user id

* feat: add routes for send and verify otp

* feat: implement actual totp methods

* feat: implement check for whether otp can be sent

* feat: add validator for email format

* feat: implement mail client using postman transactional api

* feat: implement TokenStore

* refactor: initialize services from module index

* fix: use correct expiry value

* feat: add github_id column to user model

* feat: allow email to be null

* feat: create user with github id

* feat: apply verifyJwt for otp routes

* feat: add methods for update and find by github id

* feat: whitelist only by domain

* feat: return email in whoami response

* feat: add verifyOtp endpoint

* refactor: rename to email otp methods

* refactor: move otp routes to /user

* refactor: move identity services to module

* refactor: move email verification methods to user service

* feat: add verification for contact number

* feat: use bad request error

* chore: upgrade sequelize

* refactor: use router pattern for users routes

* fix: undefined reference to usersService

* chore: add sms cred name to example env file

* feat: track last logged in date time

* feat: update err message for non-govt emails

* build(pcakage-lock): update build deps

this commit is from running npm i - there should be no breakage and should be safe to rollback.

* feat(identity): add types (#367)

* build(src): add tsconfig and deletes jsconfig

* build(package): install ts in dev deps

* feat(eslint): adds config for ts

* feat(eslint): adds config for ts

* refactor(authservice): add types to auth service

* refactor(mailclient): add types

* chore(package-lock): remove trailing comma

* build(package): installed ts import resolver

* chore(eslint): update eslint to recognise imports properly

* refactor(smsclient): add types for smsclient

* refactor(tokenstore): add ts

* refactor(totpgenerator): add ts

* chore(eslint/tsconfig): update to recognise @database paths

* chore(services/identity): changed to new imports for TS

* build(tsconfig): changed module to cjs and changed to import statements

* build(package): removed sequelize cli

* feat(identity): unit tests for services (#369)

* build(package/): installed jest-mock-axios

* build(package): installed ts-jest and removed jest config in package.json

* test(jest.config,.js): added jest config

this resolves ts files so that jest can handle them and ts-jest can provide proper typings. the
module name mapping is relocated here

* test(authservice): add spec

* refactor(mailclient): changed mailclient so that initialization fails if api key is empty

* test(mailclient): add tests and axios mock

* refactor(constants): add constants for tests

* refactor(smsclient): change api key retrieval to be done at constructor to allow for tesing

* test(smsclient): add test

* test(tokenstore): added tests

* build(paths): add mocks to path

* chore(tokenstore): update naming for clarity

* chore(totpgenerator): changed access values

* test(totpgenerator): add tests

* refactor(mailclient): changed mailclient initialization for better readability

* refactor: use sequelize-typescript (#374)

* build(deps): add sequelize-typescript and required deps

As described in https://www.npmjs.com/package/sequelize-typescript

* chore(tsconfig): add required flags

Also specified in sequelize-typescript docs

* refactor: convert config file to ts

* refactor: convert db model files into ts

* refactor: use sequelize-ts in server.js

* build(package): installed ts-node-dev

* build(tsconfig): updates tsconfig with ts-node options

we forc ets node to require tsconfig/paths to allow for path aliasing. this is because typescript
requires that the runtime (node/ts-node) does the path aliasing, rather than ts. hence, requiring
tsconfig/paths allows us to use path alias at runtime.

additionally, we add a transpileOnly option. This prevents ts-node from typechecking and transpiles to js only, which increases its transpilation speed.

another option, swc, was also added. this option uses the rust swc compiler for ts, which is significantly faster than the other compilers. this should speed up transpilation speed.

* fix(server): fixed import of logger and sequelize

sequelize (the class) is not a default export and has been changed accordingly. also, logger has
been changed from morgan to winston (the one in our package) as morgan is less powerful than winston

* chore(loaders/www): removed extra loader in www as we now perform it in server

* chore(logger): fixed exports

* fix(pcakage): update build scripts to use ts-node for start

* build(package): install swc transpiler

* revert(database/config): rollback to .js to avoid migration having issues

* feat(identity): add types to last 2 services (#376)

* refactor(server): separated out sequelize from server.js

* chore(services/identity): update to use esm export

chore(tokenstore): use esm export

* refactor(userservice): convert to ts

refactor(userservice): update to ts

* refactor(sitesservice): use ts

* refactor(identity): migrate index to ts

* refactor(server): use new export from identity

* chore(totpgenerator): relaxed typing

* refactor(identity): add comments and rename function

* fix(databse/index): add typecast

* fix(database/config): updated exports

* fix(totpgenerator): made expiry required

* test(identity): add unit tests for user/sites service (#378)

* refactor(server): separated out sequelize from server.js

* build(package): removed sequelize cli

* build(package/): installed jest-mock-axios

* build(package): installed ts-jest and removed jest config in package.json

* test(jest.config,.js): added jest config

this resolves ts files so that jest can handle them and ts-jest can provide proper typings. the
module name mapping is relocated here

* refactor(usersservice): refactor to take in instance of sequelize for ease of testing

* refactor(database): defer sequelization initialization to caller

this allows us to pass in base models at run time rather than statically deciding at compile time.
this is useful when we want to test services that require a db but we wish to mock the db

* test(usersservice): add test

* refactor(sitesservice): change types; add non-null assertion (TO BE REMOVED LATER)

* refactor(sitesservice): propagate null value upwards

* fix(auth): set accessToken only if siteAccessToken exists

* test(sitesservice): add tests

* build(package): installed missing ts-node-dev dependency

* chore(database): allow additional dbconfig for testing

* chore(sequelizerc): removed extra .js

* fix(usersservice): removed extra dot in default whitelist

* feat(identity): add types to user router (#380)

* build(types): installed express and jest typings

* feat(types): add more types

* refactor(req): changed setting userId on req to res.locals

* build(package): installed type-fest

* fix(usersservice): update typing for updateUserByGitHubId

* refactor(users): shift to ts

* refactor(users): fixed typing

Co-authored-by: seaerchin <[email protected]>
Co-authored-by: seaerchin <[email protected]>

Co-authored-by: Preston Lim <[email protected]>

* test(identity): integration tests for user routes (#382)

* build(package): installed sqlite3 and types

* chore(users): removed extra await

* build(build deps): installed umzug (query interface for sequelize)

* chore(package): update test command to use test env

* feat(docker-compose): update to have another test db

* test(jest.config.js): setup global setup/teardown files for integraiton

* chore(config): add path aliases

* build(tests): add setup/teardown scripts for integration

* chore(tests): add logs for setup/teardown

* test(users): add integration tests!!!!!!

* test(usersservice): update test to fit new api

* chore(.env.test): add test env file

* fix(services/identity/index): fixed typing of mockMailer

* chore(constants): shift test constants to tests folder

* chore(constants): add new bearertokenheader

* chore(testss): miinor test fixes

* fix(users.spec): remove explicit mocking for otplib in integration testing

* chore(users): remove extra console log

* chore(users.spec): shift into integration

* Refactor/move identity to v2 endpoints (#368)

* Fix/retrieve last updated time (#354)

* Fix: use pushed_at instead of updated_at

* Fix: getLastUpdated endpoint

* Fix: prepend unique prefix for release script (#370)

* 0.1.0

* Refactor/auth (#328)

* Feat: Add Auth service

* Feat: add auth router

* Feat: add auth endpoints

* Feat: convert auth middleware to use dependency injection

* feat: add tests for new auth router and service

* Fix: add updated auth router endpoints to auth middleware

* Refactor: verifyJwt into separate helper method

* Nit: add exports for constants

* Nit: add helper function for secure and comments for time

* Style: early return

* Style: test styling

* Nit: adjust comments for importing error

* Nit: adjust unknown route comment

* Nit: return early

* Nit: link issue

* Refactor: move isSecure to utils

* Style: early return

* Nit: remove irrelevant comment

* Refactor/separate auth initialisation (#377)

* Chore: remove unused index router

* Refactor: initialise middleware outside of server.js

* Refactor: move unknown route check to server.js

* Refactor: import auth middleware directly in routers

* Chore: remove noverify method

* Refactor/sites (#341)

* Feat: add sitesService

* Feat: add sites router

* Feat: add site endpoints

* Tests: add tests

* Fix: use pushed_at instead of updated_at

* Style: add spacing to tests

* Style: object destructuring

* Style: return type and map

* Fix: return last updated time instead of string representing time and update tests

* Feat: throw 404 error if no staging url found

* Style: destructuring response

* Feat: add access check in github service

* Fix: tests

* Fix: test comment

* Rebase: use auth verify middleware in sites router

* Fix: test for config priority

* Fix: use originalUrl instead of url (#388)

* fix: order of ping (#392)

* 0.2.0

* chore(build): add mergify workflow (#385)

* chore(add mergify): add mergify workflow

* chore(mergify): remove extra build step

* Fix: use existing githubservice instead of axiosinstance to check for user access

* Refactor: move new logic from auth route into authService

* refactor: shift auth middleware methods to authMiddlewareService

* Fix: await method

* Rebase: inject site token middleware into routers

This commit also adds a path prefix for each router when using the middleware - I realised that we were previously hitting verifyJwt multiple times because a request would sequentially hit all routers until it reached the correct one - given that there was no check on the verifyJwt use in each router, it was called repeatedly

* Fix: add auth middleware to users router

* Fix: auth route and service tests

* Feat: use dependency injection for middleware and identity services

* Refactor: move v2 endpoints into subrouters

* Refactor: use subrouters for v1 endpoints

* Fix: tests

* Fix: move identity constants to fixtures

* Fix: test folder name

* Nit: variable and function name

* Nit: add comments

* Chore: store repeated params in variable

* Nit: test name

* Nit: spacing

* Nit: separate condition for readability

* Chore: remove unnecessary error throwing

* Chore: add comment on error transformation

* Chore: add log statements for errors

* Fix: set userId in res.locals instead of in req

* Nit: add log statement for error

* Nit: add proper error message for not logged in error

* Fix: rebase errors

* Chore: update comment

* Chore: update error message

* Fix: router path

* Chore: update comment

* Chore: update error messages

* Fix: log error instead of providing information in error

Co-authored-by: seaerchin <[email protected]>

* Fix: merge errors

* Fix: modify sequelizerc file to use config.js (#406)

* feat(identity): infrastructure changes (#405)

* chore(www.js): rename www -> www.js for ts to transpile it

* build(package): changed start commands and added a build script

the start command is retrieved from:
https://stackoverflow.com/questions/61342753/paths-from-tsconfig-json-doesnt-work-after-tsc

this is required because ts doesn't destructure the path aliases into the actual imports.

* build(tsocnfig): updated tsconfig to emit

this won't affect npm run dev as we are using ts-node and it will transpile on the fly

* ci(ci): add step to build

* chore(gitignore): ignore build drivre

* fix(tsconfig): remove swc :(

swc transpiles experimental flags (metadata/decorators) wrongly; this results in
sequelize-typescript being transpiled wrongly

* chore(authmiddlewareservice): remove logging of cookies

* Fix: set reply_to param for OTP email (#408)

* Fix: set reply_to param for OTP email

* Chore: use support@isomer instead

* Chore: update email to noreply

* Fix: ping endpoint order (#407)

Co-authored-by: Lam Kee Wei <[email protected]>
Co-authored-by: Preston Lim <[email protected]>
Co-authored-by: Alexander Lee <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants