Commit Graph

61 Commits

Author SHA1 Message Date
Kristaps Fabians Geikins ee5ae8af62 fix(fe2): accept invite before onboarding after sign up (#2491)
* explicitly ordering global middlewares

* various subscription fixes & WIP project invite middleware

* SSR invite accept & toast notifs seem to work

* backend support for mixpanel

* mixpanel be logic -> shared

* minor fix

* finissh

* lint fix

* minor comment adjustments

* better adblock handling
2024-07-11 11:45:11 +03:00
Kristaps Fabians Geikins 6bfffca0a9 fix: various invite flow fixes & improvements (#2451)
* fix(fe2): show signup CTA for non-registered invitees [web-1144]

* fix: server invite signup error

* WIP project error access block

* feat(fe2): better 'no project access' error screens

* CR fix
2024-06-28 17:26:11 +02:00
Gergő Jedlicska 7c16abc8eb feat(workspace): 1119 define workspaces dataschema (#2431)
* feat(workspaces): add workspaces module with roles and scopes

* feat(workspaces): add domain, graphql and persistent storage dataschema

* fix(workspaces): correct db injections

* chore(workspaces): add EE license

* chore(license): mentions workspaces separately in license file

* fix(core): roles import in migration

* fix(workspaces): drop workspace_acl on down migration

* fix(workspaces): roles constants

* fix(workspaces): coding standards

---------

Co-authored-by: Dimitrie Stefanescu <didimitrie@gmail.com>
2024-06-26 17:00:56 +02:00
Gergő Jedlicska c6cd4c311d feat(serverinvites): create domain module in server invites (#2401)
* chore(serverinvites): repository refactor for multiregion

* chore(serverinvites): remove migrated functions from old repository

* chore(serverinvites): refactor serverInviteForToken resolver for multiregion

* chore(serverinvites): invite processing service refactor for multiregion

* chore(serverinvites): subscription refactor for multiregion

* chore(serverinvites): move buildEmailContents to dedicated file

* chore(serverinvites): deleteAllStreamInvites function multiregion refactor

* chore(serverinvites): refactor deleteServerOnlyInvites multiregion repository

* chore(serverinvites): complete repository refactor for multiregion

* feat(serverinvites): create domain module in server invites

* fix(serverinvites): no relative imports

* feat(serverinvites): extract individual types from repository

* feat(serverinvites): move interfaces to operations

* fix(serverinvites): update imports referencing old interfaces file

* fix(serverinvites): type mismatch for insert invite and delete old

* chore(serverinvites): refactor to single repo function

* test(serverinvites): fix tests

* fix(serverinvites): use domain types in all places

* feat(serverinvites): WIP unity

* feat(serverinvites): move to new facory names and types

* feat(serverinvites): fix tests

* fix(serverinvites): use factory name

---------

Co-authored-by: Alessandro Magionami <alessandro.magionami@gmail.com>
2024-06-25 13:24:37 +02:00
Kristaps Fabians Geikins bd9faa2415 fix(server): more legible auth errors (#2361) 2024-06-13 10:34:01 +03:00
Kristaps Fabians Geikins f9f490b440 fix(server): allow standard users to batch invite to server (#2150)
* fix(server): allow standard users to batch invite to server

* added max 10 invite batch limit

* minor change
2024-03-20 17:51:24 +02:00
Benjamin Ottensten 663a5b4ddc Use FE2 language in emails (#2115)
* Update copy in the Invite email

* Update copy in the comment email

* Update copy in project access emails
2024-03-13 10:46:35 +01:00
Kristaps Fabians Geikins 9caa2a37c8 feat(fe): auto accept stream/project invite on email link click [WBX-73] (#2017)
* feat(fe2): project invite auto accept

* fix(fe2): improved CSR error logging

* feat(fe1): auto accept stream invite on email link click

* minor type fix

* tests fix
2024-02-07 14:26:59 +02:00
Kristaps Fabians Geikins 37d51072fb feat(server): resource limits on app tokens (#1959)
* WIP new mutation arg

* limited resource token creation done

* token resource rule creation validation

* updated authorizeResolver implementation

* introduced resource access rule checks in authorizeResolver everywhere

* more checks added

* updated projects resolvers

* updated stream resolvers

* more checks added

* error page theme resolution fix

* WIP testss

* more tests

* implemented checks in REST auth pipeline

* REST API coverage & tests

* some tests fixed

* test fixess

* added tests

* feat(server): new automation result reporting scope (#1976)

* feat(server): new automation result reporting scope

* tests fix
2024-01-19 18:14:49 +01:00
Kristaps Fabians Geikins c5ff7688ac feat: click on invite link autofills email in register form (#1919) 2023-12-15 11:51:43 +02:00
andrewwallacespeckle 44bfa6d2c8 Fe2 server management bugfixes (#1787)
* fix(server): inviteList pagination

* Fixes from call with fabians

* more BE bufxies

* reducing server invite precision

* Infinite Scroll fixes. Slight design change to "update available"

* fixed tests

---------

Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>
2023-09-08 12:55:03 +01:00
Kristaps Fabians Geikins 069f64afc9 feat(fe1 & fe2): guest role (#1768)
* feat: user guest role switching in FE1

* removed stream create buttons

* fe1 done

* fe1 - specifying role in invite dialogs

* fe1 - bulk invites

* WIP FE2 changes

* fe1: allow role select condition fixes

* xtra limitations on createForOnboarding

* more invite creation validations

* no longer able to set guest as project owner in invite

* preparations for server role select in invite dialog

* team management dialog done

* server invite dialog updated

* hiding invite dialog

* fixed mocks
2023-08-24 09:30:09 +02:00
Gergő Jedlicska 4b071872c2 gergo/adminInviteList (#1761)
* feat(admin): add users email to the admin user list query

* feat(admin): WIP invite list

* feat(admin): fix server invites resolver typing

* fix(admin): slim down admin user list item data
2023-08-11 15:02:02 +03:00
Kristaps Fabians Geikins ba7ef04ca3 fix(server): invites fixes + proper project()/stream() query error reporting (#1580)
* fix(server): invalid stream invite purge + better error handling

* fix(server): proper project/stream query error reporting

* undo env example change

* fix(server): fixed tests

* fix(fe-2): chromatic adjustments

* fix(fe-2): non-randomized stories
2023-05-17 17:17:09 +02:00
Kristaps Fabians Geikins b02a07e2b6 feat: Frontend 2.0 MVP 2023-05-08 10:47:01 +03:00
Gergő Jedlicska c4454c2ede refactor(server email templates): use the mjml ejs rendering for all emails (#1448)
* refactor(server email templates): use the mjml ejs rendering for all emails

* fix(server access request): await the server info pls
2023-03-13 15:07:13 +01: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 a537d34dcc Rate limit all endpoints (#1213)
* Demonstration of bug to test when middleware added
- Adding middleware, even no-op, causes test to fail

* Make middleware async, but introduce delay.
Revert test back to original.

* Revert tests

* Add a 1ms sleep to the test to reduce likelihood of flakiness

* Rate limiting on all express endpoints using middleware

* Adds all configuration for existing rate limited endpoints

* It is helpful to add the package to yarn first

* Implements respectsLimits using Redis rate limiter

* Fix for test `Should rate-limit user creation`
- if rate limit error, post to `/auth/local/register` will return a 429 status code

* All rate limiting provided by new ratelimiter.ts

* Consolidate typescript interfaces

* Amend signature of function to require source to be passed in, and not try to guess it from the request

* Rename respectsLimits to isWithinRateLimits

* Throw within catch of Promise

* Replace rejectsRequestWithRatelimitStatusIfNeeded throughout code

* Sending rate limit response should deal with other types of error
- Sentry notified of the error

* Express middleware rate limits by a 3 second burst or a daily rate
- Provide action when generating 429 response

* Prevent DOS of Redis

* Add 'Retry-After' for all cases when responding with 429 status code
- default of 1 day, but dynamic based on available information

* Generate rate limiters once, on init
- Improved and consistent handling of exit from functions
- fixed environment variable names

* WIP Refactor rate limiting setup

Co-authored-by: Iain Sproat <iainsproat@users.noreply.github.com>

* WIP: fixed references, now runs but tests fail

* Use getSourceFromRequest where possible

* WIP: unit tests for rate limiter

* Unit tests for ratelimiter

* feat(IFC): WIP IFC parser improvements

* Revert "feat(IFC): WIP IFC parser improvements"

This reverts commit 093089a2c4.

* refactor authz, rate limiting middleware to global

Co-authored-by: Kristaps Fabians Geikins <fabis94@users.noreply.github.com>
Co-authored-by: Iain Sproat <iainsproat@users.noreply.github.com>

* invites tests fix

* fix(server ratelimiter): export public interfaces

* Unit test for rate limiter use in memory rate limiter
- in memory rate limiter is configured with zero limit by default

* Fixed #1219 (#1221)

* WIP: improve auth test for rate limiting user creation

* ci(circleci config): publishing was broken when main branch was tagged (i.e. for releases) (#1224)

* Gitignore CPU profiles

* All tests are  now passing locally

* Fixed an issue in the frontend which was causing the views not to work. Fixed an issue with object selection camera animation where the dolly lerp factor was much too high for smooth animation (#1225)

* 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

* Revert "feat(structured logging): implements structured logging for backend (#1217)" (#1227)

This reverts commit 84cb74e8b3.

* Move error to core/errors
- augmented typescript types moved to type-augmentations

* Added a missing wait in the screenshot generation loop (#1228)

* refactor(server rest api): remove duplicate rate limit requests

* feat(server rate limits): increase rate limits for the upload endpoints

* chore(server rate limits): final cleanup

Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
Co-authored-by: Iain Sproat <iainsproat@users.noreply.github.com>
Co-authored-by: Dimitrie Stefanescu <didimitrie@gmail.com>
Co-authored-by: Kristaps Fabians Geikins <fabis94@users.noreply.github.com>
Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>
Co-authored-by: Alexandru Popovici <alexandrupopoviciioan@gmail.com>
2022-11-29 17:06:11 +01: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 db6a3e9367 refactor(server): apollo server v2 -> v3 migration (#1071) 2022-10-06 11:12:16 +03:00
Kristaps Fabians Geikins f991504932 feat: stream access requests (#976) 2022-09-06 11:10:38 +03:00
Kristaps Fabians Geikins ecb9f825bb refactor: email verification flow & email template (#967) 2022-08-31 17:11:19 +03:00
Kristaps Fabians Geikins 651dee0977 feat(server): stream discoverability flag & queries (#948) 2022-08-24 13:46:24 +03:00
Kristaps Fabians Geikins af45fc2742 feat(server): notify on comment mention + notifications API (#933) 2022-08-19 10:27:48 +03:00
Kristaps Fabians Geikins 0427f5cfd1 feat(server): new base email template + implementation for invites emails (#903)
Co-authored-by: Dimitrie Stefanescu <didimitrie@gmail.com>
2022-08-11 11:00:01 +03:00
Kristaps Fabians Geikins b966f20fdb refactor(server): typescript support (#874)
Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
2022-08-04 14:21:39 +02:00
Kristaps Fabians Geikins 3ff772e342 fix: various server invites related improvements & fixes (#837)
* moving to invite token field, fixing comments & activity bugs I found, adding role prop to stream invite creation
* more fixes
* more tests
2022-07-25 11:02:22 +03:00
Kristaps Fabians Geikins da9224a069 feat: server & stream invites rework
feat: server & stream invites rework

Co-authored-by: Dimitrie Stefanescu <didimitrie@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-07-19 13:01:19 +03:00
Gergő Jedlicska d2166c3f38 Merge branch 'main' of github.com:specklesystems/speckle-server into defaultAppScopeHandling 2022-05-11 11:43:13 +02:00
Gergő Jedlicska 0ac118e05c (refactor) server for less app-root-path 2022-05-03 13:10:00 +02:00
Gergő Jedlicska 2d03d8a632 refactor(scopes constants): add users:invite to Scopes constant 2022-04-25 11:53:32 +02:00
luz paz 915cb0afaf Fix various typos
Found via `codespell -q 3 -S CHANGELOG.md -L doesnt,optio,promisses,tread,usera`
2022-04-15 13:49:46 -04:00
Gergő Jedlicska 89d0d9e0ed style: fix eslint warnings 2022-04-04 22:32:34 +02:00
Fabians 1c7436e7ff extra prefer-const & object-shorthand 2022-04-04 19:00:24 +03:00
Gergő Jedlicska 1355ddab6f style(all): some extra formatting fixes 2022-04-01 09:40:47 +02:00
Gergő Jedlicska 7906307a8f fix(server tests): fixed all non awaited rejected promisses 2022-03-31 15:21:13 +02:00
Gergő Jedlicska d53df11f77 style(server): fix all eslint errors and break the tests 2022-03-31 14:18:44 +02: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
Gergő Jedlicska 68a4a95d90 refactor(server): rework test hooks
drop db migration before and after hooks, add helpers and root hooks

fix #531
2022-02-05 15:05:17 +01:00
Gergő Jedlicska 8050c30d6d test((server) archival tests): add archived user scope tests
also i'm trying to fix flaky tests
2021-11-04 13:33:22 +01:00
Gergő Jedlicska abdb0174b6 feat((server) lower case email matching): user and invites ignore email casing
user email and invite email comparison is now done on a lower case basis

fix #409
2021-10-08 17:14:00 +02:00
Dimitrie Stefanescu 23b40b2ee4 fix(server): invite message promise fix 2021-06-11 10:10:19 +01:00
Dimitrie Stefanescu 1768b7d4e5 fix(server): sanitises invite messages & adds tests 2021-06-08 18:42:42 +01:00
Dimitrie Stefanescu 41fad72a11 fix(server): invites: fixes wrong flow on gh and google strategies 2021-05-03 10:54:25 +01:00
Matteo Cominetti 4241af0b21 fix(server): checks if invite is valid and returns proper error when not, partly fixes #163 2021-04-07 16:57:30 +01:00
Dimitrie Stefanescu e19046e26c fix(server): fixes invite link in emails
`invite=xxx` -> `inviteId=xxx`
2021-04-06 19:09:11 +01:00