Download the PHP package freshcells/guzzle-message-anonymizer-formatter without Composer

On this page you can find all versions of the php package freshcells/guzzle-message-anonymizer-formatter. 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 guzzle-message-anonymizer-formatter

Guzzle Message Anonymizer Formatter

Anonymize or truncate parts of json or xml payloads and request headers before logging with a guzzle middleware.
For data protection you might not want to log personal data, like names, addresses etc in your requests.

Usage

Example usage for Json Payloads:

...
$formatter = new GuzzleMessageJsonAnonymizerFormatter(
    ['PersonalData'],
    $substitute = '*****',
    AbstractAnonymizerFormatter::DEBUG,
    ['Authorization' => '*****']
);
$loggerMiddleware = Middleware::log($logger, $formatter);
$stack->push($loggerMiddleware);
$config  = [
    ...
    'handler'  => $stack,
];
$client  = new Client($config);

This will log:

<<<<<<<<
HTTP/1.1 200 OK
Date: Thu, 18 Jun 2020 10:04:21 GMT
Content-Type: application/json
Authorization: *****
...
{
  ...
  "Payload": {
    "Foo": "Bar", 
    ...
    "PersonalData": "*****"
  }, 
  ...
}

Usage Symfony

Declare the Formatter service:

Freshcells\GuzzleMessageAnonymizerFormatter\GuzzleMessageXmlAnonymizerFormatter:
  arguments:
    $elements:
      - 'none:FirstName'
      - 'none:LastName'
    $attributes:
      - 'none:Customer[@Age]'
    $namespaces:
      none: 'http://namespace.de/middleware/payment/'
    $truncateElements
        VeryLongText: 200

Override existing message formatter of a logger middleware:

csa_guzzle.logger.message_formatter:
  alias: 'Freshcells\GuzzleMessageAnonymizerFormatter\GuzzleMessageXMLAnonymizerFormatter'

Or declare a dedicated anonymizer_logger middleware:

guzzle.middleware.anonymizer_logger:
  class: Closure
  factory: ['GuzzleHttp\Middleware', log]
  arguments: ['@monolog.logger', '@Freshcells\GuzzleMessageAnonymizerFormatter\GuzzleMessageXmlAnonymizerFormatter', 'info']
  tags:
    - { name: csa_guzzle.middleware, alias: anonymizer_logger }

All versions of guzzle-message-anonymizer-formatter with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
guzzlehttp/guzzle Version ^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 freshcells/guzzle-message-anonymizer-formatter contains the following files

Loading the files please wait ....