Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Node 18 + qs dependency fixes for Snyk #249

Merged
merged 20 commits into from
Jan 5, 2024

Conversation

lostinauth0
Copy link
Contributor

@lostinauth0 lostinauth0 commented Jun 21, 2023

By submitting a PR to this repository, you agree to the terms within the Auth0 Code of Conduct. Please see the contributing guidelines for how to create and submit a high-quality PR for this repo.

Description

This PR upgrades AD LDAP Connector to run on Node 18.
It also fixes some dependencies to take care of Snyk reported issues with the qs package

References

https://app.snyk.io/org/auth0-dir-services/project/db89091f-ee88-4ba3-9cb9-7723b9ad6fdf (search for qs)
https://auth0team.atlassian.net/browse/IUM-2445

Testing

Connector was run and tested against openldap in Vivaldi.
https://oktawiki.atlassian.net/wiki/spaces/~604ed65660d39e006f457fc5/pages/2847250039/IUM-2445+-Upgrading+AD-LDAP+connector+to+Node+18+and+fixing+SEC+issues

  • [✅ ] This change adds test coverage for new/changed/fixed functionality

Checklist

  • [✅ ] I have added documentation for new/changed functionality in this PR or in auth0.com/docs
  • [✅ ] All active GitHub checks for tests, formatting, and security are passing
  • [✅ ] The correct base branch is being used, if not the default branch

@lostinauth0 lostinauth0 requested a review from a team as a code owner June 21, 2023 18:30
Copy link

@pnkrishnamurthy-okta pnkrishnamurthy-okta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

.env.vivaldi.sample Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
admin/server.js Show resolved Hide resolved
@pnasc-ok pnasc-ok self-requested a review August 1, 2023 21:59
@pnasc-ok pnasc-ok dismissed their stale review August 1, 2023 21:59

Need to make an edit

@pnasc-ok pnasc-ok removed their request for review August 1, 2023 22:00
package.json Outdated Show resolved Hide resolved
.env.local.sample Outdated Show resolved Hide resolved
admin/server.js Outdated Show resolved Hide resolved
Copy link
Contributor

@gausnes gausnes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we update .nvmrc?

connector-setup/index.js Outdated Show resolved Hide resolved
@@ -14,6 +15,10 @@ const HEARTHBEAT_QUERY_TIMEOUT_MS = 5000;
const HEARTBEAT_DELAY_MS = nconf.get('LDAP_HEARTBEAT_SECONDS') * 1000

function createConnection () {
// Resolve using IPv4 first. This lets us continue to use localhost
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

node18

"engines": {
"node": "^12.19"
"node": "^18.16.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

node18

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like I've noted this before, but I think still allowing older versions would allow for an easier update path. Does this work with 12 / 16, etc? If so, maybe leaving this line alone for the time being would avoid a major version.

nconf.set('LAST_SENT_THUMBPRINT', getCurrentThumbprint(workingPath));
nconf.set('TENANT_SIGNING_KEY', response.data.signingKey || '');

console.log(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a new console log thats added?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No this is from below https://github.com/auth0/ad-ldap-connector/pull/249/files#diff-ddc0f03695a62f6303846c3dd87809c9035df116b5d81e7f143472b0067fe901L65 -- some of this stuff was moved around because of how error handling works in axios

@@ -1,12 +1,15 @@
{

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we also need to update https://github.com/auth0/ad-ldap-connector/blob/master/.nvmrc to reflect node 18?

"test": "NODE_TLS_REJECT_UNAUTHORIZED=0 mocha --timeout 50000 --reporter spec --exit",
"snyk": "snyk test",
"start": "node server.js"
"start": "node server.js",
"start-local": "source .env && npm run start"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is at least an unexpected pattern to me, I've typically used the language's dotenv project to load a .env

package.json Outdated
@@ -1,12 +1,15 @@
{
"name": "ad-ldap-connector",
"version": "6.1.8",
"version": "6.1.9",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are forcing Node18, this should be a major version bump imo. I'd personally like to avoid that if possible for ease of customer updating.

Seems like this would at least be a minor version bump as support for a new runtime is being added.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are no longer forcing Node 18 -- just making sure it runs on Node 18.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would still say that this is a minor version bump, multiple packages are being updated.

bernardwolff
bernardwolff previously approved these changes Nov 15, 2023
@bernardwolff
Copy link

Minor nit: Would be nice to have formatting changes in a separate PR for ease of review.

package.json Outdated
@@ -1,6 +1,6 @@
{
"name": "ad-ldap-connector",
"version": "6.1.9",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be nice to have this happen automatically

@lostinauth0 lostinauth0 merged commit 0c33642 into master Jan 5, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants