Commit Graph

460 Commits

Author SHA1 Message Date
Chuck Driesler 7bb40134eb fix(workspaces): add filtering to workspace team query (#2586)
* chore(workspaces): add some tests for new filters

* fix(workspaces): args style
2024-08-08 07:15:55 +02:00
Gergő Jedlicska 72017c3f2f feat(emailVerification): add email verification mutation for all emails (#2606) 2024-08-08 07:07:26 +02:00
Kristaps Fabians Geikins 0085bab1db fix(server): fixed various email lookups/updates being case sensitive (#2595)
* fix(server): case insensitivity in userEmails repo

* minor fix

* more test improvements + user repo tests

* more tests

* test fixes
2024-08-07 17:48:01 +03:00
Iain Sproat d9f9da77f4 chore(readiness): server pods are not ready if no free db connections (#2552)
- adds high frequency metrics for knex connections
2024-08-07 11:07:34 +01:00
Kristaps Fabians Geikins 50b5bdbbdd chore(server): typescriptified auth strategies (#2589)
* rebuilt strategies.js

* local.js -> local.ts

* oidc.js -> oidc.ts

* google.js -> google.ts

* github.js -> github.ts

* azure-ad.js -> azureAd.ts

* minor fixes

* FE2 regen

* improved error reference page

* minor adjustment

* more error page improvements

* migrated helper

* testfix
2024-08-07 11:38:44 +03:00
Gergő Jedlicska 625fec4294 feat(workspaces): leave workspace (#2585) 2024-08-06 16:55:40 +02:00
Kristaps Fabians Geikins 455b21cba3 fix(server): manual workspace role assignment on project invite create + more bugfixes (#2581)
* prep for new projectinvite create mutation

* fix for serverRole not being taken into account in stream invite

* new workspace invite create mutation
2024-08-06 13:42:10 +03:00
Alessandro Magionami c365c0566e Alessandro/web 1169 create app validation to enforce only one primary email per (#2576)
* feat(useremails): userEmails graphql query

* feat(useremails): create user email mutation

* feat(useremails): set primary and delete user email mutations

* chore(useremails): fix update user email type

* chore(useremails): add validation for unique primary email

* chore(useremails): create typed tests for graphql and emails field resolver in user type

* chore(userEmails): group user email mutations in a specific mutation object

* linting fixes

* more lint fixes

* tests fix

* more test fixes

* chore(userEmails): cleanup

* chore(useremails): rely on knex trx for transaction handling

* chore(useremails): rely on knex trx for transaction handling

* chore(useremails): fix checkemail not present

* chore(useremails): add tests

* chore(useremails): create check function

* chore(useremails): use repository function to find primary email

* chore(useremails): fix prettier

---------

Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>
2024-08-06 12:34:48 +02:00
Alessandro Magionami 12685af29a Alessandro/web 1388 mutation create new email (#2561)
* feat(useremails): userEmails graphql query

* feat(useremails): create user email mutation

* feat(useremails): set primary and delete user email mutations

* chore(useremails): fix update user email type

* chore(useremails): create typed tests for graphql and emails field resolver in user type

* chore(userEmails): group user email mutations in a specific mutation object

* linting fixes

* more lint fixes

* tests fix

* more test fixes

* chore(userEmails): cleanup

* chore(useremails): rely on knex trx for transaction handling

* chore(useremails): fix checkemail not present

---------

Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>
2024-08-05 18:39:52 +02:00
Kristaps Fabians Geikins 7383779375 feat(server): registration (w/ and w/o invites) tests (#2567)
* WIP tests

* a couple of tests done

* most server registration tests done

* finalized tests

* lint fix

* added login tests too
2024-08-05 16:21:56 +03:00
Chuck Driesler c97ccb48a1 fix(workspaces): support workspace logos as base64 strings (#2556)
* fix(workspaces): support workspace logos as base64 strings

* fix(workspaces): fix those testsss

* fix(workspaces): migration! and more test fixes
2024-08-02 13:04:20 +02:00
Alessandro Magionami 8b43790bed Merge pull request #2519 from specklesystems/alessandro/web-1172-change-the-users-repository-to-abstract-the-email-field-in
Alessandro/web 1172 change the users repository to abstract the email field in
2024-08-01 15:14:34 +02:00
Alessandro Magionami fcedff2565 chore(useremails): add failsafe option to scan table 2024-08-01 14:30:25 +02:00
Iain Sproat b002df6cd4 feat(server/logs): add request ID to objects retrieval log messages (#2550) 2024-08-01 12:21:05 +01:00
Chuck Driesler 8a9659f223 feat(workspaces): workspace member role resolvers (#2540)
* feat(workspaces): update/delete workspace role resolvers

* chore(workspaces): gql tests for role changes

* fix(workspaces): test syntax oops

* fix(workspaces): got it twisted

* fix(workspaces): simplify api surface, better return types

* fix(workspaces): correct role type usage, improve tests

* fix(workspaces): authorize in resolver

* fix(workspaces): correct usage of authorizeResolver
2024-08-01 09:36:52 +01:00
Alessandro Magionami 42b56751d3 chore(useremails): add failsafe to scantable 2024-08-01 09:50:50 +02:00
Chuck Driesler 170a44b9ec chore(workspaces): tests for workspace project creation (#2541)
* chore(workspaces): tests for workspace project creation

* fix(workspaces): build error after type change

* fix(workspaces): assorted hygiene and correctness

* chore(workspaces): add tests for paginated workspace projects query

* fix(workspaces): repair bad test ordering

* fix(workspaces): test hygiene

* fix(workspaces): a bit more correct
2024-07-31 17:40:03 +01:00
Alessandro Magionami 21e56b13ab chore(useremails): remove unsued imports 2024-07-31 11:57:06 +02:00
Alessandro Magionami ebf29014bd Merge branch 'main' of github.com:specklesystems/speckle-server into alessandro/web-1172-change-the-users-repository-to-abstract-the-email-field-in 2024-07-31 10:51:02 +02:00
Alessandro Magionami 9ffe6ddc21 chore(useremails): minor cleanup for users repository 2024-07-31 10:50:55 +02:00
Alessandro Magionami e43ba68001 chore(useremails): add logging in backfill migration 2024-07-31 09:51:30 +02:00
Kristaps Fabians Geikins 2e7f1578b1 fix(server): commit query not returning author id as expected by resolvers (#2549) 2024-07-31 10:28:04 +03:00
Alessandro Magionami 9cde0999a6 Merge branch 'main' of github.com:specklesystems/speckle-server into alessandro/web-1172-change-the-users-repository-to-abstract-the-email-field-in 2024-07-29 16:08:46 +02:00
Kristaps Fabians Geikins ede566eed9 feat(server): serverInvites refactor + workspace invites CRUD & GQL API (#2530)
* prep for new resources algo

* typescriptifying stuff

* minor types fix

* migrate to resources col

* repo & creation updated, WIP processing/retrieval

* WIP invite processing

* finished finalization refactor

* project invite management

* transformed all invites services

* fixed up projects & core serverinvites resolvers

* test fixes

* WIP workspace create GQL & test

* basic invite creation test works

* a buncha working tests

* more tests

* cancelation tests

* minor invite use refactor

* invite retrieval tasks

* invite use() works as expected

* filtering out broken invites

* enabled invite retrieval by token irregardless of who is it for

* minor adjustments

* tests fix

* test config improvements

* test env adjustment

* extra test case

* making resource access limits harder to ignore

* linter fixes

* eventBus type cleanup

* better generic names

* refactored serverinvites resource migration

* fix(server): better error message in project invite edge case
2024-07-29 14:37:54 +03:00
Kristaps Fabians Geikins 1e5dadacd3 feat(server): modularized mocks + workspace mocks for Mike (#2534)
* modularized mocks foundation + updated workspaces gql

* base queries done

* mutations done

* cleaner API for mock helpers

* greatly improved mock definition DX
2024-07-29 11:21:59 +03:00
Alessandro Magionami d10fd393df chore(useremails): fix tests 2024-07-25 17:26:29 +02:00
Alessandro Magionami c7bcf5210f chore(useremails): code review changes 2024-07-25 15:20:41 +02:00
Alessandro Magionami 862e21fb9b Merge branch 'main' of github.com:specklesystems/speckle-server into alessandro/web-1172-change-the-users-repository-to-abstract-the-email-field-in 2024-07-25 15:09:55 +02:00
Alessandro Magionami dc70f2d160 chore(useremails): create scan table helper 2024-07-25 15:09:41 +02:00
Alessandro Magionami a7fe3ca3e4 chore(useremails): use table helper for primary key 2024-07-25 15:09:19 +02:00
Chuck Driesler 6eaf3c8c92 feat(workspaces): cru(d) resolvers (#2521)
* feat(workspaces): drop createdByUserId from the dataschema

* feat(workspaces): repositories WIP

* merge

* protect against removing last admin in workspace

* quick impl and stub tests

* add tests

* services

* unit tests for role services

* feat(workspaces): authorize project creation if workspace specified

* feat(workspaces): emit project created event

* feat(workspaces): assign roles on project create in workspace

* feat(workspaces): update project roles when user added to workspace

* feat(workspaces): stencil gql resolvers

* fix(workspaces): lol lmao

* fix(workspaces): perform automatic project role update in service function

* fix(workspaces): also delete roles

* fix(workspaces): broke tests again oops

* fix(workspaces): update `onProjectCreated` listener to use new repo method

* fix(workspaces): use service function in event listener

* fix(workspaces): get workspace projects via existing stream repo functions

* fix(workspaces): roles mapping in domain, use enum

* feat(workspaces): stencil gql api and resolvers

* fix(workspaces): repair type reference in tests

* fix(workspaces): consolidate files, use different existing stream-getter

* fix(workspaces): more specific error

* fix(workspaces): roles and scopes

* fix(workspaces): yield per page

* fix(workspaces): some test dry

* fix(workspaces): superdry

* fix(workspaces): add scopes

* fix(workspaces): classic

* feat(workspaces): create workspace mutation

* feat(workspaces): I'm sure everything will be fine

* fix(workspaces): yep

* fix(workspaces): successful gql e2e test

* feat(workspaces): update workspace resolver

* chore(workspaces): update resolver test

* feat(workspaces): some retrieval resolvers

* chore(workspaces): tests for query resolvers

* fix(chore): revert temp test command change

* fix(workspaces): test structure and gql types

* fix(workspaces): validate user authz to perform some operations

* fix(workspaces): use existing test infrastructure

* fix(workspaces): stop `isPublic` check if authorizing a workspace resource

* fix(workspaces): better test hygiene

---------

Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
2024-07-25 12:58:28 +01:00
Alessandro Magionami 31661071ba fix(useremails): fix login with primary email 2024-07-24 17:17:37 +02:00
Alessandro Magionami 80484a4328 chore(useremails): fix linter 2024-07-24 16:01:22 +02:00
Alessandro Magionami 618d65867a chore(useremails): create helper for search query 2024-07-24 11:16:19 +02:00
Alessandro Magionami 7c41ee0047 chore(useremails): fix count users and getusers to use user emails table 2024-07-23 15:56:26 +02:00
Alessandro Magionami e208179008 chore(useremails): searchUsers use user emails table 2024-07-22 14:47:59 +02:00
Alessandro Magionami 55af2d526b chore(useremails): getUserByEmail use user emails table 2024-07-22 12:03:36 +02:00
Alessandro Magionami 0a3d6b2f50 chore(useremails): getUser use user emails 2024-07-22 11:58:42 +02:00
Alessandro Magionami 830b82ace7 chore(useremails): getUserById use user emails table 2024-07-22 11:46:36 +02:00
Alessandro Magionami 583ca06953 chore(useremails): findOrCreateUser function use useremails 2024-07-22 11:02:09 +02:00
Alessandro Magionami ce35c49de0 Merge branch 'main' of github.com:specklesystems/speckle-server into alessandro/web-1172-change-the-users-repository-to-abstract-the-email-field-in 2024-07-22 10:37:07 +02:00
Alessandro Magionami a205332d90 chore(useremails): create table helper 2024-07-22 10:35:55 +02:00
Alessandro Magionami 614e5064e8 chore(useremails): use batches for backfill migration 2024-07-22 10:34:32 +02:00
Chuck Driesler 66eb539aa0 feat(workspaces): assign project roles for workspace projects (#2499)
* feat(workspaces): drop createdByUserId from the dataschema

* feat(workspaces): repositories WIP

* merge

* protect against removing last admin in workspace

* quick impl and stub tests

* add tests

* services

* unit tests for role services

* feat(workspaces): authorize project creation if workspace specified

* feat(workspaces): emit project created event

* feat(workspaces): assign roles on project create in workspace

* feat(workspaces): update project roles when user added to workspace

* fix(workspaces): perform automatic project role update in service function

* fix(workspaces): also delete roles

* fix(workspaces): broke tests again oops

* fix(workspaces): update `onProjectCreated` listener to use new repo method

* fix(workspaces): use service function in event listener

* fix(workspaces): get workspace projects via existing stream repo functions

* fix(workspaces): roles mapping in domain, use enum

* fix(workspaces): repair type reference in tests

* fix(workspaces): consolidate files, use different existing stream-getter

* fix(workspaces): more specific error

* fix(workspaces): yield per page

* fix(workspaces): some test dry

* fix(workspaces): superdry

* fix(workspaces): classic

---------

Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
2024-07-20 00:03:27 +01:00
Chuck Driesler 27179ad4f1 feat(workspaces): stencil gql resolvers (#2508)
* feat(workspaces): stencil gql resolvers

* fix(workspaces): lol lmao

* feat(workspaces): stencil gql api and resolvers

* fix(workspaces): roles and scopes

* fix(workspaces): add scopes
2024-07-19 12:44:53 +01:00
Alessandro Magionami bca547df8b chore(useremails): listUsers join user emails table 2024-07-18 17:43:53 +02:00
Alessandro Magionami 447b48a6c2 chore(server): remove relative imports 2024-07-18 16:07:16 +02:00
Alessandro Magionami deb9af299f chore(core): fix relative imports 2024-07-18 15:13:42 +02:00
Alessandro Magionami 4d84bb59c3 fix(useremails): email verification when creating user should be settable 2024-07-18 15:13:05 +02:00
Alessandro Magionami f608d49591 feat(useremails): join user emails in getUsers repo function 2024-07-18 15:12:23 +02:00