Avoid macOS keychain in Section 0 helper
This commit is contained in:
@@ -118,11 +118,15 @@ install_git_credential() {
|
|||||||
host="\$(credential_host "\$remote")"
|
host="\$(credential_host "\$remote")"
|
||||||
protocol="\$(printf "%s" "\$remote" | sed -n "s#^\\([^:/]*\\)://.*#\\1#p")"
|
protocol="\$(printf "%s" "\$remote" | sed -n "s#^\\([^:/]*\\)://.*#\\1#p")"
|
||||||
[ -n "\$protocol" ] || protocol="http"
|
[ -n "\$protocol" ] || protocol="http"
|
||||||
if [ "\$(uname -s 2>/dev/null || true)" = "Darwin" ]; then
|
mkdir -p "\$SESSION_DIR"
|
||||||
git -C "\$REPO_DIR" config credential.helper osxkeychain
|
credential_path="\$SESSION_DIR/git-credentials"
|
||||||
fi
|
touch "\$credential_path"
|
||||||
|
chmod 600 "\$credential_path"
|
||||||
|
git -C "\$REPO_DIR" config --local --replace-all credential.helper ""
|
||||||
|
git -C "\$REPO_DIR" config --local --add credential.helper "store --file=\$credential_path"
|
||||||
printf "protocol=%s\nhost=%s\nusername=%s\npassword=%s\n\n" "\$protocol" "\$host" "\$username" "\$password" \
|
printf "protocol=%s\nhost=%s\nusername=%s\npassword=%s\n\n" "\$protocol" "\$host" "\$username" "\$password" \
|
||||||
| git -C "\$REPO_DIR" credential approve
|
| git -C "\$REPO_DIR" credential approve
|
||||||
|
chmod 600 "\$credential_path"
|
||||||
}
|
}
|
||||||
|
|
||||||
auth_login() {
|
auth_login() {
|
||||||
@@ -142,6 +146,13 @@ auth_login() {
|
|||||||
echo "Token check:"
|
echo "Token check:"
|
||||||
echo " \$SERVER_URL/device/\$code/token"
|
echo " \$SERVER_URL/device/\$code/token"
|
||||||
open_url "\$auth_url"
|
open_url "\$auth_url"
|
||||||
|
if [ "\${SECTION0_AUTH_POLL:-}" != "1" ]; then
|
||||||
|
echo "When the browser says login succeeded, return here and press Enter."
|
||||||
|
printf "Press Enter to finish login: "
|
||||||
|
IFS= read -r _section0_continue
|
||||||
|
auth_finish "\$code"
|
||||||
|
return
|
||||||
|
fi
|
||||||
echo "Waiting for login..."
|
echo "Waiting for login..."
|
||||||
token_json=""
|
token_json=""
|
||||||
i=0
|
i=0
|
||||||
|
|||||||
Reference in New Issue
Block a user