Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow configuring a different parent directory for .aws #3035

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/AbstractConfigurationProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ public static function chain()
*/
protected static function getHomeDir()
{
// Allow the ".aws" folder containing configuration and credentials to
// exist in another location. In some setups, this allows both the web
// server user (e.g. actions taken via a website UI) and the application
// user (e.g. actions taken via CLI) to properly work.
if ($homeDir = getenv('AWS_HOME')) {
return $homeDir;
}

// On Linux/Unix-like systems, use the HOME environment variable
if ($homeDir = getenv('HOME')) {
return $homeDir;
Expand Down
8 changes: 8 additions & 0 deletions src/Configuration/ConfigurationResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,14 @@ public static function ini(
*/
private static function getHomeDir()
{
// Allow the ".aws" folder containing configuration and credentials to
// exist in another location. In some setups, this allows both the web
// server user (e.g. actions taken via a website UI) and the application
// user (e.g. actions taken via CLI) to properly work.
if ($homeDir = getenv('AWS_HOME')) {
return $homeDir;
}

// On Linux/Unix-like systems, use the HOME environment variable
if ($homeDir = getenv('HOME')) {
return $homeDir;
Expand Down
8 changes: 8 additions & 0 deletions src/Credentials/CredentialProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,14 @@ private static function loadRoleProfile(
*/
private static function getHomeDir()
{
// Allow the ".aws" folder containing configuration and credentials to
// exist in another location. In some setups, this allows both the web
// server user (e.g. actions taken via a website UI) and the application
// user (e.g. actions taken via CLI) to properly work.
if ($homeDir = getenv('AWS_HOME')) {
return $homeDir;
}

// On Linux/Unix-like systems, use the HOME environment variable
if ($homeDir = getenv('HOME')) {
return $homeDir;
Expand Down
8 changes: 8 additions & 0 deletions src/Token/ParsesIniTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ private static function loadProfiles($filename)
*/
private static function getHomeDir()
{
// Allow the ".aws" folder containing configuration and credentials to
// exist in another location. In some setups, this allows both the web
// server user (e.g. actions taken via a website UI) and the application
// user (e.g. actions taken via CLI) to properly work.
if ($homeDir = getenv('AWS_HOME')) {
return $homeDir;
}

// On Linux/Unix-like systems, use the HOME environment variable
if ($homeDir = getenv('HOME')) {
return $homeDir;
Expand Down