mirror of https://github.com/shred/acme4j
Restore "Do not send authorization with challenge"
Also set Pebble to strict mode.
This reverts commit cdab2b8bd0
.
pull/61/head
parent
3cd74220dd
commit
2ac4e7b7fb
|
@ -24,7 +24,6 @@ import org.jose4j.lang.JoseException;
|
||||||
import org.shredzone.acme4j.Login;
|
import org.shredzone.acme4j.Login;
|
||||||
import org.shredzone.acme4j.exception.AcmeProtocolException;
|
import org.shredzone.acme4j.exception.AcmeProtocolException;
|
||||||
import org.shredzone.acme4j.toolbox.JSON;
|
import org.shredzone.acme4j.toolbox.JSON;
|
||||||
import org.shredzone.acme4j.toolbox.JSONBuilder;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An extension of {@link Challenge} that handles challenges with a {@code token} and
|
* An extension of {@link Challenge} that handles challenges with a {@code token} and
|
||||||
|
@ -35,7 +34,6 @@ public class TokenChallenge extends Challenge {
|
||||||
private static final long serialVersionUID = 1634133407432681800L;
|
private static final long serialVersionUID = 1634133407432681800L;
|
||||||
|
|
||||||
protected static final String KEY_TOKEN = "token";
|
protected static final String KEY_TOKEN = "token";
|
||||||
protected static final String KEY_KEY_AUTHORIZATION = "keyAuthorization";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new generic {@link TokenChallenge} object.
|
* Creates a new generic {@link TokenChallenge} object.
|
||||||
|
@ -49,12 +47,6 @@ public class TokenChallenge extends Challenge {
|
||||||
super(login, data);
|
super(login, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void prepareResponse(JSONBuilder response) {
|
|
||||||
super.prepareResponse(response);
|
|
||||||
response.put(KEY_KEY_AUTHORIZATION, getAuthorization());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the token.
|
* Gets the token.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -30,8 +30,6 @@ import org.shredzone.acme4j.toolbox.TestUtils;
|
||||||
* Unit tests for {@link Dns01Challenge}.
|
* Unit tests for {@link Dns01Challenge}.
|
||||||
*/
|
*/
|
||||||
public class DnsChallengeTest {
|
public class DnsChallengeTest {
|
||||||
private static final String KEY_AUTHORIZATION =
|
|
||||||
"pNvmJivs0WCko2suV7fhe-59oFqyYx_yB7tx6kIMAyE.HnWjTDnyqlCrm6tZ-6wX-TrEXgRdeNu9G71gqxSO6o0";
|
|
||||||
|
|
||||||
private Login login = TestUtils.login();
|
private Login login = TestUtils.login();
|
||||||
|
|
||||||
|
@ -45,12 +43,12 @@ public class DnsChallengeTest {
|
||||||
assertThat(challenge.getType(), is(Dns01Challenge.TYPE));
|
assertThat(challenge.getType(), is(Dns01Challenge.TYPE));
|
||||||
assertThat(challenge.getStatus(), is(Status.PENDING));
|
assertThat(challenge.getStatus(), is(Status.PENDING));
|
||||||
assertThat(challenge.getDigest(), is("rzMmotrIgsithyBYc0vgiLUEEKYx0WetQRgEF2JIozA"));
|
assertThat(challenge.getDigest(), is("rzMmotrIgsithyBYc0vgiLUEEKYx0WetQRgEF2JIozA"));
|
||||||
|
assertThat(challenge.getAuthorization(), is("pNvmJivs0WCko2suV7fhe-59oFqyYx_yB7tx6kIMAyE.HnWjTDnyqlCrm6tZ-6wX-TrEXgRdeNu9G71gqxSO6o0"));
|
||||||
|
|
||||||
JSONBuilder response = new JSONBuilder();
|
JSONBuilder response = new JSONBuilder();
|
||||||
challenge.prepareResponse(response);
|
challenge.prepareResponse(response);
|
||||||
|
|
||||||
assertThat(response.toString(), sameJSONAs("{\"keyAuthorization\"=\""
|
assertThat(response.toString(), sameJSONAs("{}").allowingExtraUnexpectedFields());
|
||||||
+ KEY_AUTHORIZATION + "\"}").allowingExtraUnexpectedFields());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,8 +53,7 @@ public class HttpChallengeTest {
|
||||||
JSONBuilder response = new JSONBuilder();
|
JSONBuilder response = new JSONBuilder();
|
||||||
challenge.prepareResponse(response);
|
challenge.prepareResponse(response);
|
||||||
|
|
||||||
assertThat(response.toString(), sameJSONAs("{\"keyAuthorization\"=\""
|
assertThat(response.toString(), sameJSONAs("{}").allowingExtraUnexpectedFields());
|
||||||
+ KEY_AUTHORIZATION + "\"}").allowingExtraUnexpectedFields());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,3 +1,2 @@
|
||||||
{
|
{
|
||||||
"keyAuthorization": "IlirfxKKXAsHtmzK29Pj8A.HnWjTDnyqlCrm6tZ-6wX-TrEXgRdeNu9G71gqxSO6o0"
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,5 @@
|
||||||
"type": "http-01",
|
"type": "http-01",
|
||||||
"status": "pending",
|
"status": "pending",
|
||||||
"url": "https://example.com/acme/some-location",
|
"url": "https://example.com/acme/some-location",
|
||||||
"token": "IlirfxKKXAsHtmzK29Pj8A",
|
"token": "IlirfxKKXAsHtmzK29Pj8A"
|
||||||
"keyAuthorization": "XbmEGDDc2AMDArHLt5x7GxZfIRv0aScknUKlyf5S4KU.KMH_h8aGAKlY3VQqBUczm1cfo9kaovivy59rSY1xZ0E"
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -132,7 +132,7 @@
|
||||||
<cmd>
|
<cmd>
|
||||||
<shell>
|
<shell>
|
||||||
echo "nameserver $(grep 'bammbamm' /etc/hosts|cut -f1)">/etc/resolv.conf; \
|
echo "nameserver $(grep 'bammbamm' /etc/hosts|cut -f1)">/etc/resolv.conf; \
|
||||||
pebble -config /etc/pebble/pebble-config.json
|
pebble -strict -config /etc/pebble/pebble-config.json
|
||||||
</shell>
|
</shell>
|
||||||
</cmd>
|
</cmd>
|
||||||
<assembly>
|
<assembly>
|
||||||
|
|
Loading…
Reference in New Issue