agz/laravel-gcp-secret-injector 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

agz/laravel-gcp-secret-injector

最新稳定版本:0.0.1

Composer 安装命令:

composer require agz/laravel-gcp-secret-injector

包简介

Include GCP secrets in you laravel environment without explicitly declaring them in your .env files

README 文档

README

This package helps load sensitive data from you Google Cloud Secret Manager into your laravel environment instead of explictly defining it in your .env file.

Prerequisite

You need to already have google/cloud-secret-manager installed in your project.

Installation

You can install this package via composer:

composer require agz/laravel-secret-injector

To publish the config file run the vendor publish command:

php artisan vendor:publish --tag=gcp-secret-injector

Configuration

After publishing the secret inject assets, its configuration will be located at config/secret-injector.php. The configuration allows you to configure you environmental variables against the your Google Cloud secrets.

return [

    'project_id' => env('GOOGLE_CLOUD_PROJECT'),
    'includedEnvs' => ['production'],
    'secrets' => []
];

The project_id points to your google cloud project id. The includedEnvs tells configures what environments which you want the library to be active. For example, by default is configured to be just production. Meaning that once your APP_ENV is set to production, then the library will pull secrets from your Google Cloud Secret Manager in to your environment.

The secrets is used to configure what environmental variables should point to which secrets.

'secrets' => [
        'ENVIROMENTAL_VARIABLE' => 'SECRET_NAME:VERSION',
    ]

For example:

'secrets' => [
        'APP_KEY' => 'APP_KEY:latest',
        'DB_PASSWORD' => 'DB_PASSWORD:1',
    ]

Testing

composer test

Contributors

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 9
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-03-08