Commit Graph

62 Commits

Author SHA1 Message Date
Deepak Prabhakara 5eb106e5c4
Rename saml fed and sso tracer (#2693)
* rename

* more rename

* samlFed -> idFed
2024-05-11 13:35:32 +01:00
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
Deepak Prabhakara f3c677b82b
Persist instanceKey across nextjs loads, show type colum in Identity Fed apps (#2519)
* persist instanceKey across nextjs loads

* lint fix

* display type in identity federated apps

* updated engines, moved cross-env to deps (needed for npm start)

* updated node

* 20.12.1 not available
2024-04-04 13:35:53 +01:00
Aswin V 46ccc69ff6
Use itemlist component from UI SDK (#2513)
* Fix outline style

* Fix types

* Use `ItemList` from UI SDK

* Cleanup locale

* Externalize UI SDK

* Add UI SDK to peer dependency

* Package lock changes

* updated react-ui

* reverse accidental commit

* call toast inside useEffect

* Update dependency array

---------

Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com>
2024-04-04 00:03:34 +05:30
Deepak Prabhakara 742f9b0676
Cleanup duplicate locale and components (#2493)
* Tweak sdk style import order

* WIP

* Override SDK styles

* Cleanup and pass props to component

* Cleanup setup link related code as it's handled via setup-link instructions

* Cleanup locale

* Fix e2e tests

* Fix selectors in e2e test

* Add select dropdown style override

* Use component from SDK

* Cleanup locale

* Use Edit DSync from SDK

* Remove default webhook props from setup token page

* Ability to set default webhook secret

* Tweak header text

* Revert sdk style import order - app styles should be latest

* Override default SDK focus style

* Update locale

* Use Edit component from SDK

* Allow patching oidcMetadata fields

* Tweak return data format

* Route change on edit success and other fixes

* Fix button styles

* Fix data access from API

* Fix focus styling for error btn

* Sync lock file

* Cleanup unused files

* Set `displayInfo` to false for setup link and fix exclude fields for SAML under setup link

* Allow forceAuthn in setup links

* Only update forceAuthn if its a boolean value coming from body

* Cleanup and hideSave only for setup link

* Update UI SDK

* Cleanup locales

* Fix failing e2e

* cleaned up dups

* cleaned up dups

* cleanup of components

* more cleanup

* cleanup

* locale cleanup

* dup cleanup

* Reuse styles

* Set min value for expiry field to 1

* Validate expiry before using

* Update SDK and set idpMetadata display to true

* cleaned up unused code, added formik as dep

* clean unused locale strings

* cleaned up ErrorMessage component

---------

Co-authored-by: Aswin V <vaswin91@gmail.com>
2024-03-28 13:21:59 +00:00
Aswin V 67f111711a
Use UI SDK (#2464)
* Tweak sdk style import order

* WIP

* Override SDK styles

* Cleanup and pass props to component

* Cleanup setup link related code as it's handled via setup-link instructions

* Cleanup locale

* Fix e2e tests

* Fix selectors in e2e test

* Add select dropdown style override

* Use component from SDK

* Cleanup locale

* Use Edit DSync from SDK

* Remove default webhook props from setup token page

* Ability to set default webhook secret

* Tweak header text

* Revert sdk style import order - app styles should be latest

* Override default SDK focus style

* Update locale

* Use Edit component from SDK

* Allow patching oidcMetadata fields

* Tweak return data format

* Route change on edit success and other fixes

* Fix button styles

* Fix data access from API

* Fix focus styling for error btn

* Sync lock file

* Cleanup unused files

* Set `displayInfo` to false for setup link and fix exclude fields for SAML under setup link

* Allow forceAuthn in setup links

* Only update forceAuthn if its a boolean value coming from body

* Cleanup and hideSave only for setup link

* Update UI SDK

* Cleanup locales

* Fix failing e2e

* Reuse styles

* Set min value for expiry field to 1

* Validate expiry before using

* Update SDK and set idpMetadata display to true

---------

Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com>
2024-03-28 01:05:55 +00:00
Deepak Prabhakara ece4a4fca6
Verify client id and secret in OIDC Federation pkce flow (#2492)
* verify client id and secret for fed id

* support client_secret_basic

* tweaked edit saml fed app to hide and show client secret
2024-03-26 21:55:24 +00:00
Aswin V 24eef6d53f
Trace OIDC Federation in SSO tracer (#2447)
* Set `isOIDCFederated` in authorize path

* Add `isOIDCFederated` to samlResponse

* OIDC Federation badge

* Type fixes

* Update locale

* Refactor for readability

* Fix key

* [Bug fix] Block IdP initiated SAML if connection is deactivated

* Add missing `isOIDCFederated` to context

* Move connection active check within the tracer bounds

* Move oidcPath check within tracer bounds

* Trace OIDC Provider request initiation

* Minor nitpicks
2024-03-19 10:31:14 +00:00
Deepak Prabhakara f816bb21dd text tweak 2024-03-06 20:35:06 +00:00
Aswin V 1188dd6396
Pagination fixes (#2347)
* `offset` -> `pageOffset`, `limit`-> `pageLimit`

* Be backward compatible in API

* Cleanup types and handle pagination qs

* Cleanup unused code

* Import type

* Cleanup and fix lint error

* Align params for sso-tracer

* Move parsing to a common util function

* pageLimit shouldn't be optional

* Cap pageLimit to max value, split the boolean

* Revert typings and assert non null

* Refactor var name

* Use util function to normalize pagination params across getAll and getByIndex

* Normalize offset/limit for dynamo/mongo

* Update query params in `FederatedSAMLApps`

* Cap to max limit if passed limit is 0

* Sync lock file

* Add a 3rd record and supply opts.pageLimit

* Normalize offset/limit for mem/redis

* Save the 3rd record in the store

* Fix getAll tests

* Give precedence to standard params over legacy

* Use util function

* Parse using util function

* Refactor

* Standardise pagination for `api/v1/dsync/events`

* Standardise pagination for api/admin/connections

* Standardise pagination for api/admin/directory-sync

* Standardise pagination for `api/v1/dsync/groups`

* Standardise pagination for `v1/dsync/users`, `v1/dsync/product`

* Standardise pagination in fetchByProduct APIs

* Update swagger for groups

* Fix pagination params definition, add the params for users api

* More swagger updates

* Swagger spec update for dsync events

* Add pagination params to apis fetching by product

* Update qs in internal-ui

* Remove type assertion

* [Swagger WIP] Fix response format for paginated APIs

* Add dsync events to swagger spec

* Fix swagger spec for sso tracer

* Fix swagger spec for federated-saml apps of a product

* Update pageLimit to 50

* Use pageLimit value from internal-ui

* Update UI SDK

* Cleanup local pagination component

* Update swagger version

* Remove unused keys from locale

* Fix tag for trace api spec

* Fix param name for swagger

* Fix swagger tag for trace

* updated package-lock

* updated package-lock

---------

Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com>
2024-03-06 20:14:14 +00:00
Deepak Prabhakara e8d9c2aa1a
SAML Federation -> Identity Federation (#2384) 2024-03-05 17:33:27 +00:00
Deepak Prabhakara a473b360ef
New OIDC fed (#2336)
* add WellKnownURLs

* Fix translation keys

* Update dependencies and add IdP Configuration

* Update common.json with new translations

* wip

* Update @boxyhq/internal-ui version to 0.0.5

* add internal ui folder

* Fix imports and build

* Refactor internal-ui package structure

* wip shared UI

* Fix the build

* WIP

* Add new components and hooks for directory sync

* WIP

* lint fix

* updated swr

* WIP

* users

* Refactor shared components and fix API endpoints***

***Update directory user page and add new federated SAML app

* Fix lint

* wip

* Add new files and update existing files

* Refactor DirectoryGroups and DirectoryInfo components

* Update localization strings for directory UI

* Update Google Auth URL description in common.json

* Refactor directory tab and add delete functionality to webhook logs

* IdP selection screen changes

* Delete unused files and update dependencies

* Fix column declaration

* Add internal-ui/dist to .gitignore

* Update page limit and add new dependencies

* wip

* Refactor directory search in user API endpoint

* wip

* Refactor directory retrieval logic in user and group API handlers

* Add API endpoints for retrieving webhook events

* check app's redirectUrl, TODO: save app info into session to read later

* Add query parameters to API URLs in DirectoryGroups

* working saml login via IdP select. TODO: oidc login via IdP select and saml + oidc login with 1 connection

* oidc IdP working with selection

* working oidc fed -> saml flow

* Add Google authorization status badge and handle pagination in FederatedSAMLApps

* Add router prop to AppsList component and update page header titles

* UI changes

* updated peer-deps

* Add new files and export functions

* Remove unused router prop

* Add PencilIcon to FederatedSAMLApps

* updated federated app creation page

* updated federated app edit page

* Refactor FederatedSAMLApps and NewFederatedSAMLApp components

* lint fix

* lint fix

* updated package-lock

* add jose npm to dev dep

* added missing strings

* added missing strings

* locale strings fix

* locale strings cleanup

* tweaks to icon imports

* replaced textarea with list of inputs for Federated Apps redirect url

* update package-lock

* Add prepublish step

* Build and publish npm and internal ui

* Refactor install step

* Run npm install (for local) inside internal ui automatically using prepare

* Remove eslint setup for internal-ui

* updated package-lock

* Add `--legacy-peer-deps` to prevent installing peer dependencies

* Fix the types import path

* wip

* wip

* Fix the types

* Format

* Update package-lock

* Cleanup

* Try adding jose library version 5.2.2

* allow selective subdomain globbing

* removed duplicate jose lib

* updated package-lock

* updated swagger doc

* SAML Federation -> Identity Federation

* fixed locale strings

* turn off autocomplete for tags input

---------

Co-authored-by: Kiran K <mailtokirankk@gmail.com>
Co-authored-by: Aswin V <vaswin91@gmail.com>
2024-03-05 16:57:02 +00:00
Deepak Prabhakara ae8c3e61e4 maintain order of bui strings 2024-03-01 19:15:43 +00:00
Kiran K a6ef0ddddb
Internal UI : Setup Link & SSO Tracer (#2354)
* add WellKnownURLs

* Fix translation keys

* Update dependencies and add IdP Configuration

* Update common.json with new translations

* wip

* Update @boxyhq/internal-ui version to 0.0.5

* add internal ui folder

* Fix imports and build

* Refactor internal-ui package structure

* wip shared UI

* Fix the build

* Add new components and hooks for directory sync

* lint fix

* updated swr

* users

* Refactor shared components and fix API endpoints***

***Update directory user page and add new federated SAML app

* Fix lint

* wip

* Add new files and update existing files

* Refactor DirectoryGroups and DirectoryInfo components

* Update localization strings for directory UI

* Update Google Auth URL description in common.json

* Refactor directory tab and add delete functionality to webhook logs

* Delete unused files and update dependencies

* Fix column declaration

* Add internal-ui/dist to .gitignore

* Update page limit and add new dependencies

* wip

* Refactor directory search in user API endpoint

* wip

* Refactor directory retrieval logic in user and group API handlers

* Add API endpoints for retrieving webhook events

* Add query parameters to API URLs in DirectoryGroups

* Add Google authorization status badge and handle pagination in FederatedSAMLApps

* Add router prop to AppsList component and update page header titles

* UI changes

* Add new files and export functions

* Remove unused router prop

* Add PencilIcon to FederatedSAMLApps

* Refactor FederatedSAMLApps and NewFederatedSAMLApp components

* lint fix

* add jose npm to dev dep

* added missing strings

* locale strings fix

* locale strings cleanup

* update package-lock

* Add prepublish step

* Build and publish npm and internal ui

* Refactor install step

* Run npm install (for local) inside internal ui automatically using prepare

* Remove eslint setup for internal-ui

* wip

* Add `--legacy-peer-deps` to prevent installing peer dependencies

* wip

* Fix the types import path

* wip

* wip

* Fix the types

* Format

* Update package-lock

* Cleanup

* Try adding jose library version 5.2.2

* Add new dependencies for @next/swc package

* Fix translation keys and import types

* Update SSOTracers component and common.json localization

* COPY internal-ui before npm install

* COPY internal-ui in builder stage

* fixed sort order for jose

* wip

* wip setuplink

* Add delete link

* Add exclusion for node_modules in files.exclude

* Add error handling and additional functionality to SetupLinks component

* Refactor SetupLinks component and add missing translations

* Add missing translations and update setup link messages

* Remove comment

* update localization strings

* Remove unused key

* Update SSOTracerInfo component title

* Refactor ConfirmationModal component button styling

* Update package.json and ConfirmationModal.tsx

* Update dep

* Refactor setup links API and UI to use query parameters for pagination

* Refactor deleteLink API endpoint and SetupLinks component

* Update package.json paths

* Update dep

* Refactor setup link forms and add new fields

* Update dep

* Update import paths and add new setup links tests

* wip

* Refactor CreateDirectory and DirectoryInfo components

* Add new fields to setup link and directory sync APIs

* Cleanup

* Update package-lock

* Fix link regeneration

* updated package-lock

* Fix and add e2e tests

* Update API documentation with new parameters for setup link creation and update

* Revert

* Update postcss.config.js and SSOForm.tsx

---------

Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com>
Co-authored-by: Aswin V <vaswin91@gmail.com>
2024-03-01 17:00:38 +00:00
Kiran K 952bfe360f
Display the Google dsync auth button on Setup Link (#2361)
* Display the Google auth button

* Delete DirectoryInfo and DirectoryTab components
2024-02-29 11:45:37 +00:00
Kiran K 734de64c4d
Add `@boxyhq/internal-ui` (#2305)
* add WellKnownURLs

* Fix translation keys

* Update dependencies and add IdP Configuration

* Update common.json with new translations

* wip

* Update @boxyhq/internal-ui version to 0.0.5

* add internal ui folder

* Fix imports and build

* Refactor internal-ui package structure

* wip shared UI

* Fix the build

* Add new components and hooks for directory sync

* lint fix

* updated swr

* users

* Refactor shared components and fix API endpoints***

***Update directory user page and add new federated SAML app

* Fix lint

* wip

* Add new files and update existing files

* Refactor DirectoryGroups and DirectoryInfo components

* Update localization strings for directory UI

* Update Google Auth URL description in common.json

* Refactor directory tab and add delete functionality to webhook logs

* Delete unused files and update dependencies

* Fix column declaration

* Add internal-ui/dist to .gitignore

* Update page limit and add new dependencies

* wip

* Refactor directory search in user API endpoint

* wip

* Refactor directory retrieval logic in user and group API handlers

* Add API endpoints for retrieving webhook events

* Add query parameters to API URLs in DirectoryGroups

* Add Google authorization status badge and handle pagination in FederatedSAMLApps

* Add router prop to AppsList component and update page header titles

* UI changes

* Add new files and export functions

* Remove unused router prop

* Add PencilIcon to FederatedSAMLApps

* Refactor FederatedSAMLApps and NewFederatedSAMLApp components

* lint fix

* add jose npm to dev dep

* added missing strings

* locale strings fix

* locale strings cleanup

* update package-lock

* Add prepublish step

* Build and publish npm and internal ui

* Refactor install step

* Run npm install (for local) inside internal ui automatically using prepare

* Remove eslint setup for internal-ui

* Add `--legacy-peer-deps` to prevent installing peer dependencies

* Fix the types import path

* wip

* wip

* Fix the types

* Format

* Update package-lock

* Cleanup

* Try adding jose library version 5.2.2

* COPY internal-ui before npm install

* COPY internal-ui in builder stage

* fixed sort order for jose

---------

Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com>
Co-authored-by: Aswin V <vaswin91@gmail.com>
2024-02-27 22:12:39 +00:00
Aswin V b54463e45a
Switch to UI SDK for SSO (#2299)
* WIP Connection List SDK component usage

* Cleanup

* Align response data format with v1

* Cleanup and auto route to new connection creation for setup link

* Minor formatting

* Switch to SDK component for DSync list

* Fix query param in API

* Disable pagination for setup link view

* Update SDK

* [e2e test] Locate by label

* Sync lock file

* Disable pagination for settings view also

* cleanup

---------

Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com>
2024-02-22 11:26:47 +05:30
Deepak Prabhakara 2e6fa98888 locale strings cleanup 2024-02-21 18:32:09 +00:00
Deepak Prabhakara 150c049c10 locale strings fix 2024-02-21 18:04:24 +00:00
Aswin V d410fe2b76
Setup link fixes (#2316)
* Add missing success toast

* Remove auto routing

* Add translation

* added TODO

---------

Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com>
2024-02-16 15:12:38 +00:00
Deepak Prabhakara 5c79b94906
tweaks to align with SaaS app (#2287)
* tweaks to align with SaaS app

* tweaks

* tweaked table to avoid overflow of long text (long name still messes the layout)

* wrap around for long words

* aligned SSO Tracer with SaaS app

* aligned SSO Tracer with SaaS app

---------

Co-authored-by: Kiran K <kiran@boxyhq.com>
2024-02-12 10:23:12 +05:30
Deepak Prabhakara 35c7052cd9
make ory optional, add default for samlAudience, don't force entityID… (#2250)
make ory optional, add default for samlAudience, don't force entityID to be a url
2024-02-02 23:03:55 +00:00
Aswin V c8d7d1418d
OIDC tracing improvements (#2239)
* `error_description` is optional for OAuth error response

* Capture OPError attributes

* Trace the original `Error.message`

* Expand trace `context` members to include OIDC error params

* Attach token response to trace context

* Rename context param to be specific to oidc

* Display additional context specific to OIDC SSO

* Add translations

* Better grouping of the oidc errors and be more specific with title

* Fix table title
2024-02-01 17:02:20 +05:30
Kiran K 705e26b19d
SAML Federation - Generate unique SP entity id (#2233)
* SAML Federation - Generate unique SP entity id

* Refactor EntityId component

* Refactor EntityId component and add generateEntityId function

* Fix the placeholder
2024-02-01 09:52:51 +00:00
Deepak Prabhakara 05658a47f3
added onBlur to TagsInput (#2232)
* added onBlur to TagsInput

* updated text
2024-01-31 22:59:28 +00:00
Kiran K 7103d61967
Add support for associating multiple tenants in SAML federated apps (#2214)
* Add support for associating multiple tenants in SAML federated apps

* Add tenants input field to edit and new pages

* Refactor

* Add support for filtering connections by multiple tenants

* Update global CSS styles for react-tagsinput

* Update border-radius for react-tagsinput

* Refactor CSS styles for react-tagsinput

* Update the tenants array

* Cleanup tenants assignment
2024-01-31 09:11:46 +00:00
Aswin V b81e9218f1
Trace OIDC response path (#2179)
* [typings] OIDC provider clientId/secret is non optional

* try/catch and trace the errors ...

* Fix error message inside `resolveConnection`

* Default for error_description, trace error should be either error or fallback to description

* Attach traceId to OAuth error response

* Add more context to the traces

* [fed-saml] Add relayState to trace context

* Tenant/product can be traced from session.request in case connection is not resolved

* Minor change

* [npm] Rename `saml-tracer` -> `sso-tracer`

* [Admin UI/API] Rename `saml-tracer` -> `sso-tracer`

* [v1 API] Rename `saml-traces` -> `sso-traces` with alias to old path

* Fix assertion type display with fallback to `-`

* Update swagger spec

* Scroll in case text overflows
2024-01-23 22:35:17 +00:00
Deepak Prabhakara fc5f25342e text tweaks 2024-01-22 16:41:44 +00:00
Aswin V c0bd0b5eb0
Tweak branding logo rendering (#2171)
* Remove width/height and set max-height

* Sync lock file

* Increase max-height for idp select

* Tweak branding_logo_url_alt

* Minor text tweak

* text tweak

---------

Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com>
2024-01-18 21:24:52 +00:00
Kiran K 4a719ee911
Make Setup Link Expiry Time Configurable (#2112)
* Make Setup Link Expiry Time Configurable

* Update setup link expiry variable

* Fixes

* Add tests
2024-01-03 12:30:13 +00:00
Kiran K fde4e59fa6
Add missing translations (#2089)
* Add missing translations

* Add eslint-plugin-i18next plugin

* Add missing translation

* Update translations

* Update ESLint rules and improve UI text

* Update WellKnownURLs locales

* Add server-side translations in SetupLinkIndexPage
2023-12-27 12:21:53 +00:00
Aswin V 8189d50cd0
Tweak well known tab structure (#2049)
* IdP tab is now the first one

* IdP-config should be the default selected

* Fix styling for link

* Add OpenID SP route, tweak well known list to include the same
2023-12-13 18:23:37 +00:00
Aswin V 5a813991db
Fix readonly view (#1386)
* Switch `disabled` to `readOnly`

* Add copy to clipboard button for clientSecret

* Position the copy button next to label

* Add show/hide secret button

* Use semantic button to improve a11y

* Sync lock file

* Spread rest props on button instead of icon

* Refactor password input to separate component to fix hook issue

* Sync lock file

* Set oidcClientSecret field to password type
2023-07-31 22:41:03 +05:30
Kiran K 07a5f8a46d
Google Directory API Integration (#1158)
* Add Google Group API

* Restructure the Group interface

* Rename the methods

* wip

* temp change

* Revert the changes

* Fix the groups from Google

* wip fetch users

* Skip directory check

* Convert to SCIM schema

* Updates to users sync

* Fix the unit test

* Rename folder and merge the files

* add raw to the user payload

* Fix the unit tests

* Optimize the Group sync create ops

* Reorder import

* Remove unused imports

* Add type safety to SCIM Schema

* Fix the users and groups update

* try fixing unit tests

* Fix the file extension

* Delete groups that are not in the directory anymore

* Fix the group update

* Compare and find the delete users

* Add and update group members

* cleanup the test

* Fix the test (temp)

* dont throw error

* Add secondary index if the directory type is `google`

* Rename the file

* wip

* Export functions inline

* Hide the SCIM endpoint and token for non-scim provider

* Update the `dsync` option key to allow multiple providers

* Restructure the folders

* Update folder structure

* Cleanup

* Revert the callback changes

* Fix the type

* Fix the type

* Fix existing unit tests

* add callback

* Fix the internal callback

* Fix the method call

* merge the type files

* add console.info for testing

* Fix the Google OAuth client usage

* Reactor the update method

* Handle no users or group cases

* Refactor the sync method

* Fix the pagination

* Cleanup

* Finish the pagination

* Fix the unit tests

* Fix the lint errors

* Fix the build issues

* Pass directory id to the method

* Pass directoryId while fetching

* apply changes to the UI

* display the Google auth URL

* Fix the type

* add unit tests

* add unit test for syncing users

* add unit tests

* Pass operation to SCIM payload

* unit tests wip 1

* updated

* Test the events deleted

* Test group.user_added events

* Finish the tests

* Revert and cleanup

* update map.js

* Revert

* update the e2e test

* Cleanup

* Revert

* label tweak

* Remove unused import

* Protect the cron job using apiKey

---------

Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com>
2023-06-15 14:31:38 +01:00
Deepak Prabhakara 2b79aee3ad updated tagline 2023-05-22 15:12:09 +01:00
Kiran K c8e0eb85fc
add ability to activate/deactivate the sso and directory sync connections (#1049)
* add support to activate and deactivate SSO connections

* add unit tests for sso.deactivated and sso.activated

* prevent sso login with deactivated connection

* add deactivate key for directory sync

* update the Badge component to extend react-daisyui

* restructure the status toggle button

* update the connection toggle for directory connection

* wip

* tweak variables

* wip

* cleanup

* delete the connection after each test

* ask for confirmation before sending the request

* use PATCH method

* fix the default value for toggle

* stop sending webhook if connection is disabled

* add the key deactivated to connection object

* fix the unit test

* attempt to fix the test

* update

* allow passing data-testid to ConfirmationModal

* revert the changes

* cleanup

* remove the console.log

* remove unused imports

* sync the state after the status change

* Sync lock file

---------

Co-authored-by: Aswin V <vaswin91@gmail.com>
2023-04-10 13:56:26 +01:00
Kiran K b321184fec
Add support for the method `deleteMany()` (#1033)
* wip

* Add deleteMany method to SQL engine

* add deleteMany to mem engine

* add deleteMany to MongoDB

* add deleteMany to Redis engine

* fix the test

* use deleteMany method in dsync

* add delete directory connection API

* add button to delete directory

* add new lang keys

* fix the delete directory connection

* use a limit variable

* fix eslint issues

* attempt to fix the test

* DynamoDB support deleteMany

* check if disabling DYNAMODB_URL can fix the timeout issue

* fix the planetscale impl

* Test GitHub action

* revert the change

* add bulk Delete Batch Size

* deleteAll should accept the directory Id

* fix the deleteMany for mem engine

* fix the tests

* cleanup

* change the order of deletion

* add database transaction to sql

* fix the linting issue

* use the promise

* rename variable

* change the delete order
2023-03-28 14:39:21 +01:00
Kiran K 224358df28
Ability to customize the branding of Setup Link pages and the IdP selection pages (ee) (#965)
* display toast and adjust the width of the content

* customize the branding for setup links

* use the branding in setup links page

* Admin Branding WIP

* Update settings

* Move to ee folder

* If the licence is not valid, return the default branding

* update translation

* Add logo to the idp selection page

* add license check to the API

* read default branding from a common place

* add LicenseRequired

* cleanup

* Add License check to NPM

* Fix

* Add --pf css variable

* fix the idp selection page

* use default branding if value is not set

* Fixes

* Improved the store and keys

* Infer the return type

* Whitelabeling the IdP selection screen per tenant and product

* Fix the param type

* Fix the unit tests

* Fix mismatch in server/client rendering

* Switch to radio button look and feel

* Use rounded border only for textual inputs

* Cleanup import

* Move routing to `useEffect`

* Fix server render mismatch

* fixed merge conflict

* fixed merge conflict

---------

Co-authored-by: Aswin V <vaswin91@gmail.com>
Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com>
2023-03-09 14:50:25 +00:00
Aswin V c8fb34823b
SAML Tracer (#945)
* `SAMLTracer` bootstrap

* Pass `db` handle

* Expect `null` when license is void

* Skeleton - WIP

* Add `Trace` type

* Hook into `samlTracer`

* Secondary index and other changes

* Remove secondary index, support pagination

* Remove TTL on tracer store, add secondary indices

* Add `traceId` alongside payload value

* Implement `cleanUpStaleTraces`

* Trace any error in response parsing stage

* Move `setInterval` to constructor, also run at start

* Use arithmetic

* Make method `public`

* `await` on delete op

* Fix logic: store `concat` result in `traces`

* Unit tests

* Switch `randomUUID` to `generateMnemonic`

* Tweak const name

* Typo fix

* SAML Tracer to the sidebar

* Api routes and pages

* i18n

* SAML Tracer instance and type updates

* Page and api route for admin portal

* Update comment

* Rename variable

* Enhance types, make `timestamp` optional

* prefix `traceId` to error_description

* Assert traceId pattern and return value

* Add translations for traces list table

* Updates for SAML Tracer viewer

* Format the `error_description`

* Implement `getByTraceId`

* keycheck instead of falsiness check

* Use status `403` and minor tweaks

* Api route for getting single trace by `traceId`

* Trace Inspector view

* Move SAMLTracer out of `ee`

* Remove license check

* Placeholder for parsing rawResponse

* Trace inspect page

* Tweak description

* Wrap `samlResponse` in try catch

* Refactor and style changes, display more context

* Rethrow error for SAMLFederation without
redirecting

* Add `issuer`,`profile` to context

* Switch to `<span>` inside `<p>`

* Format profile display and fix issuer term

* Add TODO comment

* Use empty string if `issuer` turns out to be empty

* Package lock changes

* Tweak the comment

* Handle error with no op within saveTrace

* Wrap SAML error points in `authorize` with tracer

* Sync lock file

* Redirect to jackson error page for federated sso

* Pass `samlTracer` to Federated SSO class

* Trace the error and rethrow to caller

* Refactor

* Expand `context` type

* Gaurd for absent context fields

* Disable word-wrap for timestamp

* Display additional context

* `await` to catch errors inside promise

* Use tenant/product from app instead of connection

* Use translation and minor fix

* More translations

* More translations

* Remove "unlikely request" capturing

* Copy to clipboard button

* `await` inside try catch block

* cleanup

* Expand `try` to include jackson init

* Add `requestedOIDCFlow`

* Filter out empty indices

* Make `samlTracer` internal to jackson

* Use `AdminController` to get trace data

* Default to 0 for pagination

* Add comment

* Add IdP login flag to context

* Move the assignment before IdP flow check to populate context

* Add `relayState` to context

* Add `redirectUri` to context
2023-03-07 22:36:13 +00:00
Deepak Prabhakara 1e2e6fcdf1
Terminus UI (#977)
* WIP

* tweaks

* more tweaks

* layout without any controls

* only need sprites.png

* added Terminus blocks

* converted to ts

* z-index hack

* fixed layout without z-index hack

* retrieve model

* upload model

* terminus config

* lint fixes

* refactor

* added confirmation modal and toasts

* fixed cue generation

* fixed modal toggle
2023-03-02 20:55:54 +00:00
Aswin V 54bd0467de
Generalise error display (#978) 2023-03-02 16:11:34 +05:30
Kiran K 887750d068
Email password login (#883)
* display toast and adjust the width of the content

* Login with email and password

* Find the admin credentials that match the email and password

* tweaks

* replace <a> with <button>

* renamed env var, added docs to .env.example

* updates based on the feedback

* hide/show the login methods based on whether they have been enabled or not.

* tweaked text

---------

Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com>
2023-02-07 12:25:28 +00:00
Kiran K 04938aeb04
fix: use the HTML page for displaying the SP SAML Config (#857)
fix:use the html page for displaying the SP SAML Config
2023-01-18 20:19:20 +00:00
Aswin V b14a0f1623
Admin portal sso login (#762)
* env, login button & translations

* added setting in sidebar
Added login with sso button
Added connection create form in settings

* added new pages for Self SSO connection CRUD

* Fixed Self SSO issue

* Use @boxyhq/react-ui component for SSO

* `await` on method instead of class

* Fix import

* Set fields to non-editable for settings view

* Tweak for settings view

* Add link for settings in sidebar

* Take in admin SSO defaults from env

* Tweak edit page for settings view

* Remove `NEXT_PUBLIC` prefix

* Switch back to getSSP from getStaticProps

* Sync lock file

* Set defaults in env

* Filter out admin sso tenant/product

* Load admin SSO tenant/product

* Update heading

* Fix back link

* Use latest published version

* Set `clientId` to dummy in provider init

* Use the defaults from env

* Fix redirectUrl after savingConnection for settingsView

* Use `isLoading` from SWR

* Fix settings view url for mutation and redirect in Edit

* Replace api route path

* Use rewrite instead of router.push and other tweaks

* Reuse `ConnectionList` for settings

* Use pagination query params in settings api

* Import styles from sdk

* Fix failing build

* Use latest version

* - Display badge for system sso connections
- Reuse admin connection for retrieving system sso
connections

* Tweak styling

* Construct profile in updateUser as done previously

* Update react-ui

* Remove extra truthy check

* Hide pagination buttons for settings view

* Install @boxyhq/react-ui as symlink to local

* Tweak badge size

* Rename admin portal sso envs

* Fix the edit redirection for system sso

Co-authored-by: ukrocks007 <ukrocks.mehta@gmail.com>
Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com>
Co-authored-by: Kiran K <kiran@boxyhq.com>
2023-01-12 20:39:08 +05:30
Utkarsh Mehta d779145fe8
Prefill redirect url setup link (#815)
* added new fields to setup link create form and translations
Added related changes to api and types

* showing and hiding fields
api changes for create setup link
create & update connection changes

* added missing translation string

* uncontrolled input warning fix

Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com>
2023-01-10 20:12:16 +00:00
Utkarsh Mehta 61796eb59f
Pagination related changes for audit logs projects (#813)
* pagination related changes for audit logs projects

* fixed the colSpan
useProject signature fixes

* used toast component  instead of ErrorMessage
Changes in the api to send correct error messages

* response fixes
2023-01-06 18:59:27 +00:00
Kiran K b2c7bf8c37
display the message when there is no more results to display when paginating (#808)
* display the message there are no more results to display when paginating

* Update colspan value

Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com>
2023-01-05 00:59:51 +00:00
Utkarsh Mehta 0d7fac092b
Retraced Admin UI (#452)
* Merged

* Revert the changes

* changes

* dropdown working

* fixes

* added custom classes for log viewer

* Create Project & styling fixes

* Update package-lock.json

* fixed react datepicker css issues

* Showing apis keys after project is created

* View tokens page

* minor changes

* masking for tokens

* warning fixes

* Fix the sidebar active state

* wip

* wip

* wip

* Showing publisher api url

* Fixed create new projects and list projects

* Improved the ProjectInfo page

* Fix the copy to clipboard button

* Add the codesnippet

* wip

* wip UI

* Improve the code snippet

* Fixes and improve the UIs

* Replace the product logos

* Set the group null

* Fix the conflicts

* Fix the heroicons

* Remove the unused method

* Make the ProjectDetails 2 columns

* Fix the logs-viewer not displaying

* read event log from admin-ui

* Jackson docker compose file & retraced integration related changes

* minor fix

* fixes for created key of audit log

* fixed the expiry for self signed certificate

* using node forge for self signed certs

* Revert "using node forge for self signed certs"

This reverts commit c027b5b7ce.

* fix

* package lock changes

* installed missing dependancies and added new packages

* minor fixes

* fixes

* added missing translations for retraced pages

* - pin deps
- removed react-copy-to-clipboard, react-host-toast

* fixed typo

* cleanup

* tweak

* switched to ButtonIcon

* switch to button components and added back buttons where needed

* checking npm ci

* simplified env vars for Retraced

* tweaks

* If Retraced host is not specified then show a message

* added audit logs logo

* - added admin_token to bypass user and project specific queries
- fixed project details view to read any length for environments

* switched to daisyui Select

* fixed auth check for api routes, get email for claims from the jwt

* updated package-lock

* switched to clipboard component

* tweaks to CodeSnippet

* padding tweaks

* updated package-lock

* updated package-lock

* fixed z-index for modal in logs-viewer

* select -> Select

Co-authored-by: Kiran <kiran@boxyhq.com>
Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com>
2022-12-30 17:02:16 +00:00
Kiran K 17161de3d4
Setup links tweaks (#788)
* Update

* Add verification to the setup link to ensure it is valid and not expired before allowing the user to continue.

* cleanup

* Tweaks to setup links

* Remove the unnecessary conditions from DirectoryTab

* Add the missing translation in CreateSetupLink

* Invoke the mutate at the beginning

* Remove unused type

* Remove another unused type

* Make the description optional in Modal and add ModalProps

* Adjust the input border radius

* Display setup link after the setup link is regenerated

* Display setup link info

* Remove the existing setup link if regenerate is true

* show expired date in red

* standardised View icon

Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com>
2022-12-30 13:43:50 +00:00
Kiran K da7fffdafd
Fix pagination and other UI issues (#781)
* Update

* Fix the sidebar active state

* Add back button to the missing pages

* Use the translation keys

* Fix the type

* Remove old pagination component

* Fix the pagination for SSO connections

* Change the extension to .ts

* Add pagination to the directories listing

* Add the space between the buttons

* Add pagination for SAML Federation Apps

* Add missing pagination

* Fix the back buttons

* Add the pagination for webhook events

* Tweaks

* Fix the issue

* Fix the tests

* Fix the failing tests

* Fix the failing tests

* added hover state for table rows

* aligned SAML federation page with rest

* optimised imports from heroicons

Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com>
2022-12-28 16:29:45 +00:00