Skip to content

Commit 52da246

Browse files
Rename authenticator_config to config
For consistency with the other commands, this patch renames authenticator_config/AuthenticatorConfig to config/Config. Fixes: #79
1 parent b8ec306 commit 52da246

4 files changed

Lines changed: 14 additions & 14 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
[Unreleased]: https://github.com/trussed-dev/ctap-types/compare/0.6.0-rc.1...HEAD
1010

11-
-
11+
- Rename `authenticator_config` to `config`.
1212

1313
## [0.6.0-rc.1] 2026-05-21
1414

src/arbitrary.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ impl<'a> Arbitrary<'a> for ctap2::make_credential::ExtensionsInput<'a> {
322322
}
323323

324324
// cannot be derived because of missing impl for Vec<&'a str, N> (rp ID list).
325-
impl<'a> Arbitrary<'a> for ctap2::authenticator_config::SubcommandParameters<'a> {
325+
impl<'a> Arbitrary<'a> for ctap2::config::SubcommandParameters<'a> {
326326
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self> {
327327
let new_min_pin_length = u.arbitrary()?;
328328
let min_pin_length_rp_ids = arbitrary_option(u, arbitrary_vec)?;
@@ -337,7 +337,7 @@ impl<'a> Arbitrary<'a> for ctap2::authenticator_config::SubcommandParameters<'a>
337337

338338
// cannot be derived because of missing impl for &'a serde_bytes::Bytes (pin_auth)
339339
// + Vec<_> in SubcommandParameters.
340-
impl<'a> Arbitrary<'a> for ctap2::authenticator_config::Request<'a> {
340+
impl<'a> Arbitrary<'a> for ctap2::config::Request<'a> {
341341
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self> {
342342
let sub_command = u.arbitrary()?;
343343
let sub_command_params = u.arbitrary()?;

src/ctap2.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ use crate::{sizes::*, Bytes, TryFromStrError};
1111

1212
pub use crate::operation::{Operation, VendorOperation};
1313

14-
pub mod authenticator_config;
1514
pub mod client_pin;
15+
pub mod config;
1616
pub mod credential_management;
1717
pub mod get_assertion;
1818
pub mod get_info;
@@ -47,7 +47,7 @@ pub enum Request<'a> {
4747
// 0xC
4848
LargeBlobs(large_blobs::Request<'a>),
4949
// 0xD
50-
AuthenticatorConfig(authenticator_config::Request<'a>),
50+
Config(config::Request<'a>),
5151
// vendor, to be embellished
5252
// Q: how to handle the associated CBOR structures
5353
Vendor(crate::operation::VendorOperation),
@@ -121,9 +121,9 @@ impl<'a> Request<'a> {
121121
Request::LargeBlobs(cbor_deserialize(data).map_err(CtapMappingError::ParsingError)?)
122122
}
123123

124-
Operation::Config => Request::AuthenticatorConfig(
125-
cbor_deserialize(data).map_err(CtapMappingError::ParsingError)?,
126-
),
124+
Operation::Config => {
125+
Request::Config(cbor_deserialize(data).map_err(CtapMappingError::ParsingError)?)
126+
}
127127

128128
// NB: FIDO Alliance "stole" 0x40 and 0x41, so these are not available
129129
Operation::Vendor(vendor_operation) => Request::Vendor(vendor_operation),
@@ -150,7 +150,7 @@ pub enum Response {
150150
Selection,
151151
CredentialManagement(credential_management::Response),
152152
LargeBlobs(large_blobs::Response),
153-
AuthenticatorConfig,
153+
Config,
154154
// Q: how to handle the associated CBOR structures
155155
Vendor,
156156
}
@@ -169,7 +169,7 @@ impl Response {
169169
GetAssertion(response) | GetNextAssertion(response) => cbor_serialize(response, data),
170170
CredentialManagement(response) => cbor_serialize(response, data),
171171
LargeBlobs(response) => cbor_serialize(response, data),
172-
Reset | Selection | AuthenticatorConfig | Vendor => Ok([].as_slice()),
172+
Reset | Selection | Config | Vendor => Ok([].as_slice()),
173173
};
174174
if let Ok(slice) = outcome {
175175
*status = 0;
@@ -453,7 +453,7 @@ pub trait Authenticator {
453453
Err(Error::InvalidCommand)
454454
}
455455

456-
fn authenticator_config(&mut self, request: &authenticator_config::Request) -> Result<()> {
456+
fn config(&mut self, request: &config::Request) -> Result<()> {
457457
let _ = request;
458458
Err(Error::InvalidCommand)
459459
}
@@ -547,12 +547,12 @@ pub trait Authenticator {
547547
}
548548

549549
// 0xD
550-
Request::AuthenticatorConfig(request) => {
550+
Request::Config(request) => {
551551
debug_now!("CTAP2.CFG");
552-
self.authenticator_config(request).inspect_err(|_e| {
552+
self.config(request).inspect_err(|_e| {
553553
debug!("error: {:?}", _e);
554554
})?;
555-
Ok(Response::AuthenticatorConfig)
555+
Ok(Response::Config)
556556
}
557557

558558
// Not stable

0 commit comments

Comments
 (0)