Commit Graph

290 Commits

Author SHA1 Message Date
Gergő Jedlicska 2fdcf1bd1d refactor(shared): unified queue handling (#4691)
* feat(shared): unified queue initialization in shared

* feat(queues): use the new queue creation everywhere

* chore(shared): move to redis module

* chore(shared): fix export maps

* chore(fileimport): add deps properly

* fix(shared): import fix

* fix(everything): moear imports

* fix(server): cjs imports
2025-05-08 16:58:43 +02:00
Iain Sproat 15d67ba589 Merge pull request #4121 from specklesystems/iain/refactor-blob-storage
refactor(server/file upload): avoid extra http call
2025-05-07 15:11:15 +01:00
Kristaps Fabians Geikins cf833a7719 fix(server): project role updates after workspace role/seat changes (#4599)
* fix(workspaces): workspace role sync

* role changes fixed + validated

* seat changes validated

* fix tests

---------

Co-authored-by: Charles Driesler <chuck@speckle.systems>
2025-04-29 10:49:37 +03:00
Iain Sproat 62c8b571f9 Merge branch 'main' into iain/refactor-blob-storage 2025-04-28 15:06:30 +01:00
Iain Sproat baec1e9156 tests(integration/blobs): can anonymously get blob from public project (#4614)
* tests(integration/blobs): can anonymously get blob from public project

* fix public access

* more fixes

---------

Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>
2025-04-28 12:26:50 +03:00
Iain Sproat 4529b6b37b Merge branch 'main' into iain/refactor-blob-storage 2025-04-26 08:19:21 +01:00
Kristaps Fabians Geikins e18f1a6eb5 fix(server): blob read should not require write scope (#4610) 2025-04-25 18:47:36 +03:00
Kristaps Fabians Geikins eef0a37042 fix: blob upload should use auth policies (#4594)
* fix: blob upload should use auth policies

* tests fix
2025-04-25 09:13:22 +03:00
Kristaps Fabians Geikins f1ae0916c6 feat(server): improved user/server profile mp tracking (#4540)
* user tracking

* server profile tracking

* style
2025-04-23 15:19:24 +03:00
Kristaps Fabians Geikins d96726318f fix(server): cache logger not respecting level 2025-04-23 14:41:01 +03:00
Kristaps Fabians Geikins d579239dab fix(server): reduced cache layer logging noise (#4530) 2025-04-22 16:47:27 +03:00
Iain Sproat 2adf7a97ae Merge pull request #4499 from specklesystems/iain/likes-time_ms
chore(readable code): use TIME_MS for readable durations
2025-04-22 09:48:19 +01:00
Iain Sproat 1b72d0f6e3 Merge pull request #4383 from specklesystems/iain/web-2928-bull-queue-fails-silently-if-it-cannot-connect-to-a-redis
fix(preview service): check bull queue is ready before processing
2025-04-22 09:42:40 +01:00
Kristaps Fabians Geikins e70097cf3e chore(server): fixed/improved commandFactory (#4470)
* chore(server): fixed/improved commandFactory

* further improved API
2025-04-22 09:10:44 +03:00
Iain Sproat 920099c39f chore(readable code): use TIME_MS for readable durations
- we recently added TIME_MS helper; this applies it to existing durations
2025-04-18 17:51:43 +01:00
Kristaps Fabians Geikins 0cc19dbdf5 fix(fe2): not being able to remove member from workspace (#4468)
* fix(fe2): not being able to remove member from workspace

* minor comment

* withTransaction refactor
2025-04-17 10:44:55 +03:00
Iain Sproat 43c51c34d7 Merge branch 'main' into iain/web-2928-bull-queue-fails-silently-if-it-cannot-connect-to-a-redis 2025-04-16 15:23:47 +01:00
Kristaps Fabians Geikins 10832655d4 fix(server): all project created subs firing for workspace guests + req ctx cache fix for subs (#4453)
* WIP sub fix

* fix sub resolver caching issue
2025-04-16 11:21:17 +03:00
Iain Sproat b77899626e Merge branch 'main' into iain/web-2928-bull-queue-fails-silently-if-it-cannot-connect-to-a-redis 2025-04-15 07:45:10 +01:00
Kristaps Fabians Geikins b287702145 feat: version checks + generally improved auth error messaging (#4384)
* foundation for new version checks

* canUpdate policy

* can req render

* canReceive

* BE implemented

* FE checks implemented?

* test fix

* improved auth error messaging

* fix lint
2025-04-14 10:43:48 +01:00
Iain Sproat 2071a36e5d fix(previews): disable previews is previews Redis is not reachable
- exit preview-service process if Redis is not reachable
- improve server healthcheck to include Redis client readiness check
2025-04-11 13:25:19 +01:00
Kristaps Fabians Geikins f59c0a72c6 feat: model related auth checks in BE & FE (#4374)
* limit fragment cleanup

* be updated

* model checks in FE

* tests fix

* fakes util fix
2025-04-11 10:09:54 +03:00
Kristaps Fabians Geikins b6c21fd506 feat: comment read/write auth policies in BE & FE (#4368)
* webhooks perm minor fix

* tryna get fileimport service to work

* new comment policies - shared

* BE done?

* checks implemented in FE

* lint fix

* tests fix

* readme fix
2025-04-10 15:14:34 +03:00
Kristaps Fabians Geikins 5f88f562d3 feat: updated various "read/update" settings related permission checks (#4356)
* a bunch more tests

* updated GQL resolvers

* project create checks implemented

* project update/settings related checks in FE

* a bunch of tests

* tests fix

* disable app schema check
2025-04-09 16:13:09 +03:00
Chuck Driesler cb7243cfbe feat(authz): Project.canCreateModel and Project.canMoveToWorkspace policies (#4342)
* feat(authz): Project.canCreateModel policy

* feat(authz): Project.canMoveToWorkspace policy

* fix(authz): expose policies as permissions objects

* chore(authz): actually use the policies lol

* chore(authz): add tests for new policies

* fix(authz): skip affected test

* fix(authz): pr comments

* fix(authz): better errors, better tests

* chore(authz): remove references to deleted error
2025-04-08 15:29:12 +01:00
Alessandro Magionami 8d554e726d feat(core): add workspace limits 2025-04-07 16:55:45 +02:00
Kristaps Fabians Geikins 820a1e2ebf feat(server): workspace roles taken into account in project queries (#4319)
* Workspace.projects fixed

* Query.project tested & fixed

* personalOnly flag added

* withProjectRoleOnly flag

* authorizeResolver implicit workspace roles

* minor cleanup

* reorg + support for throwing auth errors

* global error mapping

* undo special borkage

* CR fixes

* more CR fixes

* shared tests fix

* minor adjustment

* tests fix

* see if removing cached roles fixes it?

* more fixes

* clean up debugging garbage
2025-04-07 12:52:07 +03:00
Kristaps Fabians Geikins e3d3c1446b feat: enable domain discoverability on workspace creation (#4235)
* frontend changes implemented

* WIP BE

* backend seems to work

* CR fixes
2025-04-07 12:34:45 +03:00
Chuck Driesler 855185245e feat(workspaces): consolidate workspace role/seat reporting (#4315)
* feat(workspaces: shuffle seat type counts around

* fix(workspaces): use new counts

* fix(workspaces): better field placement

* Updated FE

* chore(workspaces): fix tests

* fix(workspaces): use correct flags

* fix(workspaces): correct another test

* fix(workspaces): use correct model count function

---------

Co-authored-by: Mike Tasset <mike.tasset@gmail.com>
2025-04-04 10:27:49 +01:00
Gergő Jedlicska f501cc4ad5 gergo/web 2888 workspace project cancreate (#4294)
* WIP can create project

* WIP can create project more work

* complete body, stencil tests

* feat(shared): move workspace plan types into shared

* test progress wip

* feat(shared): add more logic to canCreateWorkspaceProject

* a few more tests, as a treat

* chore(authz): round out tests

* fixed loaders, new GQL checks, dataLoaders in auth loaders

* fix(authz): get workspace limits loader

* chore(authz): update loaders

* frontend fixed up to snuff

* fix(authz): fix workspace plans for tests

* fix(authz): classic

* fix(authz): 0 counts

---------

Co-authored-by: Chuck Driesler <chuck@speckle.systems>
Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>
2025-04-01 16:38:20 +01:00
Iain Sproat 57d63a31c5 Merge pull request #4287 from specklesystems/iain/fileimport-update-expired-file-uploads
fix(file import): garbage collect failed file imports if taking too long
2025-03-31 14:47:11 +01:00
Kristaps Fabians Geikins 8d1c45e6f8 feat(server): wrapWithCache improved caching w/ shared promises (#4286)
* feat(server): wrapWithCache improved caching w/ shared promises

* minor adjustment
2025-03-31 11:31:16 +03:00
Iain Sproat d8ec2f12c4 feat(file import): expire failed file imports if taking too long 2025-03-28 15:05:44 +00:00
Kristaps Fabians Geikins a6a4ceee86 feat: true-myth result structures & other auth policy improvements (#4262)
* fixing up typing

* better dynamic loader mechanism

* buildReqLoaders cleanup

* added caching to loaders

* ensuring all loaders are async

* fe2 plugins error handling fix

* feat(shared): true-myth result structures & other auth policy improvements

* moving workspaceCore loaders to correct place
2025-03-25 17:49:02 +01:00
Kristaps Fabians Geikins 6d8b1007f0 fix: workspace projects infinite loading bug (#4252)
* fix(server): user streams query pagination

* fix(fe2): fe infinitely asking for broken pagination
2025-03-24 15:46:59 +02:00
Gergő Jedlicska 968d2f2520 auth/lib (#4242)
* wip

* wip

* feat(authz): wip policy shape

* wip

* fix(authz): canReadProject with latest pattern

* wip

* feat(shared): simplify authz checks and policies

* feat(shared): port role weights into shared

* test(shared): some more tests for authz

* test(shared): more query project tests

* typo!

* feat(shared): ff loading refinements

* feat(shared): example authorization policy integration

* authz loaders init

* chore(authz): naming etc

* wip

* fix(authz): authz error objects

Co-authored-by: Kristaps Fabians Geikins <fabis94@users.noreply.github.com>
Co-authored-by: Gergő Jedlicska <gjedlicska@users.noreply.github.com>

* fix(authz): use correct role weights

* chore(authz): use codes from errors in tests

* chore(authz): wow

* chore(authz): fix more tests, add more tests

* chore(authz): fix some tests, add some tests (again)

* fix(authz): fix tests again

* fix(server): you need to await !!!! otherwise it crashes the server.

---------

Co-authored-by: Charles Driesler <chuck@speckle.systems>
Co-authored-by: Kristaps Fabians Geikins <fabis94@users.noreply.github.com>
Co-authored-by: Gergő Jedlicska <gjedlicska@users.noreply.github.com>
2025-03-21 16:37:36 +01:00
Chuck Driesler 66da283a79 Revert "feat(authz): shared authz pipeline (#4151)" (#4241)
This reverts commit cb8aa31b66.
2025-03-21 15:41:17 +01:00
Chuck Driesler cb8aa31b66 feat(authz): shared authz pipeline (#4151)
* wip

* wip

* feat(authz): wip policy shape

* wip

* fix(authz): canReadProject with latest pattern

* wip

* feat(shared): simplify authz checks and policies

* feat(shared): port role weights into shared

* test(shared): some more tests for authz

* test(shared): more query project tests

* typo!

* feat(shared): ff loading refinements

* feat(shared): example authorization policy integration

* authz loaders init

* chore(authz): naming etc

* wip

* fix(authz): authz error objects

Co-authored-by: Kristaps Fabians Geikins <fabis94@users.noreply.github.com>
Co-authored-by: Gergő Jedlicska <gjedlicska@users.noreply.github.com>

* fix(authz): use correct role weights

* chore(authz): use codes from errors in tests

* chore(authz): wow

* chore(authz): fix more tests, add more tests

* chore(authz): fix some tests, add some tests (again)

* fix(authz): fix tests again

---------

Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
Co-authored-by: Kristaps Fabians Geikins <fabis94@users.noreply.github.com>
Co-authored-by: Gergő Jedlicska <gjedlicska@users.noreply.github.com>
2025-03-21 14:45:36 +01:00
Iain Sproat 2dc32094d0 feat(helm chart): can be configured to deploy preview service in cluster 2025-03-15 11:31:40 +00:00
Iain Sproat 6e170d0c4f fix(docker compose): preview service can be used with docker compose 2025-03-15 10:43:40 +00:00
Kristaps Fabians Geikins b3bcf67dad fix(server): workspace seats & roles query invalid null handling (#4199) 2025-03-14 18:00:12 +02:00
Kristaps Fabians Geikins d903e8ffc4 feat(server): support editor -> viewer seat downgrades (#4181)
* new seat based project role checks implemented

* everything done

* minor bugfix
2025-03-14 14:21:25 +02:00
Kristaps Fabians Geikins 28b49107b7 feat(server): upgrade workspace seat type (#4158)
* feat(server): upgrade workspace seat type

* test/lint fixes
2025-03-11 12:41:18 +02:00
Iain Sproat 57b2fa5a3b Merge branch 'main' into iain/refactor-blob-storage 2025-03-11 09:46:34 +00:00
Iain Sproat cfef333a0c feat(preview service): introduce /metrics endpoint for Prometheus (#4127) 2025-03-10 10:48:29 +00:00
Iain Sproat 8ebb7abdd6 Merge branch 'main' into iain/refactor-blob-storage 2025-03-06 21:16:30 +00:00
Gergő Jedlicska 61609de97e gergo/previews (#3765)
* feat(preview-generator): add new preview generator webapp

* wip(preview-service): reworking the preview service backend

* feat(previews): logging

* feat(preview-service): streamline payloads

* fix(preview-service): do not log the full payload

* feat(preview-service): build new preview service

* feat(preview-service): add separate response queue

* feat(previews): integrate preview queues with the server

* feat(previews): use module alias

* chore(previews): remove old preview service code

* feat(previews): log stuff on job statuses

* fix(previews): add missing deps and scripts

* fix(previews): package deps fix

* fix(server): moar typing fixes

* Metrics related to jobs: total count, request failures, response errors & durations

* duration should include unit.
- histogram metric should be summary
- error responses include duration in seconds
- attempt to remove metric before adding it (prevent errors with duplicate metrics)

* fix(server, frontend): some ts fixes

* fixes

* fix(frontend): remove unneeded ts-expect-error

* chore(preview-service): eslint

* TS fix

* feat(previews): more smoal fixes

* fix(preview-service): alias loading

* feat(helm): updates for new preview service queue setup

* feat(preview-service): launch new browser for each job

* feat(preview-service): add timeout, fix liveliness

* fix(helm): add access to new secret in service accounts

* tidy metrics into a separate file

* Remove broken preview service acceptance test

* fix broken import

* Add metrics to test

* feat(preview-service): handle preview service shutdown properly

* fix(previews): merge bork

---------

Co-authored-by: Iain Sproat <68657+iainsproat@users.noreply.github.com>
Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>
2025-03-06 14:26:56 +01:00
Iain Sproat 6499a11d02 Merge branch 'main' into iain/refactor-blob-storage 2025-03-06 09:12:20 +00:00
Iain Sproat 5655b3e758 fix(metrics): pass registry in to modules (#4113)
- ensure metrics are added to the correct registry
2025-03-06 08:37:05 +00:00
Iain Sproat a0e70f2509 Merge branch 'main' into iain/refactor-blob-storage 2025-03-05 17:06:57 +00:00