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

Support HTTP endpoints #26

Open
tfmorris opened this issue Jan 12, 2021 · 4 comments
Open

Support HTTP endpoints #26

tfmorris opened this issue Jan 12, 2021 · 4 comments

Comments

@tfmorris
Copy link
Member

In Chrome 87, even allowing "insecure content" for the test bench site, doesn't allow reconciliation services which are served over HTTP to be tested. It would be nice to figure out a way around this without having to go around and implement CORS and/or HTTPS everywhere, but I'm not sure what the options are.

Possibilities?:

  • Serve a version of the test bench over HTTP
  • Load manifest as pure JSON to be parsed safely without JSONP callback eval

As an aside, one of the sites doesn't appear to support JSONP or CORS http://openup.nhm-wien.ac.at/commonNames/?callback=foo returns pure JSON with no callback function wrapper.

@wetneb
Copy link
Member

wetneb commented Jan 12, 2021

It would be nice!

  • Serve a version of the test bench over HTTP

Unfortunately I don't think GitHub pages allows that, so we'd need another host.

  • Load manifest as pure JSON to be parsed safely without JSONP callback eval

Such calls will be blocked by the cross-origin policy unless the service supports CORS. And as far as I can tell HTTP only sites are blocked via both CORS and JSONP for me anyway (with Firefox).

@gitonthescene
Copy link

This still might be useful if you're running the test bench locally. Perhaps it could be conditioned on that.

But maybe this is not meant as a test suite when developing reconciliation services. Is it? If not, then testbench might be a bit misleading. I was lead here by someone trying to test a service built with my code still worked.

FWIW, I tried running this locally per the README and got the following:


Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (/private/tmp/testbench/node_modules/webpack/lib/util/createHash.js:90:53)
    at NormalModule._initBuildHash (/private/tmp/testbench/node_modules/webpack/lib/NormalModule.js:401:16)
    at handleParseError (/private/tmp/testbench/node_modules/webpack/lib/NormalModule.js:449:10)
    at /private/tmp/testbench/node_modules/webpack/lib/NormalModule.js:481:5
    at /private/tmp/testbench/node_modules/webpack/lib/NormalModule.js:342:12
    at /private/tmp/testbench/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/private/tmp/testbench/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at iterateNormalLoaders (/private/tmp/testbench/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
    at /private/tmp/testbench/node_modules/loader-runner/lib/LoaderRunner.js:236:3
    at runSyncOrAsync (/private/tmp/testbench/node_modules/loader-runner/lib/LoaderRunner.js:130:11)
    at iterateNormalLoaders (/private/tmp/testbench/node_modules/loader-runner/lib/LoaderRunner.js:232:2)
    at Array.<anonymous> (/private/tmp/testbench/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
    at Storage.finished (/private/tmp/testbench/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:43:16)
    at /private/tmp/testbench/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:79:9
/private/tmp/testbench/node_modules/react-scripts/scripts/start.js:19
  throw err;
  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (/private/tmp/testbench/node_modules/webpack/lib/util/createHash.js:90:53)
    at NormalModule._initBuildHash (/private/tmp/testbench/node_modules/webpack/lib/NormalModule.js:401:16)
    at /private/tmp/testbench/node_modules/webpack/lib/NormalModule.js:433:10
    at /private/tmp/testbench/node_modules/webpack/lib/NormalModule.js:308:13
    at /private/tmp/testbench/node_modules/loader-runner/lib/LoaderRunner.js:367:11
    at /private/tmp/testbench/node_modules/loader-runner/lib/LoaderRunner.js:233:18
    at context.callback (/private/tmp/testbench/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
    at /private/tmp/testbench/node_modules/babel-loader/lib/index.js:51:103 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.0.0
➜  testbench git:(master) ✗ 

The workaround here seemed to fix it.

FWIW, I'm running on OSX 12.0.1 with npm version 8.6.0.

@wetneb
Copy link
Member

wetneb commented Sep 8, 2022

This still might be useful if you're running the test bench locally. Perhaps it could be conditioned on that.

When running the test bench locally (or any deployment that uses HTTP), HTTP endpoints should be supported.

But maybe this is not meant as a test suite when developing reconciliation services. Is it?

It is. Also, the HTTPS deployment we offer should also work with endpoints such as http://localhost:8000/reconcile, unless I am mistaken. Therefore I would say it deserves its name.

FWIW, I tried running this locally per the README and got the following

Thanks for reporting! It would be worth opening a new issue about this, because I think this is unrelated to this issue.

@gitonthescene
Copy link

Okay. I'll open a new issue. I don't believe using http:// locally worked for me but maybe I got distracted by a warning pop up. I'll try again and mention it in the new issue if it's a problem.

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

No branches or pull requests

3 participants