fix(codeartifact): validate repository updates before mutation (#8083)

Validate the description before replacing stored upstreams so a refused
UpdateRepository request leaves the repository unchanged. Cover rejected
replacement and clearing requests through the AWS SDK, including successful
updates at the accepted description-length boundary.

Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
Co-authored-by: Andre Kurait <akurait@amazon.com>
This commit is contained in:
Jackson PriceandAndre Kurait authored and GitHub committed 2026-11-12 07:31:46 -04:00
1 parent 67814c5d21
commit a6b5f5e407
4 files changed
+91 -1

No files matched your search

@@ -720,6 +720,7 @@ public class CodeArtifactService implements Resettable {
String owner = effectiveOwner(domainOwner);
String key = repositoryKey(region, domain, repository);
CodeArtifactRepository r = requireRepository(owner, key, repository);
validateDescription(description);
if (upstreams != null) {
if (!upstreams.isEmpty() && !r.getExternalConnections().isEmpty()) {
throw conflict("Repository '" + repository + "' has an external connection; "
@@ -730,7 +731,6 @@ public class CodeArtifactService implements Resettable {
r.setUpstreams(new ArrayList<>(upstreams));
}
if (description != null) {
validateDescription(description);
r.setDescription(description);
}
repositories.putForAccount(owner, key, r);