mirror of
https://github.com/mulgadc/spinifex.git
synced 2026-10-21 11:46:37 +00:00
ImportKeyPair bug fix on URL encode base64 encoding
This commit is contained in:
@@ -2,6 +2,7 @@ package gateway
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"strings"
|
||||
|
||||
"github.com/aws/aws-sdk-go/service/ec2"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
@@ -208,6 +209,12 @@ func (gw *GatewayConfig) EC2_Request(ctx *fiber.Ctx) error {
|
||||
case "ImportKeyPair":
|
||||
|
||||
var input = &ec2.ImportKeyPairInput{}
|
||||
|
||||
// Bug in parser, end of Base64 is URL encoded
|
||||
if strings.HasSuffix(queryArgs["PublicKeyMaterial"], "%3D%3D") {
|
||||
queryArgs["PublicKeyMaterial"] = strings.Replace(queryArgs["PublicKeyMaterial"], "%3D%3D", "==", 1)
|
||||
}
|
||||
|
||||
err = awsec2query.QueryParamsToStruct(queryArgs, input)
|
||||
|
||||
if err != nil {
|
||||
|
||||
@@ -241,7 +241,8 @@ echo "📊 Monitor background service logs:"
|
||||
echo " tail -f $LOGS_DIR/*.log"
|
||||
echo ""
|
||||
echo "🧪 Test with AWS CLI (once daemon is running):"
|
||||
echo " aws --endpoint-url https://localhost:9999 --no-verify-ssl ec2 describe-instances"
|
||||
echo " export AWS_PROFILE=hive"
|
||||
echo " aws ec2 describe-instances"
|
||||
echo ""
|
||||
|
||||
# This will only be reached if air/daemon exits normally
|
||||
|
||||
Reference in New Issue
Block a user