Skip to content

Commit 9691aff

Browse files
Null78swilla
andauthored
Laravel 9.8 support (#23)
* update packages * Update composer.json Co-authored-by: Steve Williamson <[email protected]> * Laravel 9 Tests * adding multiple versions * p8 only with l9 * php version fix * php fix * testing * fixing actions Co-authored-by: Steve Williamson <[email protected]>
1 parent 7380676 commit 9691aff

File tree

4 files changed

+33
-19
lines changed

4 files changed

+33
-19
lines changed

.github/workflows/run-tests-l8.yml renamed to .github/workflows/run-tests-l9.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Run Tests - Current"
1+
name: "Run Tests - L9"
22

33
on: [push, pull_request]
44

@@ -9,12 +9,19 @@ jobs:
99
strategy:
1010
fail-fast: false
1111
matrix:
12+
laravel: [8.*, 9.*]
1213
php: [8.0, 7.4, 7.3]
13-
laravel: [8.*]
1414
dependency-version: [prefer-lowest, prefer-stable]
1515
include:
1616
- laravel: 8.*
1717
testbench: 6.*
18+
- laravel: 9.*
19+
testbench: 7.*
20+
exclude:
21+
- laravel: 9.*
22+
php: 7.3
23+
- laravel: 9.*
24+
php: 7.4
1825

1926
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}
2027

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^7.1 || ^7.3 || ^8.0",
20-
"aws/aws-sdk-php": "^3.145",
21-
"illuminate/support": "5.7.* || 5.8.* ||^6.0 || ^7.0 || ^8.0"
19+
"php": "^7.1 || ^7.3 || ^7.4 || ^8.0",
20+
"aws/aws-sdk-php": "^3.145 || ^3.219",
21+
"illuminate/support": "^6.0 || ^7.0 || ^8.0 || ^9.8"
2222
},
2323
"require-dev": {
24-
"orchestra/testbench": "^3.8 || ^5.0 || ^6.0",
25-
"phpunit/phpunit": "^7.0 || ^8.4 || ^9.3.3"
24+
"orchestra/testbench": "^3.8 || ^5.0 || ^6.0 || ^7.4",
25+
"phpunit/phpunit": "^7.0||^8.4||^9.3.3"
2626
},
2727
"autoload": {
2828
"psr-4": {

config/config.php

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
| Tag used to return list of Secrets
2020
|--------------------------------------------------------------------------
2121
|
22-
| All the secrets with the `dev` tag will be loaded into environment variables
22+
| All the secrets with the `dev` tag will be loaded into environment variables.
2323
|
2424
*/
2525

@@ -31,7 +31,8 @@
3131
| Environments where this service provider is enabled
3232
|--------------------------------------------------------------------------
3333
|
34-
| List the environment names in an array where this package should be enabled, it will be compared against env('APP_ENV') set in the app.yaml file
34+
| List the environment names in an array where this package should be enabled,
35+
| it will be compared against env('APP_ENV') set in the app.yaml file.
3536
|
3637
*/
3738

@@ -44,7 +45,8 @@
4445
| Variables that require overwriting the config
4546
|--------------------------------------------------------------------------
4647
|
47-
| Some (not all) variables are set into the config, as such updating the env() will not overwrite the config cached values. The variables below will overwrite the config.
48+
| Some (not all) variables are set into the config, as such updating the env() will not overwrite
49+
| the config cached values. The variables below will overwrite the config.
4850
|
4951
*/
5052
'variables-config' => [
@@ -56,11 +58,12 @@
5658
| Cache Enabled
5759
|--------------------------------------------------------------------------
5860
|
59-
| Boolean if you would like to enable cache. Datastore requests can add an additional 100-250ms of latency to each request. It is recommended to use caching to significantly reduce this latency.
61+
| Boolean if you would like to enable cache. Datastore requests can add an additional 100-250ms
62+
| of latency to each request. It is recommended to use caching to significantly reduce this latency.
6063
|
6164
*/
6265

63-
'cache-enabled' => true, //boolean
66+
'cache-enabled' => true, // boolean
6467

6568
/*
6669
|--------------------------------------------------------------------------
@@ -71,14 +74,15 @@
7174
|
7275
*/
7376

74-
'cache-expiry' => 30, //minutes
77+
'cache-expiry' => 30, // minutes
7578

7679
/*
7780
|--------------------------------------------------------------------------
7881
| Cache Store
7982
|--------------------------------------------------------------------------
8083
|
81-
| Define the cache store that you wish to use (this must be configured in your config.cache file). Note you can only use a store that does not require credentials to access it. As such file is suggested.
84+
| Define the cache store that you wish to use (this must be configured in your config.cache file).
85+
| Note: you can only use a store that does not require credentials to access it. As such file is suggested.
8286
|
8387
*/
8488

@@ -89,7 +93,8 @@
8993
| Debugging
9094
|--------------------------------------------------------------------------
9195
|
92-
| Enable debugging, latency introduced by this package on bootstrapping is calculated and logged to the system log (viewable in stackdriver)
96+
| Enable debugging, latency introduced by this package on bootstrapping is calculated and logged
97+
| to the system log (viewable in stackdriver).
9398
|
9499
*/
95100

src/LaravelAwsSecretsManager.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,19 @@ public function __construct()
3737

3838
public function loadSecrets()
3939
{
40-
//load vars from datastore to env
40+
// Load vars from datastore to env
4141
if ($this->debug) {
4242
$start = microtime(true);
4343
}
4444

45-
//Only run this if the evironment is enabled in the config
45+
// Only run this if the evironment is enabled in the config
4646
if (in_array(config('app.env'), $this->enabledEnvironments)) {
4747
if (! $this->checkCache()) {
48-
//Cache has expired need to refresh the cache from Datastore
48+
// Cache has expired need to refresh the cache from Datastore
4949
$this->getVariables();
5050
}
5151

52-
//Process variables in config that need updating
52+
// Process variables in config that need updating
5353
$this->updateConfigs();
5454
}
5555

@@ -63,6 +63,7 @@ protected function checkCache()
6363
{
6464
foreach ($this->configVariables as $variable => $configPath) {
6565
$val = Cache::store($this->cacheStore)->get($variable);
66+
6667
if (! is_null($val)) {
6768
putenv("$variable=$val");
6869
} else {
@@ -105,6 +106,7 @@ protected function getVariables()
105106
$result = $this->client->getSecretValue([
106107
'SecretId' => $secret['ARN'],
107108
]);
109+
108110
$secretValues = json_decode($result['SecretString'], true);
109111

110112
if (is_array($secretValues) && count($secretValues) > 0) {

0 commit comments

Comments
 (0)