public static final class BiPredicateAssertions.Builder extends Object implements Assertions.Builder
Modifier and Type | Method and Description |
---|---|
BiPredicateAssertions |
build()
Creates a new assertions object using the configuration of this builder.
|
Assertions.Builder |
requireAudience(String audience,
String... otherAudiences)
Requires an claim whose value is equal to one of the
given audiences.
|
Assertions.Builder |
requireAudienceSatisfies(Predicate<List> condition,
Function<List,JWTAssertionFailedException> description)
Requires an claim whose value satisfies the given
condition.
|
Assertions.Builder |
requireCertificateSubjectMatches(String subjectName)
Requires that the certificate associated with a public key that was
used to verify the signature has a subject name that exactly matches
the given subject name.
|
Assertions.Builder |
requireCertificateSubjectMatchesIssuer()
Requires that the certificate associated with a public key that was
used to verify the signature has a subject name that exactly matches
the value of the claim.
|
Assertions.Builder |
requireContains(String name,
Object value,
Object... otherValues)
Requires a named claim whose value is an array which contains one of the
given values.
|
Assertions.Builder |
requireEquals(String name,
Object value,
Object... otherValues)
Requires a named claim whose value is equal to one of the given values.
|
Assertions.Builder |
requireExpirationSatisfies(BiPredicate<Instant,Clock> condition,
BiFunction<Instant,Clock,JWTAssertionFailedException> description)
Requires a claim whose value satisfies the specified
condition.
|
Assertions.Builder |
requireId()
Requires some non-empty value for the claim.
|
Assertions.Builder |
requireIdSatisfies(Predicate<String> condition,
Function<String,JWTAssertionFailedException> errorSupplier)
Requires a claim that satisfies the given condition.
|
Assertions.Builder |
requireInstantSatisfies(String name,
BiPredicate<Instant,Clock> condition,
BiFunction<Instant,Clock,JWTAssertionFailedException> errorSupplier)
Requires a named claim whose numeric value, interpreted as a quantity of
seconds from the epoch, satisfies a condition represented as bi-predicate
whose arguments are the given instant and a reference clock.
|
Assertions.Builder |
requireIssuedAtSatisfies(BiPredicate<Instant,Clock> condition,
BiFunction<Instant,Clock,JWTAssertionFailedException> errorSupplier)
Requires a claim whose value satisfies the specified
condition.
|
Assertions.Builder |
requireIssuer(String issuer,
String... otherIssuers)
Requires an claim whose value is equal to one of the
given issuers.
|
Assertions.Builder |
requireIssuerSatisfies(Predicate<String> condition,
Function<String,JWTAssertionFailedException> description)
Requires a claim whose value satisfies the given
condition.
|
Assertions.Builder |
requireLifetimeNotExceeded(Duration lifetime)
Requires a claim whose value is after the current
time of a reference clock less the given lifetime duration.
|
Assertions.Builder |
requireNotExpired(Duration tolerance)
Requires an claim whose value is after the current
time of a reference clock, less the given tolerance to allow for clock
skew.
|
Assertions.Builder |
requirePublicKeyInfoSatisfies(Predicate<PublicKeyInfo> condition,
Function<PublicKeyInfo,JWTAssertionFailedException> errorSupplier)
Requires that the public key info for a public key used to verify the
signature satisfies the given condition.
|
Assertions.Builder |
requirePublicKeyInfoSatisfies(String name,
BiPredicate<String,PublicKeyInfo> condition,
BiFunction<String,PublicKeyInfo,JWTAssertionFailedException> errorSupplier)
Requires that the public key info for a public key used to verify the
signature satisfies the given condition.
|
<T> Assertions.Builder |
requireSatisfies(String name,
Class<? extends T> type,
Predicate<T> condition,
Function<T,JWTAssertionFailedException> errorSupplier)
Requires a named claim whose value satisfies the given condition.
|
Assertions.Builder |
requireSubject(String subject,
String... otherSubjects)
Requires a claim whose value is equal to one of the
given subjects.
|
Assertions.Builder |
requireSubjectSatisfies(Predicate<String> condition,
Function<String,JWTAssertionFailedException> errorSupplier)
Requires a claim whose value satisfies the given
condition.
|
public Assertions.Builder requireId()
Assertions.Builder
requireId
in interface Assertions.Builder
public Assertions.Builder requireIdSatisfies(Predicate<String> condition, Function<String,JWTAssertionFailedException> errorSupplier)
Assertions.Builder
requireIdSatisfies
in interface Assertions.Builder
condition
- a predicate to evaluate as the conditionerrorSupplier
- a function that supplies an exception describing
the condition that was not metpublic Assertions.Builder requireLifetimeNotExceeded(Duration lifetime)
Assertions.Builder
requireLifetimeNotExceeded
in interface Assertions.Builder
lifetime
- lifetime duration to allowpublic Assertions.Builder requireIssuedAtSatisfies(BiPredicate<Instant,Clock> condition, BiFunction<Instant,Clock,JWTAssertionFailedException> errorSupplier)
Assertions.Builder
requireIssuedAtSatisfies
in interface Assertions.Builder
condition
- a bi-predicate to evaluate as the conditionerrorSupplier
- a bi-function that supplies an exception describing
the condition that was not metpublic Assertions.Builder requireNotExpired(Duration tolerance)
Assertions.Builder
requireNotExpired
in interface Assertions.Builder
tolerance
- tolerance to allow for clock skewpublic Assertions.Builder requireExpirationSatisfies(BiPredicate<Instant,Clock> condition, BiFunction<Instant,Clock,JWTAssertionFailedException> description)
Assertions.Builder
requireExpirationSatisfies
in interface Assertions.Builder
condition
- a bi-predicate to evaluate as the conditiondescription
- a bi-function that supplies an exception describing
the condition that was not metpublic Assertions.Builder requireIssuer(String issuer, String... otherIssuers)
Assertions.Builder
requireIssuer
in interface Assertions.Builder
issuer
- issuer to matchotherIssuers
- other issuers to allowpublic Assertions.Builder requireIssuerSatisfies(Predicate<String> condition, Function<String,JWTAssertionFailedException> description)
Assertions.Builder
requireIssuerSatisfies
in interface Assertions.Builder
condition
- predicate that represents the required conditiondescription
- a function that supplies an exception describing
the condition that was not metpublic Assertions.Builder requireCertificateSubjectMatchesIssuer()
Assertions.Builder
When matching the issuer name to the certificate subject, the common name (CN) component of the subject distinguished name, as well as any subject alternative names are considered.
requireCertificateSubjectMatchesIssuer
in interface Assertions.Builder
public Assertions.Builder requireCertificateSubjectMatches(String subjectName)
Assertions.Builder
When matching the given name to the certificate subject, the common name (CN) component of the subject distinguished name, as well as any subject alternative names are considered.
requireCertificateSubjectMatches
in interface Assertions.Builder
subjectName
- the subject name to matchpublic Assertions.Builder requireAudience(String audience, String... otherAudiences)
Assertions.Builder
requireAudience
in interface Assertions.Builder
audience
- audience to matchotherAudiences
- other audiences to allowpublic Assertions.Builder requireAudienceSatisfies(Predicate<List> condition, Function<List,JWTAssertionFailedException> description)
Assertions.Builder
requireAudienceSatisfies
in interface Assertions.Builder
condition
- predicate that represents the required conditiondescription
- a function that supplies an exception describing
the condition that was not metpublic Assertions.Builder requireSubject(String subject, String... otherSubjects)
Assertions.Builder
requireSubject
in interface Assertions.Builder
subject
- subject to matchotherSubjects
- other subjects to allowpublic Assertions.Builder requireSubjectSatisfies(Predicate<String> condition, Function<String,JWTAssertionFailedException> errorSupplier)
Assertions.Builder
requireSubjectSatisfies
in interface Assertions.Builder
condition
- predicate that represents the required conditionerrorSupplier
- a function that supplies an exception describing
the condition that was not metpublic Assertions.Builder requireEquals(String name, Object value, Object... otherValues)
Assertions.Builder
requireEquals
in interface Assertions.Builder
name
- name of the claim to testvalue
- value to matchotherValues
- other values to allowpublic Assertions.Builder requireContains(String name, Object value, Object... otherValues)
Assertions.Builder
requireContains
in interface Assertions.Builder
name
- name of the claim to testvalue
- value to matchotherValues
- other values to allowpublic final <T> Assertions.Builder requireSatisfies(String name, Class<? extends T> type, Predicate<T> condition, Function<T,JWTAssertionFailedException> errorSupplier)
Assertions.Builder
requireSatisfies
in interface Assertions.Builder
name
- name of the claim to testtype
- type to which the claim value will be coercedcondition
- predicate that represents the required conditionerrorSupplier
- a function that supplies an exception describing
the condition that was not metpublic final Assertions.Builder requireInstantSatisfies(String name, BiPredicate<Instant,Clock> condition, BiFunction<Instant,Clock,JWTAssertionFailedException> errorSupplier)
Assertions.Builder
requireInstantSatisfies
in interface Assertions.Builder
name
- name of the claim to testcondition
- bi-predicate that represents a condition to be
evaluated about an instant relative to a reference clockerrorSupplier
- a bi-function that supplies an exception describing
the condition that was not metpublic Assertions.Builder requirePublicKeyInfoSatisfies(String name, BiPredicate<String,PublicKeyInfo> condition, BiFunction<String,PublicKeyInfo,JWTAssertionFailedException> errorSupplier)
Assertions.Builder
requirePublicKeyInfoSatisfies
in interface Assertions.Builder
name
- name of a string-valued claim to pass to the conditioncondition
- the condition to satisfyerrorSupplier
- a function that supplies an exception describing
the condition that was not metpublic Assertions.Builder requirePublicKeyInfoSatisfies(Predicate<PublicKeyInfo> condition, Function<PublicKeyInfo,JWTAssertionFailedException> errorSupplier)
Assertions.Builder
requirePublicKeyInfoSatisfies
in interface Assertions.Builder
condition
- the condition to satisfyerrorSupplier
- a function that supplies an exception describing
the condition that was not metpublic BiPredicateAssertions build()
Assertions.Builder
build
in interface Assertions.Builder
Copyright © 2019. All rights reserved.