Commit Graph

26 Commits

Author SHA1 Message Date
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 04ed6e4707
Fix router push in dsync/sso listing (#2400)
Fix router push
2024-03-07 10:22:48 +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
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
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
dependabot[bot] c30adc7591
Bump prettier from 3.0.3 to 3.1.0 (#1923)
* Bump prettier from 3.0.3 to 3.1.0

Bumps [prettier](https://github.com/prettier/prettier) from 3.0.3 to 3.1.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.0.3...3.1.0)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* fixed format

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com>
2023-11-13 13:25:02 +00: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
Deepak Prabhakara 9154d3a7af
Dynamodb support (#980)
* added dynamodb-local to docker-compose

* [WIP] Add DynamoDB data source (#947)

wip

Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com>

* WIP

* fixed put, get and delete

* store secondary index

* implemented getAll and delete

* revert changes to test file

* revert test script changes

* added dynamodb-local for testing

* WIP: pagination for DynamoDB

* dynamodb pagination cannot take offset and limit

* fixes for the change from Array to Records type so we can handle pageToken for DynamoDB

* fixed github actions

* trying options instead of command

* try default dynamodb-local command

* lint

* region for dynamodb

* added dummy aws creds

* lint

* getAll can be paginated using pageLimit

* tweaked comments

* Track `pageToken` with `pageOffset`.

* Track the (next)pageToken with offset

* Use the pageToken (from prev page) to get the connection list

* Comment

* Pass along the pageToken

* Type fix

* Relay the `pageToken` header to the response

* Update type for SWR ApiSuccess data

* Remove `marshall`

* Support pageToken for DS

* Support pageToken for SAML Fed

* Fix test

* Support pageToken for SAML Tracer

* Fix test

* Fix test for tracer

* Remove `marshall` in getByIndex

* Support `pageToken` for SetupLinks

* added dynamodb dev script

* move dynamodb options to it's own namespace

* added config for read/write capacity units

---------

Co-authored-by: Michael McDermott <michael.g.mcdermott@gmail.com>
Co-authored-by: Aswin V <vaswin91@gmail.com>
2023-03-16 21:42:36 +00:00
Kiran K cb549aa102
add friendly mappings to well known Providers (#860)
* display toast and adjust the width of the content

* Add friendly mappings to well known Providers

* ignore the OIDC connections in transformConnections

* Update utils.ts
2023-01-20 15:59:13 +00:00
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
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
Kiran K 656bd8712b
Use the new `isLoading` state from `useSWR` to show the loading indicator (#805)
* Update

* Use the new isLoading state from useSWR 2.0 to show a loading indicator

* fixed Allow headers

Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com>
2023-01-05 01:28:21 +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
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
Deepak Prabhakara fbe328b1eb better hover color for icon buttons 2022-12-29 23:46:05 +00:00
Kiran K 4e10d501ea
Standardize the setup link feature (#784)
* Tweaks to NewSetupLink

* Standardize the setup link feature

* Fix the connection APIs

* Standardize the Setup Link + Directory sync

* Tweaks to components

* Move the directory listing to a components

* Tweaks to connectons

* Updates connections page

* Make variable naming consistent

* Standardize the page export

* Remove unnecessary named export from API handler
2022-12-29 19:01:50 +05:30
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
Kiran K c2a2a4cab2
Tweaks core components (#779)
* Fix the types for button components

* Fix the types for link components

* Remove type any

* Add space between the buttons

* Import types and other tweaks
2022-12-27 18:06:23 +05:30
Kiran K 86838115b6
Standardize "copy to clipboard" button (#768)
* Standardize copy to clipboard button

* Add copy button to SCIM endpoint and token

* Fix the clipboard button

* Add missing translation

* Cleanup

* Fix the property

* Tweaks

* Fix: update the defaultValue on state changes

* tweaks to links

Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com>
2022-12-27 00:26:58 +00:00
Deepak Prabhakara 18a4beae35
Switch to react-daisyui (#750)
* trying react-daisyui

* build fix

* switched Link to LinkPrimary and Button

* created Pagination component (TODO: Need to align Paginate and Pagination components

* switched from <button> to Button

* added LinkOutline

* more instances where LinkOutline can be used

* created ButtonBack and LinkBack components

* switched to ButtonOutline, ButtonPrimary and ButtonDanger

* Button -> ButtonBase

* <button> -> ButtonPrimary

* reuse props for button and link

* switched react-hot-toast with daisyui toast

* standardised an IconButton

* tweaks to hover

* switched from ButtonBack to LinkBack
2022-12-20 17:18:58 +00:00
Deepak Prabhakara 9611cf4a71
Tweaking SAML federation metadata url (#749)
* updated deps

* - validate tenant, product during setup link creation
- tweaked copy to clipboard icon
- tweaked error toast

* fixed toast durations

* moved idp configuration page and idp metadata url to .well-known path
2022-12-18 21:13:12 +00:00
Deepak Prabhakara 915c7c09d2
Fixed edit view for sso connections (#748)
* fixed edit view for sso connections

* allow name and description to be unset

* fixed fallback to provider if name is empty for oidc connections

* fixed React warning - "A component is changing an uncontrolled input to be controlled."

* better fix for react warning
2022-12-16 12:31:02 +00:00
Utkarsh Mehta 0642e73478
JumpCloud related changes (#649)
* Share setup link related changes
1. Setup link creation for saml connection
2. Setup link creation for Directory sync
3. Regeneration of Setup link
4. Ability to open setup link without login
5. Setup link opens up SAML connection page
6. Saml Connection page hides Tenant & Product fields

* Saving SAML and OIDC configuration

* showing the connection list on setup page

* Connections CRUD

* UI changes for Setup layout

* semantics changes connection ->  sso-connection

* directory sync support for share link

* showing only current tenant product directories

* fixes mentioned in commnets by Aswin

* prettier formatting

* 1. checking entityID against existing configs
2. Failing saml config creation if tenant/product does not match
with existing config with same entityID
3. returning boxyhqEntityID with saml config
which is combination of SAML_AUDIENCE env variable & clientID

* fixed route

* minor fixes

* reverting connection get api changes

* added getEntityID api added

* getEntityID api added

* Fix the layout rendering for the /setup routes

* showing entityID on setup page
added api to getEntityID under setup

* handling jumpcloud case for validation

* minor fixes

* Bump up @boxyhq/saml20 version

* review changes

* package lock changes

* package json and lock changes

* removed xmlbuilder

* package lock changes

* removed api call from ConnectionList component

* Back button link fix

* test fixes

* intermediate changes for Setup link list feature

* setup link list related changes

* UI fixes and actions

* removed unwanted import

* setup link list action hooked with correct functions

* path rewrites, styling changes, toast
regenerate & delete setup links

* fixes for mutate

* fixed samlAudience

* minor tweaks to clipboard icon

* minor tweaks to clipboard icon

* updated package-lock

* updated package-lock

* formatting changes

* formatting changes

* removed console log

* Added cusor pointer for action for LinkList component
Removed unused variable & validation of empty token
Removed redundent validation code
linting fixes

* Auto redirect in setup link page for sso-connection create form
Delete icon on setup link list page on hover red color & tooltips

* removed redirect and used isValidating

* fixes for router replace

* toast for setup links

* fixes for dsync apis

* redirect related change

* removing redirect for sso-connection

* fallback to error.message

* casting changes for boxyhqEntityID

* showing IDP Entity Id on create sso-connection page
Rename entityId to IDP entity id

* text tweak

* converted string to translations

* fixed unique key warning for lists

* added description for setup link

* aligned API calls to return the same consistent structure

* fixed build

* fixed api structure

Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com>
Co-authored-by: Kiran <kiran@boxyhq.com>
2022-12-15 12:39:18 +00:00
Utkarsh Mehta 6e5e804d38
Setup Link Feature (#628)
* Share setup link related changes
1. Setup link creation for saml connection
2. Setup link creation for Directory sync
3. Regeneration of Setup link
4. Ability to open setup link without login
5. Setup link opens up SAML connection page
6. Saml Connection page hides Tenant & Product fields

* Saving SAML and OIDC configuration

* showing the connection list on setup page

* Connections CRUD

* UI changes for Setup layout

* semantics changes connection ->  sso-connection

* directory sync support for share link

* showing only current tenant product directories

* fixes mentioned in commnets by Aswin

* prettier formatting

* fixed route

* minor fixes

* Fix the layout rendering for the /setup routes

* minor fixes

* review changes

* package lock changes

* package json and lock changes

* removed xmlbuilder

* package lock changes

* removed api call from ConnectionList component

* Back button link fix

* intermediate changes for Setup link list feature

* setup link list related changes

* UI fixes and actions

* removed unwanted import

* setup link list action hooked with correct functions

* path rewrites, styling changes, toast
regenerate & delete setup links

* fixes for mutate

* minor tweaks to clipboard icon

* updated package-lock

* formatting changes

* removed console log

* Added cusor pointer for action for LinkList component
Removed unused variable & validation of empty token
Removed redundent validation code
linting fixes

* Auto redirect in setup link page for sso-connection create form
Delete icon on setup link list page on hover red color & tooltips

* removed redirect and used isValidating

* fixes for router replace

* toast for setup links

* fixes for dsync apis

* redirect related change

* removing redirect for sso-connection

* fallback to error.message

Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com>
Co-authored-by: Kiran <kiran@boxyhq.com>
2022-12-13 21:41:27 +00:00
Renamed from pages/admin/connection/index.tsx (Browse further)