/** * Gets the expiry date of the authorization, if set by the server. */ @CheckForNull public Instant getExpires() { return getJSON().get("expires") .map(Value::asString) .map(AcmeUtils::parseTimestamp) .orElse(null); }
/** * Gets the expiry date of the authorization, if set by the server. */ @CheckForNull public Instant getExpires() { return getJSON().get("expires") .map(Value::asString) .map(AcmeUtils::parseTimestamp) .orElse(null); }
/** * Returns {@code true} if this {@link Authorization} is related to a wildcard domain, * {@code false} otherwise. */ public boolean isWildcard() { return getJSON().get("wildcard") .map(Value::asBoolean) .orElse(false); }
/** * Returns {@code true} if this {@link Authorization} is related to a wildcard domain, * {@code false} otherwise. */ public boolean isWildcard() { return getJSON().get("wildcard") .map(Value::asBoolean) .orElse(false); }
/** * Gets a list of all challenges offered by the server, in no specific order. */ public List<Challenge> getChallenges() { Login login = getLogin(); return Collections.unmodifiableList(getJSON().get("challenges") .asArray() .stream() .map(Value::asObject) .map(login::createChallenge) .collect(toList())); }
/** * Gets a list of all challenges offered by the server, in no specific order. */ public List<Challenge> getChallenges() { Login login = getLogin(); return Collections.unmodifiableList(getJSON().get("challenges") .asArray() .stream() .map(Value::asObject) .map(login::createChallenge) .collect(toList())); }
/** * Gets the {@link Identifier} to be authorized. * <p> * For wildcard domain orders, the domain itself (without wildcard prefix) is returned * here. To find out if this {@link Authorization} is related to a wildcard domain * order, check the {@link #isWildcard()} method. * * @since 2.3 */ public Identifier getIdentifier() { return getJSON().get("identifier").asIdentifier(); }
/** * Gets the {@link Identifier} to be authorized. * <p> * For wildcard domain orders, the domain itself (without wildcard prefix) is returned * here. To find out if this {@link Authorization} is related to a wildcard domain * order, check the {@link #isWildcard()} method. * * @since 2.3 */ public Identifier getIdentifier() { return getJSON().get("identifier").asIdentifier(); }
/** * Gets the authorization status. * <p> * Possible values are: {@link Status#PENDING}, {@link Status#VALID}, * {@link Status#INVALID}, {@link Status#DEACTIVATED}, {@link Status#EXPIRED}, * {@link Status#REVOKED}. */ public Status getStatus() { return getJSON().get("status").asStatus(); }
/** * Gets the authorization status. * <p> * Possible values are: {@link Status#PENDING}, {@link Status#VALID}, * {@link Status#INVALID}, {@link Status#DEACTIVATED}, {@link Status#EXPIRED}, * {@link Status#REVOKED}. */ public Status getStatus() { return getJSON().get("status").asStatus(); }
private void checkAuthStatii(Order order) { for(Authorization auth : order.getAuthorizations()) { Status status = auth.getStatus(); log.info("checking auth="+auth.getDomain()+" status="+status+" location="+auth.getLocation()+" expires="+auth.getExpires()); if(status != Status.PENDING) throw new ChallengeInBadStateException("challenge in bad state="+auth.getJSON()); } }