Download the PHP package iwf-web/json-request-check-bundle without Composer

On this page you can find all versions of the php package iwf-web/json-request-check-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package json-request-check-bundle

IWF JSON Request Check Bundle

This Symfony bundle protects against HashDos attacks by limiting the size of JSON requests.

Project

License Version Version (including pre-releases) Downloads on Packagist Required PHP version

Getting Started

These instructions will help you install this library in your project and tell you how to use it.

Prerequisites

Installing

Step 1: Install Package

Step 2: Register Bundle (Symfony < 5.0)

For Symfony versions before 5.0, you need to manually register the bundle in your config/bundles.php:

Configuration

Create a configuration file at config/packages/iwf_json_request_check.yaml:

Alternatively, you can define the default value as an environment variable in your .env file:

and then use it in your configuration file:

To have a clue about size you can find a file with a JSON of 4kb in the examples: example-payload-4kb.json

Usage

Add the Attribute to Controller Methods

How It Works

  1. When a JSON request is sent to your controller, the JsonRequestCheckSubscriber checks the size of the request.
  2. If the size exceeds the value specified in the JsonRequestCheck attribute, an HTTP 413 (Payload Too Large) Exception is triggered.
  3. If no specific value is provided for the route, the global default value from the configuration is used.

Error Messages

When a request exceeds the allowed size, an HTTP 413 response is automatically returned with the message "JSON payload too large" along with details about the received size and maximum allowed size.

Local Development Setup

Installing Development Tools

This project uses PHIVE for managing PHP development tools. Follow these steps to set up your local development environment:

Step 1: Install PHIVE

Step 2: Install Development Dependencies

Running Code Quality Checks

PHP-CS-Fixer (Code Style)

Check code style violations:

Fix code style violations automatically:

PHPStan (Static Analysis)

Run PHPStan analysis:

Generate PHPStan baseline for existing issues:

Development Workflow

Before committing your changes, ensure all checks pass:

Built With

Contributing

Please read CONTRIBUTING.md for the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

All the authors can be seen in the AUTHORS.md file.

Contributors can be seen in the CONTRIBUTORS.md file.

See also the full list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.txt file for details

Acknowledgments

A list of used libraries and code with their licenses can be seen in the ACKNOWLEDGMENTS.md file.


All versions of json-request-check-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
symfony/framework-bundle Version ^6.0|^7.0
symfony/dependency-injection Version ^6.0|^7.0
symfony/http-kernel Version ^6.0|^7.0
symfony/config Version ^6.0|^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package iwf-web/json-request-check-bundle contains the following files

Loading the files please wait ...