Interface TokenTrust
- All Known Implementing Classes:
TokenTrust.Pinned
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Decides whether the token in an offer's identity assertion is trusted.
This is only the first half of validating an offer. Whichever policy is chosen, the assertion's
detached JWS over the SDP fingerprints is still verified against the token's cpk, which
is what ties the identity to the DTLS certificate the peer presents.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classAccepts a token signed by, and naming, one of a fixed set of keys.static final classHolder so the shared consumer is built once. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TokenTrustReads the claims without checking who signed the token, for peers that cannot present a Minecraft-issued one, such as another proxy in the same fleet.static final TokenTrustVerifies the token against Minecraft's authorization service, which is what a retail client presents. -
Method Summary
Modifier and TypeMethodDescriptionorg.jose4j.jwt.JwtClaimsstatic TokenTrustTrusts only a token signed by one ofkeysthat also names that key as itscpk.default voidprepare()Does whatever makes the firstclaims(org.cloudburstmc.netty.util.nethernet.Identity)call fast, such as fetching keys.
-
Field Details
-
MINECRAFT_AUTH
Verifies the token against Minecraft's authorization service, which is what a retail client presents. This is the default. -
ANY
Reads the claims without checking who signed the token, for peers that cannot present a Minecraft-issued one, such as another proxy in the same fleet.The
cpkbinding still applies, so the peer must hold the key its token names, and the token must carry an expiry and be within it. Neither bounds what the token says: the peer signs its own, soxid,xnameand the expiry itself are whatever it chose. Nothing here establishes who the peer is, so pair it with an identity check of your own.
-
-
Method Details
-
pinnedTo
Trusts only a token signed by one ofkeysthat also names that key as itscpk. This is how a client confirms a server it knows: pin the public key of the identity the server answers with. A server's own token carries no expiry and none is required here, the key is the anchor; an expiry that is present still has to be current.- Parameters:
keys- The public keys to accept, more than one across a rotation- Returns:
- The trust
-
claims
- Parameters:
identity- The identity taken from the offer- Returns:
- The token's claims, which must include
cpk - Throws:
Exception- If the token is not trusted
-
prepare
default void prepare()Does whatever makes the firstclaims(org.cloudburstmc.netty.util.nethernet.Identity)call fast, such as fetching keys. Called once when signaling binds, off the event loop, and expected to swallow its own failures.
-