Skip to content

Commit

Permalink
update composer credential check to account for github change
Browse files Browse the repository at this point in the history
  • Loading branch information
keithbentrup committed Jun 14, 2021
1 parent 38bc224 commit 133191e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions bin/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -435,9 +435,16 @@ is_string_valid_composer_credentials() {
md5_file="$mdm_path/.md5-of-passed-composer-cred-${md5}"
# for max menu rendering speed, check for md5 of prev passed credentials
[[ -f "$md5_file" ]] && return 0
echo "$1" | jq -e -c '[."github-oauth"."github.com", ."http-basic"."repo.magento.com"["username","password"]] |
map(strings) |
length == 3' > /dev/null 2>&1 || status="$?"
# verify the credentials have a user & pass for repo.magento.com
# and a github oauth token or a github user & pass if using basic
echo "$1" | jq -e -c '
([."http-basic"."repo.magento.com"["username","password"]]
| map(strings)
| length == 2)
and
([."github-oauth"."github.com", ."http-basic"."github-oauth"["username","password"]]
| map(strings)
| length > 0)' ~/.composer/auth.json > /dev/null 2>&1 || status="$?"
if [[ "$status" -eq 0 ]]; then
touch "$md5_file"
fi
Expand Down

0 comments on commit 133191e

Please sign in to comment.