Skip to content

Commit

Permalink
Add username option to Redis authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
okiedork authored and flavioheleno committed May 30, 2022
1 parent 23efe2c commit 8afb2a3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ AMQP_PORT=

REDIS_HOST=
REDIS_PORT=
REDIS_USERNAME=
REDIS_PASSWORD=

PHP_ENV=
Expand Down
3 changes: 2 additions & 1 deletion app/dependencies.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@
'port' => $dsn->getPort() ?? 6379
]
],
'password' => $dsn->getPassword() ?? null,
'username' => $dsn->getUser() ?? null,
'password' => $dsn->getPassword() ?? null
]
);
}
Expand Down
2 changes: 1 addition & 1 deletion app/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
[
'cache' => [
'enabled' => PHP_SAPI !== 'cli',
'redis' => "redis://:${_ENV['REDIS_PASSWORD']}@${_ENV['REDIS_HOST']}:${_ENV['REDIS_PORT']}"
'redis' => "redis://${_ENV['REDIS_USERNAME']}:${_ENV['REDIS_PASSWORD']}@${_ENV['REDIS_HOST']}:${_ENV['REDIS_PORT']}"
],
'db' => [
'dsn' => "pgsql://${_ENV['POSTGRES_USER']}:${_ENV['POSTGRES_PASSWORD']}@${_ENV['POSTGRES_HOST']}:${_ENV['POSTGRES_PORT']}/${_ENV['POSTGRES_DB']}"
Expand Down

0 comments on commit 8afb2a3

Please sign in to comment.