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

Fix #139 strictSsl: false option being ignored #146

Merged
merged 2 commits into from
Jun 17, 2020

Conversation

kopancek
Copy link
Contributor

@kopancek kopancek commented Jun 15, 2020

Description

Fixed a bug, when passing in strictSsl: false option, it was ignored because of bad boolean logic handling in the request wrapper.

References

fixes #139

Testing

Unit tested locally.

  • 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 master

@kopancek kopancek changed the title Fix #139 strictSsl: false option being ignored Fix #139 strictSsl: false option being ignored Jun 15, 2020
@kopancek kopancek marked this pull request as ready for review June 15, 2020 15:00
@kopancek kopancek requested a review from a team June 15, 2020 15:00
@kopancek
Copy link
Contributor Author

As far as I have seen, the tests were already failing on master locally without my changes. Not sure why.

lbalmaceda
lbalmaceda previously approved these changes Jun 16, 2020
Copy link
Contributor

@lbalmaceda lbalmaceda left a comment

Choose a reason for hiding this comment

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

LGTM.
The tests on master seem to have passed correctly for the last time 2 months ago, according to this https://circleci.com/gh/auth0/node-jwks-rsa/45. I imagine it could be related to the node engine version, or maybe invalid packages being installed. Let me know if you need help to figure that out and I'll reach out to my team.

@lbalmaceda
Copy link
Contributor

I just cloned the repo locally and ran the tests on master. Everything looking good here @kopancek

My node version is 12.9.1 (~LTS)

@adamjmcgrath
Copy link
Contributor

Hi @kopancek

Can you move your axios stub into a before. If you stub axios at import time it will leak into tests that run before the request.test.js file is executed. (you can do this in jest, but not mocha)

Changing requests.test.js to:

describe('Request wrapper tests', () => {

  const uri = 'https://foo/bar';
  let originalAxiosRequest;

  before(() => {
    originalAxiosRequest = axios.request;
    const mockedAxiosRequest = (options) => {
      return Promise.resolve(options);
    };
    axios.request = mockedAxiosRequest;
  });

  after(() => {
    axios.request = originalAxiosRequest;
  });

Should fix the build

@kopancek
Copy link
Contributor Author

Hi @kopancek

Can you move your axios stub into a before. If you stub axios at import time it will leak into tests that run before the request.test.js file is executed. (you can do this in jest, but not mocha)

Changing requests.test.js to:

describe('Request wrapper tests', () => {

  const uri = 'https://foo/bar';
  let originalAxiosRequest;

  before(() => {
    originalAxiosRequest = axios.request;
    const mockedAxiosRequest = (options) => {
      return Promise.resolve(options);
    };
    axios.request = mockedAxiosRequest;
  });

  after(() => {
    axios.request = originalAxiosRequest;
  });

Should fix the build

I just noticed the same, the CI should now pass.

@lbalmaceda lbalmaceda merged commit ff2aeb4 into auth0:master Jun 17, 2020
@lbalmaceda lbalmaceda added this to the v1-Next milestone Jun 18, 2020
@lbalmaceda lbalmaceda modified the milestones: v1-Next, 1.8.1 Jun 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

strictSsl ignored after switch to Axios
3 participants