-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
beec984
commit 9f1ac74
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env zsh | ||
|
||
set -eo pipefail | ||
|
||
. ~/.awsecure-cli | ||
|
||
if [[ $(type awsecure_cli_log_info 2> /dev/null) == "" || -z "${AWSECURE_CLI_SRC_DIRECTORY// /}" ]]; then | ||
[[ -L ${0} ]] && declare -gr AWSECURE_CLI_SRC_DIRECTORY="$(realpath $(readlink ${0}) | xargs dirname)/../../src" || declare -gr AWSECURE_CLI_SRC_DIRECTORY="$(realpath ${0} | xargs dirname)/../../src" | ||
. ${AWSECURE_CLI_SRC_DIRECTORY}/common/logging.shinc | ||
fi | ||
|
||
awsecure_cli_log_info "Using the AWSecure CLI wrapper" | ||
. ${AWSECURE_CLI_SRC_DIRECTORY}/common/wrapper.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env zsh | ||
|
||
set -eo pipefail | ||
|
||
function awsecure_cli_validate_commands() { | ||
local -rl AWSECURE_CLI_VALIDATE_COMMANDS=(jq ${AWSECURE_CLI_AWS_BIN_FILEPATH} ${AWSECURE_CLI_SH_INTERPRETER}) | ||
for cmd in ${AWSECURE_CLI_VALIDATE_COMMANDS}; do | ||
awsecure_cli_log_info "Testing if ${cmd} is installed" | ||
${cmd} --version &> /dev/null || awsecure_cli_log_error "The ${cmd} is not installed or not in the PATH environment variable" | ||
done | ||
} | ||
|
||
case "${AWSECURE_CLI_OS_NAME// /}" in | ||
darwin) | ||
true | ||
;; | ||
linux) | ||
true | ||
;; | ||
*) | ||
awsecure_cli_log_error "OS not supported" | ||
;; | ||
esac | ||
|
||
awsecure_cli_validate_commands | ||
|
||
set +eo pipefail | ||
${AWSECURE_CLI_AWS_BIN_FILEPATH} configure get aws_access_key_id > /dev/null 2>&1 | ||
[[ $? -ne 0 ]] && { awsecure_cli_log_info "The profile ${AWS_PROFILE} is not using an AWS access key, skipping AWS access key rotation" ; SKIP_AWSECURE_CLI_AUTOROTATE_AWS_ACCESS_KEYS=true ; } | ||
set -eo pipefail |