Commit Graph

10 Commits

Author SHA1 Message Date
Aswin V 9f4dddad09
E2E for DSync (#2701)
* Fixture add DSync Page

* Tweak fixture, add delete connection method

* Label should be associated with the input

* WIP Test for Azure SCIM

* Tweak helper to work with Azure SCIM query param

* Fixture add switching to users view method and use instance property for tenant/product

* Include Jackson Api key header in SCIM endpoint request

* Simulate a user creation request to SCIM endpoint and assert it in view

* Update sample user to match type

* Fix flaky test by waiting for dom

* Export helpers from index

* Refactor scimOpEndpoint

* Add group and group member

* Add switching to group view in fixture

* Assert group in groups view

* Tweak userName

* Enable webhook events logging

* Refactor

* Add second user, parametrize azureUser

* Set webhook url/secret

* Assert webhook events

* Refactor view switching

* Refactor event inspection

* Delete webhook logs

* Tweak scimEndpoint creation

* Add `deleteGroup`

* Use util method in api helpers

* Add test for user/group deletion

* Bump up assertion timeout

* Try flakiness fix with waiting for api response

* `updateGroupName` e2e helper

* Assert updated group name

* Revert local changes

* Potential fix for failed test

* Try fix

* Add missing await for visibility checks

* Cleanup await inside expect

* Cleanup waiting for response

* Test user update, disabling webhook event logging

* Parametrize test for Okta/Azure

* Cleanup await

* Try removing assertion timeout

* Put back assetion timeout
2024-05-23 23:22:45 +05:30
Deepak Prabhakara 6bfb89a74e
Renaming routes for Identity Federation (#2618)
* WIP

* updated swagger file

* renamed routes

* renamed test folder

* separate section for Identity Federation

* sso-tracer -> sso-traces

* don't change ACS url for SAML federation

* SAMLFederation -> IdentityFederation

* SAMLFederation -> IdentityFederation

* keep api/federated-saml but move to api/identity-federation

* test old route as well

* fixed test

* fixed test

* retry tests 3 times

* updated deployment

* WIP create SAML Fed app

(cherry picked from commit 3d15b20a2d)

* Add Admin Portal SSO via SAML Fed

* Minor tweaks

* Use fixture and login using federated connection

* Cleanup SAML fed connection after test, disable failing assertion for now

* Remove only

* Use MockSAML endpoint from env

* Cleanup SSO connections mapped to SAML Fed

* OIDC Fed spec

* Try with higher timeout

* Mutate on page load

* Put back assertion

* Remove assertion and mutate for now

* SAML Fed App + 2 SAML Providers

* Take in optional tenant/product for fixture method

* SAML Fed + 2 OIDC providers

* SAML Fed test cases for single provider

* Tweak title

* Replace swr with fetch

* Remove only

* Bump up timeout to 100s

* Add more test cases for OIDC Fed

* Refactor fetch with hooks

* locale tweaks

* Also try with the other provider

* Fixture support SAML add via raw metadata

* Add second SAML connection using raw metadata

* Revert "Add second SAML connection using raw metadata"

* Revert "Fixture support SAML add via raw metadata"

---------

Co-authored-by: ukrocks007 <ukrocks.mehta@gmail.com>
Co-authored-by: Aswin V <vaswin91@gmail.com>
2024-05-10 11:41:23 +01:00
Aswin V 9943a06ace
Extend e2e (#2601)
* Not needed with standalone build in CI as well as local runs

* Start adding tests for main sections under Admin UI

* Add SAML SSO connection

* Remove only

* Debug failing test

* Cleanup debugging changes

* Update mocksaml docker

* Increase number of workers for playwright execution

* Disable multiple workers for now

* Align folder layout with sidebar features

* Enable stdout for webserver

* Try fixture

* Fixture WIP

* WIP fixture tweak and add more test cases

* Fix locator

* Rename test file

* Remove only

* Keep track of connections inside fixture, delete all method fix

* Fix sso naming

* Use portal fixture for common utils

* Make fixture generic for OIDC SSO

* Add OIDC porvider tests

* Comment tweak

* Make client id secret dynamic

* Spec for OAuth2 wrapper + 1 SAML and 1 OIDC providers

* Fixture method to update SSO connection

* Test case for wrong redirect url

* Refactor

* WIP Wrong redirect url test for OIDC provider plus
setup for toggle connection

* WIP inactive connection test

* Set env for credentials login

* Add credentials login to portal fixture

* Fixes
2024-05-06 12:37:12 +01:00
Deepak Prabhakara eb8ca27e94
run playwright against Chrome instead of Chromium (#2416)
* run playwright against Chrome instead of Chromium

* updated playwright
2024-03-08 21:58:00 +00:00
Aswin V cd8dd8580b
Support standalone build in npm start script (#1292)
* Add `postbuild` to copy static/public into standalone

* `prestart` to build,use standalone for `start`

* Sync lock file

* Remove build step, taken care by prestart

* Cleanup playwright webserver

* Update heroku start

* Increase webserver timeout

* Bump up timeout

* Use `copy` instead of xcopy

* Remove `prestart`, add build step back to CI

* Revert timeout to 1min

* [Fix] Prefix path with dot (current dir)
2023-07-29 02:39:35 +05:30
Deepak Prabhakara 8cfb1f4506
Updated to node 18 (#794)
* updated to node 18

* updated to node 18.13.0

* testing absolute url

* Revert absolute url change

* Update playwright

* Try with 1.28.1

* [skip ci] revert package version changes

* [skip ci] get playwright traces

* Revert change

* testing a node18 fix for dns and fetch

* Try dns fix using beforeAll hook

* Try with cmd line option for webserver

* Try with NODE_OPTIONS

* Add dns node_option to Docker build

* Use 0.0.0 to conform to semver

* Update node-version for sdk job

* Add `--install-links=false` flag to `npm install`

* Tweak node-version

* Update `NODEJS_IMAGE`

* Remove flag which is already added in npm script

* Lock file updates

* turn off cache

* npm install needs to be replaced with a custom script that doesn't install links

* add back npm cache

* Sync lock file

* minor tweak

* Update README

* Minor formatting

* Remove build as not required in this job

* Add `prepublishOnly` script to react sdk

* Name the step

* Update `NODEJS_IMAGE` in uffizi dockerfile

* Add E2E section

* Sync lock file

* fixed merge

---------

Co-authored-by: Aswin V <vaswin91@gmail.com>
2023-02-07 12:40:13 +00:00
Aswin V cb8b9134a1
E2E test for OIDC SSO into admin portal (#881)
* Refactor folder structure

* Add job step for mocklab well known oidc document

* Flatten file path

* Fix file name in job

* OIDC discovery path should follow the standard

* Add tests for OIDC sso

* Fix heredoc

* Use different name to avoid conflict with jackson

* Remove annotation

* Add `nonce` to OIDC IdP call

* Add issuer to openid-configuration
2023-01-30 10:45:41 +05:30
Aswin V 305ff93cbb
E2E tests for admin portal SSO (#846)
* Sync lock file

* Add admin portal tests

* Use data-testid to enable `page.getByTestId()`

* Support data-testid for inner elements

* Pass data-testid to sso login button

* Remove env-cmd

* Update folder structure

* Add data-testid

* - Use production build for local testing
 - Set NODE_ENV to pick up .env.test.local

* Add test-id for logout dropdown activation

* Remove test; superseded with new tests

* Fix tests

* Wait for navigation to complete

* [Failing ci test try fix] Pass url for waiting

* [Failing ci test try fix] skip assertion

* [Fix failing test] use predicate to match origin

* Add back the visibility check

* Fix query param

* Tweak test code

* Update return type of callback

* Group tests and reorganise folders

* Add actions to login and assert by locator

* Support html attribute passing

* Set data-testid on edit button

* Set data-testids

* Final changes

* Tweak
2023-01-20 10:37:01 +00:00
Kiran K 842ff50268
Add Playwright test for `/api/v1/` and `/api/scim/` endpoints (#816)
* Update config

* add the test cases for /api/v1/connections

* Fix the strategyChecker, add metadataUrl to the condition

* add the test cases for /api/v1/connections

* update /api/v1/connections

* Update the SSO connections tests

* Rename the test file

* update the tests

* should be able to check if a connection exists

* add the tests for directory sync APIs

* rstructure the tests folder

* add tests wip

* Fix the API tests

* Fix the sso connections tests

* Refactor the connections list

* restructure the /api/v1/connections APIs

* restructure the /api/v1/directory-sync tests

* add the tests for /api/scim/v2.0/

* update the tests

* wip

* fixes the api testing

* allow adding multiple directory connections for the same tenant and product

* update the tests

* update the unit tests

* improved the integration tests

* cleanup the api tests

* add tests for SCIM APIs

* fix the globalSetup

* update the tests for SCIM endpoints

* add the remaining tests

* fix the bug with fetching resource by invalid ID

* cleanup

* fix the tests

* update the tenant name

* typescript types cleanup

* directory sync API updates

* standardize the /api/v1/directory-sync

* update the directories.test.ts

* remove unused methods

* filter the users and groups by directoryId

* improve the SCIM request handling

* fix the e2e tests

* fix the e2e tests

* attempt to fix the api tests

* fix the api testing

* move the files to helpers

* add pagination for directory groups

* API - delete a directory by id

* delete the directory after the tests

* remove the members array from the group info
2023-01-17 10:07:14 +00:00
Aswin V bd44c3479c
Admin interface for Jackson (#71)
* NextAuth + users providers

* Add a temporary fix for verification token - don't use it in production

* Admin ui files

* Admin controller

* getAll db apis

* IdP provider page and api route

* Fix padding

* Style fixes

* middleware to check session

* Loading state handling

* fetcher better response handling

* Add new provider form and api route

* Tab panel in client add form

* Tab switching plus new fields

* Flowbite config

* darkMode with flowbite

* Save config

* Update route path to saml

* Reusable component for add/edit

* cleanup

* Set Secret in NextAuth options

* Prettier lint changes

* Support for delete operation

* Link update

* PopUp Modal reusable component

* Popup confirm before delete

* disable SWR revalidation on focus

* Display IdP metadata, clientID,secret

* Header fixed positioning and style fixes

* Filter raw XML in edit mode

* Add name field to config

* - Edit/New form delta
- Split by newline
- Route back after POST

* Remove flowbite

* Remove flowbite [cleanup]

* Add description field

* updateConfig implementation

* Route PATCH to updateConfig

* Naming change

* Naming Client -> Connection

* AddEdit component updates

* Omit provider, returns full config

* Destructure session first

* Change to domain ACL

* Delete unused component

* Support glob and list of emails for ACL

* Delete unused CSS

* Update package lock

* Remove flowbite from content source

* Redirect to admin route

* Check session in Layout and redirect to login

* Logout in dropdown

* vertical alignment

* Show status message on save (edit)

* Consolidate fields to one long vertical column

* GetAll function for SQL and Add CreationDate and Modification Date for Mongo and SQL

* Add name as header

* Styling and opacity transition for status

* Configure button style fix

* overflow for smaller viewports and rounded border

* Fallback to default behavior of useSession

* Store, use and dispose (after signIn)
verification token in db

* Remove unused class

* Rename Connections ➡ Configurations

* Handle getAll and getConfig using slug

* Better naming

* Update fetch paths

* Refactor getAllConfig ➡ getConfig (By Id)

* Better naming

* Rename saml ➡ samlconf

* Use light theme by not defaulting to system theme

* Path update /samlconf ➡ /saml/config

* Fix path

* Revert manual changes

* getall funcationality and migration  script

* message

* Updating migration file formating

* message

* Pull and fix package.json and lock file

* correcting the migration script formatting

* remove file

* add new migration files

* e2e with playwright

* Better naming

* Remove comment

* Make headless

* Run npm install from root

* Add e2e steps in workflow

* try with separate npm installs

* Move higher in the pipeline to test

* Fix quote

* Rely on npx

* fixed migration script formatting

* spelling correction

* headless for CI but false for local

* Use secret

* Type fixes for mongo

* [skip ci] Swagger annotation for getConfig

* Adding migration scriptis for all db's

* added migration script to prettierignore

* unformat migration script

* removing postgress migration files

* generate new migration files

* remove wrong migration files

* Add new migration files  for mysql and mariadb

* [skip ci] Swagger annotation for updateConfig

* Return empty for update op

* Update swagger spec

* Fix type

* Wait for mongo to start

* Fix db_engine

* Test with pg

* Test with POSTGRES_DB env to auto create db

* Swap install-deps with install

* Use prod build

* enable @ts-ignore

* Test some fixes

* Can be omitted in next-auth v4, uses secret

* Move env to playwright config

* authDbSeed script needs the db and other secrets

* Typo

* Bad typo day 😅

* Again typo

* Set NEXTAUTH_URL

* Use prod build in CI

* Prefix the env for seeding

* Try with inline

* tidying up migration scripts

* fixed migration scripts

* Set env in actions yml

* Remove comma

* Target chromium

* Prefix the env

* Try inline in playwright

* print env

* Move build to action step

* Remove console log

* Let env sit on the job level

* Add ACL

* Fix attribute check

* Add name field

* add name in metadata preload config

* Use postgres

* Remove unneeded secret

* Remove env/options from mongo service

* Fix swagger

* Update swagger spec

* [skip ci] Fix eslint warning

* Add updateConfig test

* Add description to preloaded config

* [skip ci] cleanup

* minor fix

* Update comment

* Expose PATCH in config api

* Added missing validation for clientSecret

* Update swagger spec

* updated example postgres url, updated deps

* Redirect to saml config route

* Remove unused pages/routes

* Update in package lock

* Add primary and secondary colors to tailwind

* Swap icon

* Remove text-color and apply default theme

* Use the primary color from theme

* Reusable custom class for btn-primary

* Add link-primary reusable class

* Use primary secondary colors for main logo

* Show error status & color align with primary color

* Show product if name is absent

* Simplify required attribute setting,
'description' is not required

* Make description optional

* Fix placeholder text

* Swagger updates

* Add validation for description

* Swagger - add missing status codes & descriptions

* Update swagger artifact

* Fix styling for status message

* revalidate config on successful save

* style text highlight globally

* Fix cancel button style

* Set the main height to 100%-headerHeight,
add overflow

* removed default ACL, if someone forgets to change it then we might have Tony Stark logging into everyones instances :)

* print the arch/platform

* Collect platform info

* Disable swc and remove platform query steps

* Try with custom babel config to disable swc

* Add next.js build cache

* Refactor step

* trying swc

* Make name parameter optional

* Update form state from backend after save

* port 5000 -> 5225

* Handle empty value case for ACL

* bumped up version

Co-authored-by: Kiran <kiran@boxyhq.com>
Co-authored-by: Vishal Lodha <vishal@boxyhq.com>
Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com>
Co-authored-by: Utkarsh Mehta <ukrocks.mehta@gmail.com>
2022-02-22 19:03:21 +00:00