mirror of https://github.com/shred/acme4j
Support external-account-required metadata
parent
173aa14e40
commit
2ab4038bd5
|
@ -65,6 +65,13 @@ public class Metadata {
|
|||
.collect(toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether an external account is required by this CA.
|
||||
*/
|
||||
public boolean isExternalAccountRequired() {
|
||||
return meta.get("external-account-required").orElse(false).asBoolean();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the JSON representation of the metadata. This is useful for reading
|
||||
* proprietary metadata properties.
|
||||
|
|
|
@ -249,6 +249,7 @@ public class SessionTest {
|
|||
assertThat(meta.getTermsOfService(), is(URI.create("https://example.com/acme/terms")));
|
||||
assertThat(meta.getWebsite(), is(url("https://www.example.com/")));
|
||||
assertThat(meta.getCaaIdentities(), containsInAnyOrder("example.com"));
|
||||
assertThat(meta.isExternalAccountRequired(), is(true));
|
||||
assertThat(meta.getJSON(), is(notNullValue()));
|
||||
}
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
"caa-identities": [
|
||||
"example.com"
|
||||
],
|
||||
"external-account-required": true,
|
||||
"x-test-string": "foobar",
|
||||
"x-test-uri": "https://www.example.org",
|
||||
"x-test-array": [
|
||||
|
|
Loading…
Reference in New Issue