Socket
Socket
Sign inDemoInstall

onedionys-content-security-policy-generator

Package Overview
Dependencies
724
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    onedionys-content-security-policy-generator

One Dionys (Content Security Policy Generator) - A utility for generating and deploying content security policies in web applications, improving application security.


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Welcome to One Dionys - Content Security Policy Generator! 👋

A utility for generating and deploying content security policies in web applications, improving application security. 💖

💾 Requirements

  • Web Browser - Can be used as an emulator to build applications. Example [Chrome, Firefox, Safari & Opera].
  • Internet - Because many use CDN and to make it easier to find solutions to all problems.

🎯 How To Use

Example Syntax
const generateCSP = require('content-security-policy-generator');

const options = {
    defaultSrc: ["'self'"],
    scriptSrc: ["'self'", 'example.com'],
    // Add more directives as needed
};

const cspHeader = generateCSP(options);
console.log(cspHeader);
Explanation
  • The generateCSP function takes an options object containing various directives for configuring the CSP. Each directive corresponds to a different aspect of web content security, such as allowed sources for scripts, styles, images, etc. The function then constructs a CSP header string based on these options and returns it.
Return Value
  • The function returns a string representing the Content Security Policy header that should be included in HTTP responses to instruct browsers on how to handle various types of content.

📆 Release Date

  • v1.0.0 : 17 March 2024
  • v1.0.1 : 18 March 2024
  • v5.0.0 : 31 March 2024

🧑 Author

  • Facebook : Oned Ionys
  • Instagram : @onedionys
  • Twitter : @onedionys
  • LinkedIn : @onedionys

📝 License

  • Copyright © 2024 One Dionys
  • One Dionys - Content Security Policy Generator is an open source project licensed under the MIT license

☕️ Suppport & Donation

Love One Dionys - Content Security Policy Generator? Support this project by donating or sharing with others in need.

Made with ❤️ One Dionys

Keywords

FAQs

Last updated on 31 Mar 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc