Class PrincipalScopedPartitionKey
- java.lang.Object
-
- org.asynchttpclient.netty.channel.PrincipalScopedPartitionKey
-
public final class PrincipalScopedPartitionKey extends Object
Channel-pool partition key for schemes that authenticate the connection rather than the request.NTLM and Negotiate complete a handshake once and the server then treats every later request arriving on that socket as coming from the identity that authenticated it. The regular partition key describes only where the connection goes, so a socket one principal authenticated could be handed to a request belonging to another, and the server would serve it as the first principal. Nothing on the wire shows the identity changed, because the second request carries no authentication headers of its own.
Folding the principal into the key keeps those connections separated. Basic and Digest need no such thing: they authenticate each request and their credentials travel with it.
If a site that offers a connection to the pool and a site that polls for one ever disagree about whether to scope, the poll simply misses and a new connection is opened. That costs reuse, never correctness, which is the right way round for this to fail.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)inthashCode()static Objectscope(Object baseKey, Realm realm)WrapsbaseKeywith the authenticated identity whenrealmuses a scheme that authenticates the connection, and returnsbaseKeyunchanged otherwise.StringtoString()
-