Commit Graph

34 Commits

Author SHA1 Message Date
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 47a12d269f
Enable server sourcemaps (#2242)
* add sourcemaps for server code

* leave dev config alone
2024-02-01 17:28:29 +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 4cf38d9f86 hide webpack warning 2024-01-11 14:25:24 +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
Deepak Prabhakara 7f6bb09000
added sts, xframe and xcontenttype headers (#1950) 2023-11-18 21:30:29 +00:00
Deepak Prabhakara 97701adc70
updated to next 14 (#1860)
* updated to next 14

* updated daisyui

* turn off esmExternals
2023-10-29 00:34:56 +01:00
Kiran K ffba1ea42e
Add new API paths `/api/v1/sso` and `/api/v1/dsync` (#1375)
* wip

* Rename folders

* Rename folders

* sso paths changed

* dsync paths changed

* Revert

* update Swagger specs
2023-07-31 22:49:27 +05:30
dependabot[bot] 389ca93cce
Bump pg from 8.10.0 to 8.11.0 in /npm (#1189)
* Bump pg from 8.10.0 to 8.11.0 in /npm

Bumps [pg](https://github.com/brianc/node-postgres/tree/HEAD/packages/pg) from 8.10.0 to 8.11.0.
- [Changelog](https://github.com/brianc/node-postgres/blob/master/CHANGELOG.md)
- [Commits](https://github.com/brianc/node-postgres/commits/pg@8.11.0/packages/pg)

---
updated-dependencies:
- dependency-name: pg
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* ignore cloudflare:socket lib in webpack

---------

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-06-13 23:07:55 +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 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 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 2291549333
cleaned up experimental flag and node-fetch (#790)
cleaned up experimental flag and node-fetch (next.js has fixed the issue in middleware which prevented payloads > 16kb)

Co-authored-by: Kiran K <kiran@boxyhq.com>
2022-12-30 13:41:30 +00:00
Kiran K fb1c504222
Tweaks to well-known links listing page (#765)
* wip

* Move the links to /well-known and update the UI

* Infer the props type

* localised strings

* switched to LinkOutline

Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com>
2022-12-23 22:43:04 +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
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
Deepak Prabhakara ffdfec41bb Revert "turn off undici lib in next.js"
This reverts commit 437b8b32cc.
2022-11-28 15:48:29 +00:00
Deepak Prabhakara 437b8b32cc turn off undici lib in next.js 2022-11-28 14:42:24 +00:00
Deepak Prabhakara cf68288347
enable sourcemaps (#701) 2022-11-24 21:27:02 +00:00
Kiran K 6adb642266
Use a global certificate instead of a per tenant/product certificate (#667)
* Replace Admin UI with Admin Portal

* Create a default certificate

* Use the default certs instead of per connection certificate

* Revert the changes

* refactored to encapsulate all logic inside x509.ts

* added certs to sp-metadata

* Cache the certificate before return

* Fix the type

* added expiry check to cached certificate

* added url to download public cert

* added instructions to encrypt assertion

* bumped up version

Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com>
2022-11-10 21:38:06 +00:00
Deepak Prabhakara e81de5cc9f
I1/mssql (#666)
* mssql support

* added mssql container for testing

* added migration scripts for mssql

* added mssql to dev docker-compose
2022-11-09 22:27:11 +00:00
Deepak Prabhakara c98b41341f
use undici instead of fetch (#662)
* use undici instead of fetch

* updated alpine
2022-11-08 00:29:26 +00:00
Deepak Prabhakara 57bc276e3e silenced "Critical dependency: the request of a dependency is an expression" warning 2022-11-05 00:05:42 +00:00
Deepak Prabhakara 4d313f71b6 added more peer deps of typeorm to ignore list 2022-11-04 23:51:03 +00:00
Deepak Prabhakara 584fb4a3e9 renamed route 2022-10-29 14:21:30 +01:00
Deepak Prabhakara 76cd8b73b9
URL for SPSSODescriptor (#635)
* use PRE_LOADED_CONNECTION instead of PRE_LOADED_CONFIG

* added endpoint to return sp metadata for use with federated systems like OpenAthens

* removed md prefix
2022-10-28 20:19:31 +01:00
Nafees Nazik 05eeb7f491
feat: add i18n internationalization (#560)
* chore: add next-i18next

* feat: add i8n-config

* feat: i18n config to next config

* feat: wrap app with the appWithTranslation

* feat: add initial dummy translation

* chore: pin version

* feat: add translation

Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com>
2022-10-08 18:54:43 +01:00
Nafees Nazik 8ccdcdcb86
fix: reduce docker image size (#557)
* feat: enable standalone output

* feat: update docker file

* fix: alias as base and pin node version

* fix: copy npm folder

* fix: install sharp

* build: update docker ignore

* fix: remove sharp from docker file

* fix: remove asteriks

* feat: add max http header size env

* fix: remove copy npm folder
2022-10-08 18:23:27 +01:00
Kiran K 45d116ddf5
Add a web page to display SP's Config details (#422)
* Merged

* Revert the changes

* Update package-lock.json

* Add the web page to display the SP's Config

* Commit changes to package-lock.json

* rewrite route so the path is `/.well-known/saml-configuration`

* added back @opentelemetry/api

* downgraded @opentelemetry/resources

* pin "@opentelemetry/resources": "1.0.1"

* Replace the getStaticProps with getServerSideProps

Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com>
2022-09-07 15:20:06 +01:00
Aswin V 9b23eed3e3
Support for OIDC flow (#306)
* Support 'POST' at authorization endpoint

* handle additional scope params

* handle additional claims param

* Try with `legacy-peer-deps` true

* Fix logic

* Set legacy-peer-deps to `true`

* Remove `.npmrc` files and sync packages from main

* Resolve conflicts

* Load jwtSigningKeys into env

* Return id_token for OIDC flow

* Support `nonce`

* Add type for `nonce`

* Set `nonce` only if present in request

* Expose OpenId provider metadata

* Update metadata

* Tweak path remove dot, map jwks

* Add jwsAlg and source keys using base64

* Source jose from root package.json too

* JWS utils

* Serve jwks_uri

* Load private key for signing

* Fix authz endpoint

* Format example env

* Fix claims

* Format discovery and add missing metadata

* Include the basic profile in id_token

* Fix claims access

* Remove console log

* Sync package lock

* Cleanup

* Support for claims is optional

* cleanup type

* Set `Content-Type` header

* Remove default from env

* Handle jwt env

* oidc fixture

* Test for oidc flow, check id_token in response

* Add jwt envs

* Fix for undefined

* Remove keys check in controller init

* Runtime check for JWS keys

* check if id_token is absent

* Check for claims and verify signature

* Snapshot test oidc discovery page

* Add snapshot for linux to work in CI

* Test with a fontless screenshot

* test with this one

* add a debug step

* Get the entire dir for snapshot

* Test with this

* Comment out debug step

* snapshot test jwks

* Update env

* Upload screenshot for linux

* Add debug step

* Update snapshot

* Sync package lock

* Remove local testing snapshots

* Assert using api request

* Update to use api test for jwks endpoint

* Set `JWS_ALG` env

* Prefix openid vars

* Fix env access

* Fix e2e test

* Fix options in tests

* Fix env var access

* Use ttl from env

* Simplify exp value setting

* oidc discovery controller

* Fix typing

* Handle case where signing keys are not set

* return `oidcDiscoveryController`

* Throw a JacksonError like object

* Use controllers and cleanup

* throw JacksonError like object

* Minor formatting

* Fix typing and add check for undefined

* Keep order of packages same as in main

* Update key generation comment

* Initialise `openid` correctly in npm

* Cleanup

* Set `sub` claim

* Set 'sub' only for oidc flow
2022-07-23 18:04:55 +01:00
Deepak Prabhakara 3b64c6de3f - updated next-auth
- ignore aws4 plugin for typeorm
2022-03-22 19:13:36 +00:00
Deepak Prabhakara 74c8797048 removed filterwarnings plugin, it's old and unmaintained 2022-02-22 20:56:17 +00:00
Deepak Prabhakara b4138012c0 fixed webpack warnings for typeorm 2022-02-16 02:01:22 +00:00
Deepak Prabhakara 3754f2b13d
Next.js service (#53)
* moved jackson-next to this repo

* fixed working-directory

* updated package-lock

* fixed docker build

* fixed dockerfile

* cleanup

* save npm version for use in the build step

* switching the order

* fixed env secret

* update saml-jackson to the current version before building the next.js service

* build from typescript and change main and types before publishing npm

* copy README.md from root before publishing npm

* update README only for prod versions

* read version from root package.json file

* fixed artifact

* updated package-lock
2022-01-05 12:09:51 +00:00