GEOLYTIX / xyz

An open source javascript framework for spatial data and application interfaces.
MIT License
88 stars 26 forks source link

saml2 optional dependency. #1760

Closed RobAndrewHurst closed 2 days ago

RobAndrewHurst commented 4 days ago

saml2 optional dependency (Export & warning)

The saml.js module will no longer show a warning if the package saml2-js package is not installed. It will only do so by assessing if ther are any SAML_* process.env keys present and if the pacakge is not installed.

  //Check if there are any SAML keys in the process.
  const samlKeys = Object.keys(process.env).filter(key => key.startsWith('SAML'));

  //If we have keys then log we that the module is not present
  if (samlKeys.length > 0) {
    console.log('SAML2 module is not available.')
  }

It will also export the module as null if the package is not installed.

GitHub Issue

#1732

dbauszus-glx commented 2 days ago

@RobAndrewHurst logger jwt require can be after saml require. No need to check and bundle if not required. https://github.com/GEOLYTIX/xyz/pull/1760/commits/26e517e7aa59189790346ec70810f19525515069

sonarcloud[bot] commented 2 days ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud