From 2b61478f135f070a9c669f4c4923725486a6eed2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20K=C3=B6rber?= Date: Thu, 14 Dec 2017 00:03:13 +0100 Subject: [PATCH] Remove oob-01 challenge It is not part of the ACME specs any more --- .../challenge/OutOfBand01Challenge.java | 49 --------------- .../acme4j/provider/AbstractAcmeProvider.java | 2 - .../challenge/OutOfBandChallengeTest.java | 61 ------------------- .../provider/AbstractAcmeProviderTest.java | 9 +-- .../src/test/resources/json/oobChallenge.json | 4 -- src/site/markdown/challenge/index.md | 1 - src/site/markdown/challenge/oob-01.md | 9 --- src/site/site.xml | 1 - 8 files changed, 2 insertions(+), 134 deletions(-) delete mode 100644 acme4j-client/src/main/java/org/shredzone/acme4j/challenge/OutOfBand01Challenge.java delete mode 100644 acme4j-client/src/test/java/org/shredzone/acme4j/challenge/OutOfBandChallengeTest.java delete mode 100644 acme4j-client/src/test/resources/json/oobChallenge.json delete mode 100644 src/site/markdown/challenge/oob-01.md diff --git a/acme4j-client/src/main/java/org/shredzone/acme4j/challenge/OutOfBand01Challenge.java b/acme4j-client/src/main/java/org/shredzone/acme4j/challenge/OutOfBand01Challenge.java deleted file mode 100644 index 39640517..00000000 --- a/acme4j-client/src/main/java/org/shredzone/acme4j/challenge/OutOfBand01Challenge.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * acme4j - Java ACME client - * - * Copyright (C) 2016 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.challenge; - -import java.net.URL; - -import org.shredzone.acme4j.Session; - -/** - * Implements the {@value TYPE} challenge. - */ -public class OutOfBand01Challenge extends Challenge { - private static final long serialVersionUID = -7459595198486630582L; - - /** - * Challenge type name: {@value} - */ - public static final String TYPE = "oob-01"; - - /** - * Creates a new generic {@link OutOfBand01Challenge} object. - * - * @param session - * {@link Session} to bind to. - */ - public OutOfBand01Challenge(Session session) { - super(session); - } - - /** - * Returns the validation URL to be visited by the customer in order to complete the - * challenge. - */ - public URL getValidationUrl() { - return getJSON().get("href").asURL(); - } - -} diff --git a/acme4j-client/src/main/java/org/shredzone/acme4j/provider/AbstractAcmeProvider.java b/acme4j-client/src/main/java/org/shredzone/acme4j/provider/AbstractAcmeProvider.java index 7184383e..38e678f2 100644 --- a/acme4j-client/src/main/java/org/shredzone/acme4j/provider/AbstractAcmeProvider.java +++ b/acme4j-client/src/main/java/org/shredzone/acme4j/provider/AbstractAcmeProvider.java @@ -25,7 +25,6 @@ import org.shredzone.acme4j.Session; import org.shredzone.acme4j.challenge.Challenge; import org.shredzone.acme4j.challenge.Dns01Challenge; import org.shredzone.acme4j.challenge.Http01Challenge; -import org.shredzone.acme4j.challenge.OutOfBand01Challenge; import org.shredzone.acme4j.challenge.TlsSni02Challenge; import org.shredzone.acme4j.connector.Connection; import org.shredzone.acme4j.connector.DefaultConnection; @@ -68,7 +67,6 @@ public abstract class AbstractAcmeProvider implements AcmeProvider { map.put(Dns01Challenge.TYPE, Dns01Challenge::new); map.put(TlsSni02Challenge.TYPE, TlsSni02Challenge::new); map.put(Http01Challenge.TYPE, Http01Challenge::new); - map.put(OutOfBand01Challenge.TYPE, OutOfBand01Challenge::new); return Collections.unmodifiableMap(map); } diff --git a/acme4j-client/src/test/java/org/shredzone/acme4j/challenge/OutOfBandChallengeTest.java b/acme4j-client/src/test/java/org/shredzone/acme4j/challenge/OutOfBandChallengeTest.java deleted file mode 100644 index bbb88de0..00000000 --- a/acme4j-client/src/test/java/org/shredzone/acme4j/challenge/OutOfBandChallengeTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * acme4j - Java ACME client - * - * Copyright (C) 2016 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.challenge; - -import static org.hamcrest.Matchers.is; -import static org.junit.Assert.assertThat; -import static org.shredzone.acme4j.toolbox.TestUtils.getJSON; -import static uk.co.datumedge.hamcrest.json.SameJSONAs.sameJSONAs; - -import java.io.IOException; -import java.net.URL; - -import org.junit.BeforeClass; -import org.junit.Test; -import org.shredzone.acme4j.Session; -import org.shredzone.acme4j.Status; -import org.shredzone.acme4j.toolbox.JSONBuilder; -import org.shredzone.acme4j.toolbox.TestUtils; - -/** - * Unit tests for {@link OutOfBand01Challenge}. - */ -public class OutOfBandChallengeTest { - private static Session session; - - @BeforeClass - public static void setup() throws IOException { - session = TestUtils.session(); - } - - /** - * Test that {@link OutOfBand01Challenge} is returning the validation URL. - */ - @Test - public void testHttpChallenge() throws IOException { - OutOfBand01Challenge challenge = new OutOfBand01Challenge(session); - challenge.unmarshall(getJSON("oobChallenge")); - - assertThat(challenge.getType(), is(OutOfBand01Challenge.TYPE)); - assertThat(challenge.getStatus(), is(Status.UNKNOWN)); - assertThat(challenge.getValidationUrl(), - is(new URL("https://example.com/validate/evaGxfADs6pSRb2LAv9IZ"))); - - JSONBuilder cb = new JSONBuilder(); - challenge.respond(cb); - - assertThat(cb.toString(), sameJSONAs("{\"type\": \"oob-01\"}")); - } - -} diff --git a/acme4j-client/src/test/java/org/shredzone/acme4j/provider/AbstractAcmeProviderTest.java b/acme4j-client/src/test/java/org/shredzone/acme4j/provider/AbstractAcmeProviderTest.java index 06049d7d..6ed1dfcd 100644 --- a/acme4j-client/src/test/java/org/shredzone/acme4j/provider/AbstractAcmeProviderTest.java +++ b/acme4j-client/src/test/java/org/shredzone/acme4j/provider/AbstractAcmeProviderTest.java @@ -30,7 +30,6 @@ import org.shredzone.acme4j.Session; import org.shredzone.acme4j.challenge.Challenge; import org.shredzone.acme4j.challenge.Dns01Challenge; import org.shredzone.acme4j.challenge.Http01Challenge; -import org.shredzone.acme4j.challenge.OutOfBand01Challenge; import org.shredzone.acme4j.challenge.TlsSni02Challenge; import org.shredzone.acme4j.connector.Connection; import org.shredzone.acme4j.connector.DefaultConnection; @@ -155,12 +154,8 @@ public class AbstractAcmeProviderTest { Challenge c6 = provider.createChallenge(session, "foobar-01"); assertThat(c6, is(nullValue())); - Challenge c7 = provider.createChallenge(session, OutOfBand01Challenge.TYPE); - assertThat(c7, not(nullValue())); - assertThat(c7, instanceOf(OutOfBand01Challenge.class)); - - Challenge c8 = provider.createChallenge(session, ""); - assertThat(c8, is(nullValue())); + Challenge c7 = provider.createChallenge(session, ""); + assertThat(c7, is(nullValue())); try { provider.createChallenge(session, (String) null); diff --git a/acme4j-client/src/test/resources/json/oobChallenge.json b/acme4j-client/src/test/resources/json/oobChallenge.json deleted file mode 100644 index 31b55cc5..00000000 --- a/acme4j-client/src/test/resources/json/oobChallenge.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "type": "oob-01", - "href": "https://example.com/validate/evaGxfADs6pSRb2LAv9IZ" -} diff --git a/src/site/markdown/challenge/index.md b/src/site/markdown/challenge/index.md index d5bff4b7..1c749296 100644 --- a/src/site/markdown/challenge/index.md +++ b/src/site/markdown/challenge/index.md @@ -11,4 +11,3 @@ The ACME specifications define these standard challenges: * [http-01](./http-01.html) * [dns-01](./dns-01.html) * [tls-sni-02](./tls-sni-02.html) -* [oob-01](./oob-01.html) diff --git a/src/site/markdown/challenge/oob-01.md b/src/site/markdown/challenge/oob-01.md deleted file mode 100644 index f5c2e348..00000000 --- a/src/site/markdown/challenge/oob-01.md +++ /dev/null @@ -1,9 +0,0 @@ -# oob-01 Challenge - -The `oob-01` challenge is an "out of band" challenge that is used when there is no automatic way of validating ownership of a domain. The client is instead required to perform actions outside of the ACME protocol. - -`OutOfBand01Challenge` implements this challenge. Its `getValidationUrl()` method returns a URL that refers to a web page with further instructions about the actions to be taken by the domain owner. - -The challenge must be triggered _before_ the URL is presented to the domain owner. - -> __Note:__ Due to the nature of this challenge, it may take hours or even days until the domain owner finishes the actions and the challenge state changes to `VALID`. diff --git a/src/site/site.xml b/src/site/site.xml index 298b3392..bc12b38d 100644 --- a/src/site/site.xml +++ b/src/site/site.xml @@ -40,7 +40,6 @@ -