From 6c4487b43dd9a9693015087e2dfa72d72de8ea6f Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 17 Apr 2023 16:40:26 -0400 Subject: [PATCH] [JENKINS-71078] Better report lack of AWS credentials --- .../plugins/artifact_manager_jclouds/s3/S3BlobStore.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/io/jenkins/plugins/artifact_manager_jclouds/s3/S3BlobStore.java b/src/main/java/io/jenkins/plugins/artifact_manager_jclouds/s3/S3BlobStore.java index d48d3453..88f90871 100644 --- a/src/main/java/io/jenkins/plugins/artifact_manager_jclouds/s3/S3BlobStore.java +++ b/src/main/java/io/jenkins/plugins/artifact_manager_jclouds/s3/S3BlobStore.java @@ -157,6 +157,9 @@ private Supplier getCredentialsSupplier() throws IOException { if (getConfiguration().getDisableSessionToken()) { AmazonWebServicesCredentials awsCredentials = CredentialsAwsGlobalConfiguration.get().getCredentials(); + if (awsCredentials == null) { + throw new IOException("No static AWS credentials found"); + } accessKeyId = awsCredentials.getCredentials().getAWSAccessKeyId(); secretKey = awsCredentials.getCredentials().getAWSSecretKey(); sessionToken = "";