AuthRequiredError and DynamicTransportError were marked #[non_exhaustive] in #715 / #768, but neither has a constructor usable by external crates. Same situation as StoredCredentials (#777, fixed in #778).
AuthRequiredError has no constructor at all. External crates testing auth error handling paths (e.g. verifying that should_attempt_oauth_fallback correctly detects auth challenges) can't construct test fixtures without a serde roundtrip.
DynamicTransportError has ::new<T: Transport<R>>(), but it requires a real Transport impl as a type parameter. This makes it unusable for test fixtures that need a fake transport name and type ID.
We ran into both of these in block/goose after bumping to rmcp 1.4.0 (the same upgrade that surfaced the StoredCredentials issue).
Suggested fixes:
impl AuthRequiredError {
pub fn new(www_authenticate_header: String) -> Self {
Self { www_authenticate_header }
}
}
impl DynamicTransportError {
pub fn from_parts(
transport_name: impl Into<Cow<'static, str>>,
transport_type_id: std::any::TypeId,
error: Box<dyn std::error::Error + Send + Sync>,
) -> Self {
Self { transport_name: transport_name.into(), transport_type_id, error }
}
}
AuthRequiredErrorandDynamicTransportErrorwere marked#[non_exhaustive]in #715 / #768, but neither has a constructor usable by external crates. Same situation asStoredCredentials(#777, fixed in #778).AuthRequiredErrorhas no constructor at all. External crates testing auth error handling paths (e.g. verifying thatshould_attempt_oauth_fallbackcorrectly detects auth challenges) can't construct test fixtures without a serde roundtrip.DynamicTransportErrorhas::new<T: Transport<R>>(), but it requires a realTransportimpl as a type parameter. This makes it unusable for test fixtures that need a fake transport name and type ID.We ran into both of these in block/goose after bumping to rmcp 1.4.0 (the same upgrade that surfaced the
StoredCredentialsissue).Suggested fixes: