eBay / ebay-font

A small utility to efficiently load custom web fonts
MIT License
175 stars 19 forks source link

Support nonce attribute for lasso #29

Closed abiyasa closed 6 years ago

abiyasa commented 6 years ago

Support nonce attribute for Content Security Policy using lasso-nonce (see https://github.com/lasso-js/lasso#content-security-policy-support).

This is a simple implementation to support issue https://github.com/eBay/ebay-font/issues/28, if lasso has its cspNonceProvider configured properly, it will inject nonce value automatically.

RajaRamu commented 6 years ago

@abiyasa - can you please fix the build issue?

abiyasa commented 6 years ago

Sorry about this, I will have a look.

However, I just checkout locally the ebay-font master branch & then did a fresh npm install. When I try to do npm test, the test failed with the same reason: Cause: Error: Plugin module not found for "lasso-require".

I'm not sure what's going on, it could be one of the dependencies starts introducing lasso-require. Do you mind trying to run npm test on master branch and see if you got the same problem? Thanks!

abiyasa commented 6 years ago

I think I know why the build failed.

Lasso 3 has been released 12 days ago and it causes breaking changes on every new builds. I will see what I can do about this, otherwise, we could stick to lasso 2 for a while.

RajaRamu commented 6 years ago

@abiyasa - please let me know if you need any help!

abiyasa commented 6 years ago

Thanks @RajaRamu!

The problem was karma-lasso not working with lasso 3, but we nearly solve that issue. Once the new karma-lasso published, we can re-run the travis build and hopefully the test will pass.

abiyasa commented 6 years ago

I updated the package.json to pick up the latest karma-lasso. Now the builds are green

abiyasa commented 6 years ago

@RajaRamu Do you mind checking again if this PR is OK to merge? Thanks

abiyasa commented 6 years ago

@RajaRamu Thanks for merging the PR. Do you know when will this changes get published?