pub struct LabelExtractor {
pub label: String,
pub ca_id: String,
pub require_cn_match: bool,
pub require_san_match: bool,
pub permitted_dns_names: Vec<String>,
pub permitted_ip_addresses: Vec<String>,
pub permitted_emails: Vec<String>,
pub csr_attributes: Vec<String>,
pub csr_template: Option<CsrTemplate>,
pub max_validity_days: Option<u32>,
pub disconnected: Option<bool>,
}Expand description
Resolved EST label configuration for the current request.
Analogous to Akamu’s CaId extractor — resolves the {label} path
segment to the corresponding EstLabelConfig entry, falling back
to the default label when no path segment is present.
§Usage
async fn handler(label: LabelExtractor, ...) -> impl IntoResponse {
let ca_id = label.ca_id();
// ...
}Fields§
§label: StringThe resolved label name (empty string for the default label).
ca_id: StringThe CA identifier to use for this label.
require_cn_match: boolWhether CN matching is required for this label (FDP_ACF.1).
require_san_match: boolWhether the authenticated identity must appear in the CSR SAN (FDP_ACF.1).
permitted_dns_names: Vec<String>Name-authorization allowlist: permitted dNSName patterns (RFC 6125).
permitted_ip_addresses: Vec<String>Name-authorization allowlist: permitted iPAddress SANs (textual form).
permitted_emails: Vec<String>Name-authorization allowlist: permitted rfc822Name patterns.
csr_attributes: Vec<String>Per-label CSR attribute OIDs (overrides global when non-empty).
csr_template: Option<CsrTemplate>Per-label CSR template (RFC 9908); None means no template.
max_validity_days: Option<u32>Per-label maximum validity (overrides CA default).
disconnected: Option<bool>Per-label disconnected mode override.
Implementations§
Source§impl LabelExtractor
impl LabelExtractor
Sourcepub fn enroll_policy(&self) -> EnrollAuthzPolicy<'_>
pub fn enroll_policy(&self) -> EnrollAuthzPolicy<'_>
Borrow this label’s enrollment-authorization policy (FDP_ACF.1).
Single source of truth for every enrollment entry point — the direct
/simpleenroll path and the CMS-EST wrappers all build the policy this
way, so identity binding and name authorization stay consistent across
transports.
Sourcepub fn resolve(
app: &AppState,
label_name: Option<&str>,
) -> Result<Self, KipukaError>
pub fn resolve( app: &AppState, label_name: Option<&str>, ) -> Result<Self, KipukaError>
Resolve a label name into its effective enrollment configuration.
This is the transport-agnostic core shared by the axum
[FromRequestParts] extractor (HTTP/CMS-EST) and the CoAP bridge
(crate::routes::coap). Centralising it here means the per-label
FDP_ACF.1 policy — identity binding and the name allowlist — resolves
identically no matter which transport carried the request, closing the
gap where EST-coaps issued certificates without applying any label
policy at all.
label_name is None/Some("") for the default (unlabeled) endpoint,
which carries no authorization policy and issues from the default CA.
§Errors
KipukaError::NotFoundwhen a non-empty label is not configured.KipukaError::Configwhen a configured label points at a CA that does not exist.
Trait Implementations§
Source§impl Clone for LabelExtractor
impl Clone for LabelExtractor
Source§fn clone(&self) -> LabelExtractor
fn clone(&self) -> LabelExtractor
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 LabelExtractor
impl Debug for LabelExtractor
Source§impl<S> FromRequestParts<S> for LabelExtractor
impl<S> FromRequestParts<S> for LabelExtractor
Auto Trait Implementations§
impl Freeze for LabelExtractor
impl RefUnwindSafe for LabelExtractor
impl Send for LabelExtractor
impl Sync for LabelExtractor
impl Unpin for LabelExtractor
impl UnsafeUnpin for LabelExtractor
impl UnwindSafe for LabelExtractor
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<S, T> FromRequest<S, ViaParts> for T
impl<S, T> FromRequest<S, ViaParts> for T
§type Rejection = <T as FromRequestParts<S>>::Rejection
type Rejection = <T as FromRequestParts<S>>::Rejection
§fn from_request(
req: Request<Body>,
state: &S,
) -> impl Future<Output = Result<T, <T as FromRequest<S, ViaParts>>::Rejection>>
fn from_request( req: Request<Body>, state: &S, ) -> impl Future<Output = Result<T, <T as FromRequest<S, ViaParts>>::Rejection>>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more