pub struct ClientCertificateDer(pub Vec<u8>);Expand description
The DER-encoded bytes of a client certificate presented on the current connection.
Neither authkestra-op nor authkestra-resource terminates TLS itself,
so nothing in this crate family populates a ClientCertificateDer
automatically. A host application — or the mTLS-terminating layer it
runs in front of/alongside its service (a reverse proxy, an
axum-server/actix-web rustls acceptor configured to require and expose
client certificates, etc.) — is responsible for extracting the peer
certificate and handing its DER bytes to this crate:
- On the OP side,
authkestra-axum’saxum_token_handlerreads one back out of anaxum::Extension<ClientCertificateDer>(so a host inserts it as a request extension via its own middleware/acceptor), andauthkestra-actix’sactix_token_handlerreads one out of the actix request’s own extension map the same way. Both then forward the DER bytes intohandle_token_with_client_cert. - On the resource-server side,
JwtStrategy::authenticatelooks one up in thehttp::request::Partsextension map it is handed, whenValidationConfig::require_cert_bindingis set.
If nothing ever inserts one, callers simply see None throughout, and
client_credentials tokens are issued as plain (unbound) bearer tokens,
same as before this existed.
§The source of these bytes is the entire security boundary
Inserting a ClientCertificateDer from a source that has not
cryptographically verified the certificate — i.e. actually terminated
mTLS and validated the chain — provides no security benefit and a false
sense of one.
Nothing here parses X.509, validates a chain, or checks that these bytes
are even DER; x5t_s256_thumbprint hashes whatever it is handed. So a
binding built from, say, a reverse-proxy header that relays a
client-supplied value the proxy never verified degrades to “proof that
the caller knows a byte string the caller chose” — while looking
identical to a real RFC 8705 binding: a cnf.x5t#S256 claim is present
and require_cert_binding accepts it. Issuance and verification trust the
same extension, so both fail together, and silently.
Tuple Fields§
§0: Vec<u8>Trait Implementations§
Source§impl Clone for ClientCertificateDer
impl Clone for ClientCertificateDer
Source§fn clone(&self) -> ClientCertificateDer
fn clone(&self) -> ClientCertificateDer
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ClientCertificateDer
impl Debug for ClientCertificateDer
impl Eq for ClientCertificateDer
Source§impl PartialEq for ClientCertificateDer
impl PartialEq for ClientCertificateDer
impl StructuralPartialEq for ClientCertificateDer
Auto Trait Implementations§
impl Freeze for ClientCertificateDer
impl RefUnwindSafe for ClientCertificateDer
impl Send for ClientCertificateDer
impl Sync for ClientCertificateDer
impl Unpin for ClientCertificateDer
impl UnsafeUnpin for ClientCertificateDer
impl UnwindSafe for ClientCertificateDer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.