Add cloud-providers module: keyless Spring AI on Amazon Bedrock (AWS default credential chain under IRSA and EKS Pod Identity) and Azure OpenAI (managed identity, Microsoft Entra ID bearer tokens), an audit advisor, and the traps reproduced (leftover static key beats the role, AWS_REGION ignored by Bedrock auto-configuration, short-lived credentials refetched per call, azure-identity missing, leftover OPENAI_API_KEY, other modalities defaulting to OpenAI, SigV4 session token in AWS SDK DEBUG logs). No AWS account or Azure subscription used: a local server stands in for STS, Bedrock, the Azure identity endpoint and Azure OpenAI; the Spring AI, AWS SDK and azure-identity code is real. Spring Boot 4.2.0, Spring AI 2.1.0, Java 25.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b5uEyg58znuchZ8C8i
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
98ed878675
commit
8f69e7bf50
+52
@@ -0,0 +1,52 @@
|
||||
#!/usr/bin/env bash
|
||||
# Shows what happened to the dedicated Azure OpenAI starter: it is not managed by the Spring AI 2.1.0 BOM, and the
|
||||
# newest version on Maven Central is a 2.0 milestone. Needs network access to Maven Central. Writes output/00-*.txt.
|
||||
set -uo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
out=output/00-azure-starter.txt
|
||||
tmp=$(mktemp -d)
|
||||
mkdir -p output
|
||||
|
||||
# Maven Central answers 429 when polled quickly; retry, and refuse to write a transcript from an empty answer.
|
||||
fetch() {
|
||||
local r
|
||||
for _ in 1 2 3 4 5 6 7 8; do
|
||||
if r=$(curl -sf "$1") && [ -n "$r" ]; then printf '%s' "$r"; return 0; fi
|
||||
sleep 10
|
||||
done
|
||||
echo "could not fetch $1" >&2; return 1
|
||||
}
|
||||
declare -A meta
|
||||
for a in spring-ai-starter-model-azure-openai spring-ai-starter-model-openai spring-ai-starter-model-bedrock-converse; do
|
||||
meta[$a]=$(fetch "https://repo1.maven.org/maven2/org/springframework/ai/$a/maven-metadata.xml") || exit 1
|
||||
sleep 3
|
||||
done
|
||||
bom=$(fetch https://repo1.maven.org/maven2/org/springframework/ai/spring-ai-bom/2.1.0/spring-ai-bom-2.1.0.pom) || exit 1
|
||||
{
|
||||
echo "# What happened to spring-ai-starter-model-azure-openai?"
|
||||
echo
|
||||
echo "A. Versions on Maven Central (maven-metadata.xml)"
|
||||
for a in spring-ai-starter-model-azure-openai spring-ai-starter-model-openai spring-ai-starter-model-bedrock-converse; do
|
||||
xml=${meta[$a]}
|
||||
printf ' %-45s newest listed version=%s\n' "$a" "$(grep -o '<version>[^<]*' <<<"$xml" | tail -1 | sed 's/<version>//')"
|
||||
done
|
||||
echo
|
||||
echo "B. Does the Spring AI 2.1.0 BOM manage the Azure starter?"
|
||||
for a in spring-ai-starter-model-azure-openai spring-ai-azure-openai spring-ai-starter-model-openai spring-ai-starter-model-bedrock-converse; do
|
||||
if grep -q "<artifactId>$a</artifactId>" <<<"$bom"; then r=managed; else r="NOT managed"; fi
|
||||
printf ' %-45s %s\n' "$a" "$r"
|
||||
done
|
||||
echo
|
||||
echo "C. Maven asked to resolve the Azure starter with no version under that BOM"
|
||||
cat > "$tmp/pom.xml" <<POM
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"><modelVersion>4.0.0</modelVersion>
|
||||
<groupId>x</groupId><artifactId>x</artifactId><version>1</version>
|
||||
<dependencyManagement><dependencies><dependency><groupId>org.springframework.ai</groupId><artifactId>spring-ai-bom</artifactId><version>2.1.0</version><type>pom</type><scope>import</scope></dependency></dependencies></dependencyManagement>
|
||||
<dependencies><dependency><groupId>org.springframework.ai</groupId><artifactId>spring-ai-starter-model-azure-openai</artifactId></dependency></dependencies>
|
||||
</project>
|
||||
POM
|
||||
(cd "$tmp" && mvn -B -q validate 2>&1 | grep -E "ERROR.*(version|missing)" | sort -u | head -1 | sed -E 's/^\[ERROR\] *//; s#/tmp/[^ ]*/pom.xml#pom.xml#')
|
||||
} > "$out"
|
||||
grep -q "is missing" "$out" || { echo "maven did not report the missing version" >&2; exit 1; }
|
||||
cat "$out"
|
||||
rm -rf "$tmp"
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
# Regenerates every file under output/. The tests write them through the Transcript helper, so each figure in a
|
||||
# transcript is also an assertion: if a number stops being true, the build fails. Each scenario starts the real
|
||||
# application in a child JVM with an exact environment, so the full run takes several minutes.
|
||||
# No cloud account and no network access to AWS or Azure is needed; scripts/azure-starter-check.sh only reads Maven Central.
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
rm -rf target output
|
||||
mvn -q -B test
|
||||
./scripts/azure-starter-check.sh > /dev/null
|
||||
ls output
|
||||
Reference in New Issue
Block a user