Support external-account-required metadata

pull/55/head
Richard Körber 2017-12-13 23:43:26 +01:00
parent 173aa14e40
commit 2ab4038bd5
No known key found for this signature in database
GPG Key ID: AAB9FD19C78AA3E0
3 changed files with 9 additions and 0 deletions

View File

@ -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.

View File

@ -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()));
}

View File

@ -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": [