Coder Social home page Coder Social logo

ketsappi / strict-csp-with-suomifi-ui-components Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 816 KB

Minimal React Setup with strict CSP and suomifi-ui-components

License: MIT License

JavaScript 84.13% HTML 15.87%
csp react-helmet react nonce uuid content-security-policy webpack

strict-csp-with-suomifi-ui-components's Introduction

Minimal React Setup

Minimal React Setup to run suomifi-ui-components in strict CSP with the help of nonce.

⚡️ Quick Start

  • To install required dependencies, build and serve it: yarn start:fresh
  • Open your browser at localhost:5000.

✨ Features

🚔 Content-Security-Policy

Content-Security-Policy is set to be quite finicky and not allowing too much.

<meta
    http-equiv="Content-Security-Policy"
    content="default-src 'none'; base-uri 'self'; object-src 'none';
    script-src 'self' 'nonce-xxx'; style-src 'self' 'nonce-xxx';
    font-src 'self'; connect-src 'self'; img-src 'self';"
/>

🚪 nonce

In the meta-tag the nonce-xxx has the xxx replaced with the generated value.

You should handle the nonce generation based on your own setup. The simple example of this project is not maybe the way-to-go.

If you serve your application with node.js, you can e.g use helmet-csp You can read more about the CSP from their docs: https://helmetjs.github.io/docs/csp/

📄 Licensing

MIT LICENSE

strict-csp-with-suomifi-ui-components's People

Contributors

ketsappi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.