Download the PHP package fuko-php/masked without Composer

On this page you can find all versions of the php package fuko-php/masked. 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 masked

Fuko\Masked Latest Version GitHub license Codacy Badge

Fuko\Masked is a small PHP library for masking sensitive data: it replace blacklisted elements with their redacted values.

It is meant to be very easy to use. If you have any experience with trying to sanitise data for logging, or cleaning information that is publicly accessible, you know how annoying it is to have passwords or security token popup at various places of your dumps. Fuko\Masked is meant to help with that.

Basic use

In order to use it, you just need to feed your sensitive data (passwords, tokens, credentials) to Fuko\Masked\Protect

...and that's it. The blacklisted values and inputs will be masked. The output of the above code is going to be

How it works ?

Fuko\Masked does two things:

By doing the above, you are going to have redacted content with all the sensitive details blacklisted. You do not need to go looking inside all the dumps you create for passwords or credentials, instead you just register them with \Fuko\Masked\Protect and that class will mask them wherever it finds them: strings, arrays, big text dumps. It's that simple. The idea is not to have clumsy and overdressed library, but a simple tool that its job well.

Examples

Here are several example of basic Fuko\Masked use cases.

Hide Values

You know where your passwords and credentials are, and you want to blacklist them in any dumps you create. Here's how you would do it:

The sensitive details might be in some nested arrays within the arrays, they are still going to be redacted:

Hide Inputs

At some occasions you know that user-submitted data or other super-global inputs might contain sensitive data. In these cases you do not need to hide the actual value, but you can address the input array instead. In this example we are going to mask the "password" POST value:

Working with Objects

The \Fuko\Masked\Protect::protect() only works with strings and arrays. If you need to mask the sensitive data in an object dump, you first create the dump and then feed it to Protect::protect(), like this:

For those classes that have ::__toString() method implemented, the objects will be cast into strings with that. Here is an example with an exception, and exception classes have that:

Different Masking

You can use \Fuko\Masked\Redact in your project as the library for masking data. By default the class uses \Fuko\Masked\Redact::disguise() method for masking, with default settings that masks everything and that uses as masking symbol. Here's how you can change its behaviour:

You can set your own callback for masking with \Fuko\Masked\Redact class:


All versions of masked with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
ext-mbstring Version *
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 fuko-php/masked contains the following files

Loading the files please wait ....