Download the PHP package bgeneto/ci4-secrets without Composer

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

CI4 Secrets

CI4 Secrets is a CodeIgniter 4 package designed to provide a secure and reliable way to store sensitive data, such as API keys, certificate passwords, and other confidential information. By utilizing CI4's encryption key, CI4 Secrets encrypts data at rest and stores it securely using your default database connection.

With CI4 Secrets, you can eliminate the risk of storing sensitive information in plain text within your .env file, reducing the exposure of your application to potential security breaches. Instead, store your secrets securely and access them easily through the package's intuitive interface.

1. Installation


1.1 Composer + Packagist

1.2 Composer + GitHub:

Just setup the repository like this in your project's composer.json file:

1.3 Composer + Local:

Now edit your composer.json file and add a new repository:

2. Check if you have an encryption key

Check in your .env or in Config\Encryption if you have an encryption key already configured, if not just run this spark command below:

This will put a encryption key in your .env similar to this:

3. Publish the package config file

This will create a new Config\Secrets.php file that you can customize.

5. Create the required table

This packages uses only one database table called secrets . You have to run the spark migration command to create it.

2. Usage


2.1 CLI Usage

The Secrets package provides the following spark new command: php spark secrets with the available options:

Available Operations

Usage Examples

The Secrets library provides methods to securely store, encrypt, and decrypt sensitive data using CodeIgniter 4's encryption service anywhere (model, controllers...).

Methods

There is also a model class (Bgeneto\Secrets\Models\BaseSecretModel) that you can extend in order to add new features like logging/auditing.

Extending the Model

You can extend the BaseSecretModel to add custom functionality, such as using traits with model callbacks. To do this:

  1. Create a custom model: Create a new model class that extends Bgeneto\Secrets\Models\BaseSecretModel. For example:

  2. Update the configuration: Modify the modelClass option in Config/Secrets.php to point to your custom model:

By following these steps, the Secrets class will use your custom model, allowing you to leverage traits and their associated callbacks.

License

This package is licensed under the MIT License. See the LICENSE file for details.


All versions of ci4-secrets with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.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 bgeneto/ci4-secrets contains the following files

Loading the files please wait ....