Commit Graph

47 Commits

Author SHA1 Message Date
Rory Powell 699c21a042
Account portal no passwords sso (#9861)
* Structures and types updates for account-portal-no-passwords-sso

* lint
2023-03-02 14:38:15 +00:00
mike12345567 20a8ec8600 Attempting to fix issues where wrong port is picked for test containers, occurred a lot locally. 2023-02-27 21:19:07 +00:00
mike12345567 706b78b243 Merge branch 'develop' of github.com:Budibase/budibase into feature/audit-logs 2023-02-27 14:51:33 +00:00
Rory Powell a6027be943
Enforceable SSO (#9787)
* Add ENFORCEABLE_SSO feature flag

* First draft of enforce sso configuration / show single sign on url

* Reading and writing isSSOEnforced + integration with login page

* Enable CI + lint

* Set correct base branch for CI

* Test fix for expected string changed

* Use tenant aware platform url as SSO link

* Bring in latest pro changes

* Lint

* Add useEnforceableSSO mock helper function

* Update configs.spec.ts with coverage for public settings

* Update users.spec.ts with additional tests for isPreventPasswordActions

* Lint

* Update refresh OAuthToken to use correct enum and add case statement
2023-02-27 13:42:51 +00:00
mike12345567 1be17ee3bb Fixing circular dependencies which were blocking tests. 2023-02-24 17:31:58 +00:00
mike12345567 a3fd0d84d5 Implementing a few basic tests to create and search the audit logs. 2023-02-23 17:23:06 +00:00
Rory Powell 6da72bb2c6 Configs updates: remove circular deps, dedicated module, typing improvements, reduce db reads 2023-02-23 13:41:35 +00:00
Rory Powell f153fb8e82
Run CI steps in parallel (#9760)
* Parallel CI

* Add build to integration test

* Add checkout to top of each run

* Revert branch update for ci job

* Experiment with --runInBand for CI

* Fix intermittent backend-core migration test failure

* Fix hanging worker redis connection

* Update naming from reset to newTenant
2023-02-21 17:13:24 +00:00
Rory Powell 1b041c41c3
Prevent SSO users from setting / resetting a password (#9672)
* Prevent SSO users from setting / resetting a password

* Add support for ENABLE_SSO_MAINTENANCE_MODE

* Add typing to self api and build out user update sdk

* Integrate sso checks with user sdk. Integrate user sdk with self api

* Test fixes

* Move self update into SDK

* Lock down maintenance mode to admin user

* Fix typo

* Add health status response and return type signature to accounts.getStatus

* Remove some unnecessary comments

* Make sso save user function non optional

* Remove redundant check on sso auth details provider

* Update syncProfilePicture function name to getProfilePictureUrl

* Update packages/worker/src/sdk/users/events.ts

Co-authored-by: Adria Navarro <adria@revityapp.com>

* Add ENABLE_EMAIL_TEST_MODE flag

* Fix for logging in as sso user when existing user has password already

* Hide password update and force reset from ui for sso users

* Always disable sso maintenance mode in cloud

---------

Co-authored-by: Adria Navarro <adria@revityapp.com>
2023-02-21 08:23:53 +00:00
Rory Powell 91e63c8ec4 Rename LOG_4XX to ENABLE_4XX_HTTP_LOGGING and enable by default 2023-02-13 14:39:24 +00:00
Rory Powell c78b21ef5f
Merge pull request #9669 from Budibase/budi-6558-configurable-test-log-levels-and-common
Configurable test log levels and common error handling
2023-02-13 14:31:43 +00:00
Rory Powell d68880665c
Merge pull request #9670 from Budibase/budi-6559-enable-higher-concurrency-and-resiliency
Enable higher concurrency and resiliency in worker tests
2023-02-13 14:31:14 +00:00
Rory Powell 3f0f5b7346 Enable use of redis container in worker tests 2023-02-13 12:09:16 +00:00
Rory Powell 1dc3d44a44 Enable higher concurrency and resiliency in worker tests 2023-02-13 11:57:30 +00:00
Rory Powell d99794c040 Configurable test log levels and common error handling 2023-02-13 11:53:01 +00:00
Mateus Badan de Pieri ee73069a51 Merge branch 'develop' into tests/environment-variables 2023-02-07 16:15:57 +00:00
Adria Navarro 9a8ae45c54 Spin up postgres only on the postgres test 2023-02-06 19:43:08 +00:00
adrinr 2327e24bce Add pg test container 2023-02-06 13:07:21 +00:00
adrinr 06ffca74cd Cleanup 2023-02-03 19:23:36 +00:00
adrinr c747cabe73 Rename name for id 2023-02-03 12:09:56 +00:00
adrinr 6d3117d6ac Dry 2023-02-03 11:28:27 +00:00
adrinr 0fe6bb6b3a Fix possible nulls 2023-02-01 15:02:31 +00:00
mike12345567 0d6db18a63 Environment variable test base. 2023-01-31 15:27:16 +00:00
adrinr 75b306ac17 Looking for testcontainer config 2023-01-31 11:23:26 +00:00
adrinr 49a344dfba Log as error 2023-01-31 10:30:57 +00:00
adrinr 19cdeb2631 Add more logs 2023-01-31 10:21:19 +00:00
adrinr 18a0675545 Fix jest.setup 2023-01-30 18:18:23 +00:00
adrinr d6da46a079 Use test-containers for backend-core tests 2023-01-27 11:43:36 +00:00
Rory Powell 13bfd5d8ff
Prefer app url resolution over referer (#9218)
* Prefer app url resolution over referer

* Update lockfiles
2023-01-11 10:24:57 +00:00
Rory Powell 0b2a445a9a
Replace ts-jest with swc/jest (#9289)
- Add swc dependencies
- Add transform change to jest.config.ts
- Replace `export =` with `export default` in src code to enable code coverage to work with swc transformer
- Restructure backend-core errors package to allow for exporting error classes with ESM syntax
- Update backend-core to no longer use `export =`, export individual packages instead of replacing with `export default` for backwards compatibility
- Update event publishers to use `export default` - this was required for the `jest.spyOn` usage inside backend-core common mocks
- Restructure some jest.mock usages where declaring the jest.fn as a variable outside of the package mock threw an error
2023-01-11 09:37:37 +00:00
Rory Powell 7ef9e9dc51
File authentication using presigned URLs (#8883)
* file auth wip

* Private plugin bucket wip

* Add etag to logo request, fix circular dependency

* Resolve cyclic dependency

* Ensure browser doesn't cache custom component

* Global file fixes

* File fixes / remove permaUrl

* Add ctx local storage

* Enable presigned url to work from any host

* Test fix

* Self hosting w/ S3 + other fixes

* Fix for serving dev app in multi tenant

* Fix backup restore and import attachment url processing, never store attachment urls

* Test fixes

* Unit tests WIP

* Replace file path with base64 encoded private key

* Multi tenancy tests for files

* Environment files fixes

* Post-merge build and test fixes

* Add debug conditional to all jest logging and revert/fix prod minio proxy_pass

* Re-add default '/' minio route :(

* Rename iconFile -> iconFileName

* Add cloudfront vars to k8s templates

* Remove public bucket policy

* Remove duplicated test
2022-12-15 11:35:22 +00:00
Rory Powell 56dfba9b4a
Offline license POC (#9046) 2022-12-14 21:48:48 +00:00
Peter Clement 9bf37b34ae
Server and Worker tests (#8928)
* automation unit tests

* row processor tests

* update executeQuery test

* update groups assertion

* some more worker tests

* plugin tests and tidying up

* linting

* temporarily disable group tests

* more tests

* fix import

* fix backup tests

* add pro mocks to worker

* check for app existence in import test

* test new tsconfig

* testing changes

* Pro test utils (#9020)

* Pro test utils changes

* Add test fixes

* Remove ts-ignore

Co-authored-by: mike12345567 <me@michaeldrury.co.uk>
Co-authored-by: Rory Powell <rory.codes@gmail.com>
2022-12-12 22:02:32 +00:00
Rory Powell dc70022708 Test fixes 2022-11-16 13:06:30 +00:00
Rory Powell 6017f6be47 Add copy button to sso callback urls, e2e unit testing for OIDC, stub out other auth tests 2022-11-16 11:34:16 +00:00
Rory Powell ad81adb30f Merge branch 'develop' into subdomain-tenancy 2022-11-15 16:18:59 +00:00
Rory Powell d205b5136b ensure fetch and aws are always mocked 2022-11-15 15:50:15 +00:00
Rory Powell 2212305f08 Bump jest and ts-jest to be consistent across backend packages to fix CI issue, test config updates 2022-11-14 22:55:47 +00:00
Rory Powell 80b823f6cf Test fixes 2022-11-11 15:43:41 +00:00
Rory Powell 0bad2dd9ae Support path variable tenancy detection, add /api/system/* tests, update no tenancy matchers to be more accurate 2022-11-11 11:10:07 +00:00
Rory Powell af24f72166 Process quota emails in account-portal 2022-10-06 16:03:47 +01:00
Rory Powell a519eb0cdc update bulk create and bulk delete backend 2022-08-25 19:41:47 +01:00
Rory Powell d123a4de25 Reduce event frequency 2022-08-08 10:47:39 +01:00
Peter Clement e468f83902 adding tests and pr comments 2022-07-27 10:20:39 +01:00
Rory Powell 4cfedf7252 Better handle first time startup + dedicated event 2022-06-15 11:20:13 +01:00
Rory Powell a2b9fcd448 Dev improvements - remove need to rebuilds of backend-core/dist and enable debugging when running tests and backend services, use source directly using typescript and jest path mappings 2022-06-10 22:57:12 +01:00
Rory Powell e447fd11d1 Build fixes 2022-06-09 12:33:10 +01:00