@Override
    public void saveOrUpdate(final SamlMetadataDocument document) {
        if (s3Client.listBuckets(ListBucketsRequest.builder().build())
            .buckets().stream().noneMatch(b -> b.name().equalsIgnoreCase(bucketName))) {
            LOGGER.trace("Bucket [{}] does not exist. Creating...", bucketName);
            val bucket = s3Client.createBucket(CreateBucketRequest.builder().bucket(bucketName.toLowerCase(Locale.ENGLISH)).build());
            LOGGER.debug("Created bucket [{}]", bucket.location());
        }

        val request = PutObjectRequest.builder().bucket(bucketName)
            .key(document.getName())
            .metadata(Map.of("signature", document.getSignature()))
            .build();
        s3Client.putObject(request, RequestBody.fromString(document.getValue()));
    }
This is {@link AmazonS3SamlRegisteredServiceMetadataResolver}.

@author Misagh Moayyed
@since 5.3.0
support/cas-server-support-saml-idp-metadata-aws-s3/src/main/java/org/apereo/cas/support/saml/metadata/resolver/AmazonS3SamlRegisteredServiceMetadataResolver.java