Commit Graph

37 Commits

Author SHA1 Message Date
Iain Sproat 1c0b6e228d chore(server/middleware): allow CORS to be configurable (#4018)
- renames corsMiddleware to corsMiddlewareFactory to follow naming convention
- optionally allow cors middleware to be configured
- amend direct calls of `cors` package to now use middleware factory
2025-02-18 13:50:34 +00:00
Iain Sproat c59e6043bb fix(server/errors): derive errors from BaseError (#3918) 2025-01-30 18:15:56 +01:00
Kristaps Fabians Geikins fe1997b86d chore(server): core IoC #76 - validateTokenFactory 2024-10-16 17:43:26 +03:00
Kristaps Fabians Geikins bd14791db0 chore(server): core IoC #74 - revokeTokenByIdFactory 2024-10-16 17:21:41 +03:00
Kristaps Fabians Geikins 8abc801bae chore(server): core IoC #71 - createAppTokenFactory 2024-10-16 16:59:54 +03:00
Kristaps Fabians Geikins 3b47774a9a chore(server): auth typescript cleanup (#3045)
* chore(server): auth IoC 19 - setupStrategiesFactory

* chore(server): auth typescript cleanup
2024-09-20 12:23:12 +03:00
Kristaps Fabians Geikins f83b307d82 chore(server): auth IoC 12 - refreshAppTokenFactory (#3033)
* chore(server): auth IoC 3 - getAllAppsCreatedByUserFactory

* minor fix

* chore(server): auth IoC 4 - getAllAppsAuthorizedByUserFactory

* chore(server): auth IoC 5 - createAppFactory

* chore(server): auth IoC 6 - updateAppFactory

* chore(server): auth IoC 7 - deleteAppFactory

* chore(server): auth IoC 8 - revokeExistingAppCredentialsForUserFactory

* chore(server): auth IoC 9 - revokeRefreshTokenFactory

* chore(server): auth IoC 10 - createAuthorizationCodeFactory

* chore(server): auth IoC 11 - createAppTokenFromAccessCodeFactory

* chore(server): auth IoC 12 - refreshAppTokenFactory

---------

Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
2024-09-19 10:51:00 +02:00
Kristaps Fabians Geikins f5e4e09c9f chore(server): auth IoC 11 - createAppTokenFromAccessCodeFactory (#3032)
* chore(server): auth IoC 3 - getAllAppsCreatedByUserFactory

* minor fix

* chore(server): auth IoC 4 - getAllAppsAuthorizedByUserFactory

* chore(server): auth IoC 5 - createAppFactory

* chore(server): auth IoC 6 - updateAppFactory

* chore(server): auth IoC 7 - deleteAppFactory

* chore(server): auth IoC 8 - revokeExistingAppCredentialsForUserFactory

* chore(server): auth IoC 9 - revokeRefreshTokenFactory

* chore(server): auth IoC 10 - createAuthorizationCodeFactory

* chore(server): auth IoC 11 - createAppTokenFromAccessCodeFactory

---------

Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
2024-09-19 09:58:37 +02:00
Kristaps Fabians Geikins 52b2601a54 chore(server): auth IoC 10 - createAuthorizationCodeFactory (#3031)
* chore(server): auth IoC 3 - getAllAppsCreatedByUserFactory

* minor fix

* chore(server): auth IoC 4 - getAllAppsAuthorizedByUserFactory

* chore(server): auth IoC 5 - createAppFactory

* chore(server): auth IoC 6 - updateAppFactory

* chore(server): auth IoC 7 - deleteAppFactory

* chore(server): auth IoC 8 - revokeExistingAppCredentialsForUserFactory

* chore(server): auth IoC 9 - revokeRefreshTokenFactory

* chore(server): auth IoC 10 - createAuthorizationCodeFactory

---------

Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
2024-09-19 09:54:22 +02:00
Kristaps Fabians Geikins af37bfb76c chore(server): auth IoC 9 - revokeRefreshTokenFactory (#3029)
* chore(server): auth IoC 3 - getAllAppsCreatedByUserFactory

* minor fix

* chore(server): auth IoC 4 - getAllAppsAuthorizedByUserFactory

* chore(server): auth IoC 5 - createAppFactory

* chore(server): auth IoC 6 - updateAppFactory

* chore(server): auth IoC 7 - deleteAppFactory

* chore(server): auth IoC 8 - revokeExistingAppCredentialsForUserFactory

* chore(server): auth IoC 9 - revokeRefreshTokenFactory

---------

Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
2024-09-19 09:52:07 +02:00
Kristaps Fabians Geikins 68376b91c1 auth IoC 1 - initializeDefaultAppsFactory 2024-09-17 14:04:37 +03:00
Kristaps Fabians Geikins c92938eff3 chore(server): apollo server v3 -> v4 (#2880)
* main changes seem to be done?

* lint fix

* minor cleanup

* dataloader clear
2024-09-05 12:27:13 +03:00
Iain Sproat 26b0ecb55d chore(server): remove sentry and only apply mixpanel middleware if enabled (#2732)
- remove sentry as we are no longer using it
- only enable mixpanel middleware if mixpanel is enabled
2024-08-23 16:56:54 +01:00
Kristaps Fabians Geikins 6af6c656a4 feat(fe2): app authorization workflow redesign [WBX-217] (#2044)
* WIP

* new permissions table

* permissions grouped

* updated scope descriptions

* more scope copy adjustments

* allow auth error handling

* manually closable toast notification

* fixed mentions rendering

* error view

* not you? feature

* cleanup

* minor styling changes

* WIP table

* finished authorized apps table

* minor cleanup

* cleaning up comment

* testing changes
2024-02-23 16:50:07 +02:00
Iain Sproat e3bedf9863 fix(logging): typo which expected logger in res, should be req (#1916) 2023-12-13 11:53:11 +00:00
Gergő Jedlicska bd98b56e02 refactor(server scopes): use constants for tokens write scope 2023-07-26 13:51:24 +02:00
Iain Sproat 7e89950358 feat(logging): log all http requests and responses (#1416)
- feat(logging): log all http requests and responses
- the auto logger does not log the body, to ensure sensitive payloads are not logged. Unfortunately this means that error messages are not logged either, so need to be manually logged.
- fix(logging): 400 errors should be info not error severity logging
2023-02-27 15:14:56 +00:00
Iain Sproat 4b1969c804 chore(server): improve logging of REST API endpoints (#1414)
- chore(server): adds endpoint parameter to some log messages
- and any other relevant parameters we have to hand (streamId, userId etc..)
- logging severity is info for `400` status codes, error for `500` status codes or equivalent.
2023-02-24 11:22:21 +00:00
Iain Sproat e3ba2cc9c3 fix(log): auth endpoint should not log app secrets (#1372)
- logs are now warn severity, as they are not necessarily system errors and may be user errors or incorrectly configured application errors.
- improved the error messages, as we should not have multiple errors with the same message as this makes debugging difficult.
2023-02-15 12:40:32 +00:00
Iain Sproat 4d01e13a84 feat(structured logging) (#1242)
* Revert "Revert structured logging 2 (#1240)"
This reverts commit 78ecaeffcb.
* Logging should not be bundled into core shared directory
* making sure observability stuff isnt bundled into frontend


Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>
2022-12-06 11:51:18 +00:00
Iain Sproat 78ecaeffcb Revert structured logging 2 (#1240)
* Revert "'@' shortcut must come after it is configured in bootstrap (#1239)"

This reverts commit 967329473f.

* Revert "Structured logging (attempt 2) (#1234)"

This reverts commit 444d2ca7dd.
2022-12-05 15:46:09 +00:00
Iain Sproat 444d2ca7dd Structured logging (attempt 2) (#1234)
* Revert "Revert "feat(structured logging): implements structured logging for backend (#1217)" (#1227)"

This reverts commit 63e6581162.

* Use pino-http instead of express pino logger
* Use correct reference to knex and do not instantiate HttpLogger prematurely
* Adds missing dependency for pino to webhook-service
* Do not instantiate middleware when passed to express
* Refactor to move logging into shared
* Copy shared packages into dockerfiles
* Build shared workspace in docker build-stage for fileimport & webhook
2022-12-05 14:49:52 +00:00
Iain Sproat 63e6581162 Revert "feat(structured logging): implements structured logging for backend (#1217)" (#1227)
This reverts commit 84cb74e8b3.
2022-11-25 16:57:28 +00:00
Iain Sproat 84cb74e8b3 feat(structured logging): implements structured logging for backend (#1217)
* each log line is a json object
* structured logging allows logs to be ingested by machines and the logs to be indexed and queried addresses #1105
* structured logging allows arbitrary properties to be appended to each log line, and ingestion of logs to remain robust
* Structured logging provided by `pino` library
* Add `express-pino-logger` dependency
* Remove `debug`, `morgan`, and `morgan-debug` and replace with structured logging
* `console.log` & `console.error` replaced with structured logging in backend
* Remove `DEBUG` environment variable and replace with `LOG_LEVEL`
- Note that there is a test which reads from a logged line on `stdout`. This is not robust, it would be better to use the childProcess.pid to look up the port number.
* Log errors at points we explicitly send error to Sentry
* Amend indentation of a couple of log messages to align indentation with others
2022-11-25 16:05:05 +00:00
Kristaps Fabians Geikins f0524b53db fix: various security alert fixes (#1202)
* fix: some extra param validation for some API endpoints

* fix(server): potentially leaking internal error details

* fix: secure session cookie for ssl servers

* fix(server): fixing tests
2022-11-15 12:30:13 +02:00
Gergő Jedlicska 908bbfb937 Gergo/file imports hotfix (#1025)
* fix(server): fix 'speckle:error(s)' mismatching naming

* fix(frontend): add mtl as documented file import format, fix missing computed prop

* fix(fileimports): specklepy operations.send shouldn't use local cache for sending

fixes #1017

* obj import skip using default cache
2022-09-23 13:20:53 +02:00
Matteo Cominetti 8b7f539427 feat: removes matomo & changes some CI/CD settings (#670) 2022-04-06 15:58:05 +03:00
Gergő Jedlicska 4812d53aa4 Merge branch 'main' of github.com:specklesystems/speckle-server into eslintAllTheThings 2022-04-04 22:06:53 +02:00
Fabians 1c7436e7ff extra prefer-const & object-shorthand 2022-04-04 19:00:24 +03:00
Kristaps Fabians Geikins 16da51b96a fix(server): awaiting revokeRefreshToken to ensure it fails within request scope (#652)
* fix(server): awaiting revokeRefreshToken to ensure it fails within request scope

* removed unnecessary error throw
2022-04-04 17:00:27 +03:00
Gergő Jedlicska d53df11f77 style(server): fix all eslint errors and break the tests 2022-03-31 14:18:44 +02:00
Fabians abe6d5e086 chore: re-formatted everything with prettier 2022-03-30 12:54:24 +03:00
Gergő Jedlicska 569b4688fa style(all): reformat with print width 88 2022-03-29 19:46:49 +02:00
Fabians aa5e94d640 chore: reformatting everything with prettier 2022-03-29 17:12:31 +03:00
Dimitrie Stefanescu fe4033a62e fix(server): allows cors on auth token exchange route 2021-04-21 18:44:39 +01:00
Dimitrie Stefanescu 3940e80eed improvement(server): leaner matomo middlewares for api calls 2021-02-25 17:34:19 +00:00
Dimitrie Stefanescu cd95c28939 refactor(global): restructures repo with lerna 2021-01-03 13:35:53 +02:00