mirror of https://github.com/shred/acme4j
Do not send authorization with challenge
parent
44a036a858
commit
1987d951e8
|
@ -32,7 +32,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,7 +48,6 @@ public class TokenChallenge extends Challenge {
|
||||||
@Override
|
@Override
|
||||||
protected void prepareResponse(JSONBuilder response) {
|
protected void prepareResponse(JSONBuilder response) {
|
||||||
super.prepareResponse(response);
|
super.prepareResponse(response);
|
||||||
response.put(KEY_KEY_AUTHORIZATION, getAuthorization());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -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"
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue