mirror of
https://github.com/shred/acme4j.git
synced 2025-12-13 11:14:02 +08:00
Remove Buypass provider
Reason: Buypass terminates its ACME service
This commit is contained in:
@@ -37,7 +37,6 @@ module org.shredzone.acme4j {
|
||||
provides org.shredzone.acme4j.provider.AcmeProvider
|
||||
with org.shredzone.acme4j.provider.GenericAcmeProvider,
|
||||
org.shredzone.acme4j.provider.actalis.ActalisAcmeProvider,
|
||||
org.shredzone.acme4j.provider.buypass.BuypassAcmeProvider,
|
||||
org.shredzone.acme4j.provider.google.GoogleAcmeProvider,
|
||||
org.shredzone.acme4j.provider.letsencrypt.LetsEncryptAcmeProvider,
|
||||
org.shredzone.acme4j.provider.pebble.PebbleAcmeProvider,
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
/*
|
||||
* acme4j - Java ACME client
|
||||
*
|
||||
* Copyright (C) 2024 Richard "Shred" Körber
|
||||
* http://acme4j.shredzone.org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*/
|
||||
package org.shredzone.acme4j.provider.buypass;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URI;
|
||||
import java.net.URL;
|
||||
|
||||
import org.shredzone.acme4j.exception.AcmeProtocolException;
|
||||
import org.shredzone.acme4j.provider.AbstractAcmeProvider;
|
||||
import org.shredzone.acme4j.provider.AcmeProvider;
|
||||
|
||||
/**
|
||||
* An {@link AcmeProvider} for the <em>Buypass</em>.
|
||||
* <p>
|
||||
* The {@code serverUri} is {@code "acme://buypass.com"} for the production server,
|
||||
* and {@code "acme://buypass.com/staging"} for the staging server.
|
||||
*
|
||||
* @see <a href="https://www.buypass.com/products/tls-ssl-certificates/go-ssl">https://www.buypass.com/products/tls-ssl-certificates/go-ssl</a>
|
||||
* @since 3.5.0
|
||||
*/
|
||||
public class BuypassAcmeProvider extends AbstractAcmeProvider {
|
||||
|
||||
private static final String PRODUCTION_DIRECTORY_URL = "https://api.buypass.com/acme/directory";
|
||||
private static final String STAGING_DIRECTORY_URL = "https://api.test4.buypass.no/acme/directory";
|
||||
|
||||
@Override
|
||||
public boolean accepts(URI serverUri) {
|
||||
return "acme".equals(serverUri.getScheme())
|
||||
&& "buypass.com".equals(serverUri.getHost());
|
||||
}
|
||||
|
||||
@Override
|
||||
public URL resolve(URI serverUri) {
|
||||
var path = serverUri.getPath();
|
||||
String directoryUrl;
|
||||
if (path == null || path.isEmpty() || "/".equals(path)) {
|
||||
directoryUrl = PRODUCTION_DIRECTORY_URL;
|
||||
} else if ("/staging".equals(path)) {
|
||||
directoryUrl = STAGING_DIRECTORY_URL;
|
||||
} else {
|
||||
throw new IllegalArgumentException("Unknown URI " + serverUri);
|
||||
}
|
||||
|
||||
try {
|
||||
return URI.create(directoryUrl).toURL();
|
||||
} catch (MalformedURLException ex) {
|
||||
throw new AcmeProtocolException(directoryUrl, ex);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* acme4j - Java ACME client
|
||||
*
|
||||
* Copyright (C) 2024 Richard "Shred" Körber
|
||||
* http://acme4j.shredzone.org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* This package contains the {@link org.shredzone.acme4j.provider.AcmeProvider} for+
|
||||
* Buypass.
|
||||
*
|
||||
* @see <a href="https://www.buypass.com/products/tls-ssl-certificates/go-ssl">https://www.buypass.com/products/tls-ssl-certificates/go-ssl</a>
|
||||
*/
|
||||
@ReturnValuesAreNonnullByDefault
|
||||
@DefaultAnnotationForParameters(NonNull.class)
|
||||
@DefaultAnnotationForFields(NonNull.class)
|
||||
package org.shredzone.acme4j.provider.buypass;
|
||||
|
||||
import edu.umd.cs.findbugs.annotations.DefaultAnnotationForFields;
|
||||
import edu.umd.cs.findbugs.annotations.DefaultAnnotationForParameters;
|
||||
import edu.umd.cs.findbugs.annotations.NonNull;
|
||||
import edu.umd.cs.findbugs.annotations.ReturnValuesAreNonnullByDefault;
|
||||
@@ -2,9 +2,6 @@
|
||||
# Actalis: https://www.actalis.com/
|
||||
org.shredzone.acme4j.provider.actalis.ActalisAcmeProvider
|
||||
|
||||
# Buypass: https://buypass.com/
|
||||
org.shredzone.acme4j.provider.buypass.BuypassAcmeProvider
|
||||
|
||||
# Google Trust Services: https://pki.goog/
|
||||
org.shredzone.acme4j.provider.google.GoogleAcmeProvider
|
||||
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
/*
|
||||
* acme4j - Java ACME client
|
||||
*
|
||||
* Copyright (C) 2024 Richard "Shred" Körber
|
||||
* http://acme4j.shredzone.org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*/
|
||||
package org.shredzone.acme4j.provider.buypass;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import static org.shredzone.acme4j.toolbox.TestUtils.url;
|
||||
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
|
||||
import org.assertj.core.api.AutoCloseableSoftAssertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Unit tests for {@link BuypassAcmeProvider}.
|
||||
*/
|
||||
public class BuypassAcmeProviderTest {
|
||||
|
||||
private static final String PRODUCTION_DIRECTORY_URL = "https://api.buypass.com/acme/directory";
|
||||
private static final String STAGING_DIRECTORY_URL = "https://api.test4.buypass.no/acme/directory";
|
||||
|
||||
/**
|
||||
* Tests if the provider accepts the correct URIs.
|
||||
*/
|
||||
@Test
|
||||
public void testAccepts() throws URISyntaxException {
|
||||
var provider = new BuypassAcmeProvider();
|
||||
|
||||
try (var softly = new AutoCloseableSoftAssertions()) {
|
||||
softly.assertThat(provider.accepts(new URI("acme://buypass.com"))).isTrue();
|
||||
softly.assertThat(provider.accepts(new URI("acme://buypass.com/"))).isTrue();
|
||||
softly.assertThat(provider.accepts(new URI("acme://buypass.com/staging"))).isTrue();
|
||||
softly.assertThat(provider.accepts(new URI("acme://example.com"))).isFalse();
|
||||
softly.assertThat(provider.accepts(new URI("http://example.com/acme"))).isFalse();
|
||||
softly.assertThat(provider.accepts(new URI("https://example.com/acme"))).isFalse();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test if acme URIs are properly resolved.
|
||||
*/
|
||||
@Test
|
||||
public void testResolve() throws URISyntaxException {
|
||||
var provider = new BuypassAcmeProvider();
|
||||
|
||||
assertThat(provider.resolve(new URI("acme://buypass.com"))).isEqualTo(url(PRODUCTION_DIRECTORY_URL));
|
||||
assertThat(provider.resolve(new URI("acme://buypass.com/"))).isEqualTo(url(PRODUCTION_DIRECTORY_URL));
|
||||
assertThat(provider.resolve(new URI("acme://buypass.com/staging"))).isEqualTo(url(STAGING_DIRECTORY_URL));
|
||||
|
||||
assertThrows(IllegalArgumentException.class, () -> provider.resolve(new URI("acme://buypass.com/v99")));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user