Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions openstack_cli/src/identity/v4/user/passkey/register.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,9 @@ fn convert_api_response_to_public_key_credential_options(
.map(|ecs| {
ecs.into_iter()
.map(convert_exclude_credential)
//.transpose()?
.collect::<Result<Vec<_>, _>>()
})
.transpose()?, //.collect::<Vec<_>>()
.transpose()?,
extensions: val.extensions.map(convert_extension),
hints: val
.hints
Expand Down Expand Up @@ -337,13 +336,13 @@ fn convert_credential_protection_policy(
val: register::CredentialProtectionPolicy,
) -> webauthn_rs_proto::extensions::CredentialProtectionPolicy {
match val {
register::CredentialProtectionPolicy::Userverificationoptional => {
register::CredentialProtectionPolicy::Optional => {
webauthn_rs_proto::extensions::CredentialProtectionPolicy::UserVerificationOptional
}
register::CredentialProtectionPolicy::Userverificationoptionalwithcredentialidlist => {
register::CredentialProtectionPolicy::Optionalwithcredentialidlist => {
webauthn_rs_proto::extensions::CredentialProtectionPolicy::UserVerificationOptionalWithCredentialIDList
}
register::CredentialProtectionPolicy::Userverificationrequired => {
register::CredentialProtectionPolicy::Required => {
webauthn_rs_proto::extensions::CredentialProtectionPolicy::UserVerificationRequired
}
}
Expand Down Expand Up @@ -424,9 +423,9 @@ fn get_finish_registration_endpoint(
}
if let Some(val) = register_cred.extensions.cred_protect {
extensions.cred_protect(match val {
webauthn_rs_proto::extensions::CredentialProtectionPolicy::UserVerificationOptional => register_finish::CredProtect::Userverificationoptional,
webauthn_rs_proto::extensions::CredentialProtectionPolicy::UserVerificationOptionalWithCredentialIDList => register_finish::CredProtect::Userverificationoptionalwithcredentialidlist,
webauthn_rs_proto::extensions::CredentialProtectionPolicy::UserVerificationRequired => register_finish::CredProtect::Userverificationrequired,
webauthn_rs_proto::extensions::CredentialProtectionPolicy::UserVerificationOptional => register_finish::CredProtect::Optional,
webauthn_rs_proto::extensions::CredentialProtectionPolicy::UserVerificationOptionalWithCredentialIDList => register_finish::CredProtect::Optionalwithcredentialidlist,
webauthn_rs_proto::extensions::CredentialProtectionPolicy::UserVerificationRequired => register_finish::CredProtect::Required,
});
}
if let Some(val) = register_cred.extensions.hmac_secret {
Expand Down
17 changes: 6 additions & 11 deletions openstack_sdk/src/api/identity/v4/user/passkey/register_finish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ pub struct CredProps {

#[derive(Debug, Deserialize, Clone, Serialize)]
pub enum CredProtect {
#[serde(rename = "UserVerificationOptional")]
Userverificationoptional,
#[serde(rename = "UserVerificationOptionalWithCredentialIDList")]
Userverificationoptionalwithcredentialidlist,
#[serde(rename = "UserVerificationRequired")]
Userverificationrequired,
#[serde(rename = "Optional")]
Optional,
#[serde(rename = "OptionalWithCredentialIDList")]
Optionalwithcredentialidlist,
#[serde(rename = "Required")]
Required,
}

/// <https://w3c.github.io/webauthn/#dictdef-authenticationextensionsclientoutputs>
Expand Down Expand Up @@ -238,11 +238,6 @@ impl RestEndpoint for Request<'_> {
fn request_headers(&self) -> Option<&HeaderMap> {
self._headers.as_ref()
}

/// Returns required API version
fn api_version(&self) -> Option<ApiVersion> {
Some(ApiVersion::new(4, 0))
}
}

#[cfg(test)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,6 @@ impl RestEndpoint for Request<'_> {
fn request_headers(&self) -> Option<&HeaderMap> {
self._headers.as_ref()
}

/// Returns required API version
fn api_version(&self) -> Option<ApiVersion> {
Some(ApiVersion::new(4, 0))
}
}

#[cfg(test)]
Expand Down
1 change: 0 additions & 1 deletion openstack_sdk/src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
use http::{HeaderMap, HeaderValue};

use std::fmt::{self, Debug};
use tracing::error;

use thiserror::Error;

Expand Down
2 changes: 1 addition & 1 deletion openstack_sdk/src/auth/authtoken.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use std::str::FromStr;
use http::{HeaderMap, HeaderName, HeaderValue};
use serde::{Deserialize, Serialize};
use thiserror::Error;
use tracing::{debug, error, trace};
use tracing::{debug, trace};

use crate::api::identity::v3::auth::token::get as token_v3_info;
use crate::api::RestEndpoint;
Expand Down
1 change: 0 additions & 1 deletion openstack_sdk/src/auth/authtoken_scope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ use std::fmt::Debug;

use serde::{Deserialize, Serialize};
use thiserror::Error;
use tracing::error;

use crate::auth::auth_token_endpoint as token_v3;
use crate::auth::authtoken::AuthTokenError;
Expand Down
1 change: 0 additions & 1 deletion openstack_sdk/src/auth/v3oidcaccesstoken.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ use http::{header, HeaderMap, HeaderName, HeaderValue};
use secrecy::ExposeSecret;
use std::borrow::Cow;
use thiserror::Error;
use tracing::error;

use crate::api::RestEndpoint;
use crate::auth::auth_helper::AuthHelper;
Expand Down
1 change: 0 additions & 1 deletion openstack_sdk/src/auth/v4jwt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ use http::{header, HeaderMap, HeaderName, HeaderValue};
use secrecy::{ExposeSecret, SecretString};
use std::borrow::Cow;
use thiserror::Error;
use tracing::error;

use crate::api::rest_endpoint_prelude::*;
use crate::api::RestEndpoint;
Expand Down
1 change: 0 additions & 1 deletion openstack_sdk/src/auth/v4passkey/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
//!

use thiserror::Error;
use tracing::error;

use super::finish;
use super::start;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,28 +297,26 @@ pub struct ExcludeCredentials {

#[derive(Debug, Deserialize, Clone, Serialize)]
pub enum CredentialProtectionPolicy {
// Userverificationoptional
#[serde(rename = "UserVerificationOptional")]
Userverificationoptional,
// Optional
#[serde(rename = "Optional")]
Optional,

// Userverificationoptionalwithcredentialidlist
#[serde(rename = "UserVerificationOptionalWithCredentialIDList")]
Userverificationoptionalwithcredentialidlist,
// Optionalwithcredentialidlist
#[serde(rename = "OptionalWithCredentialIDList")]
Optionalwithcredentialidlist,

// Userverificationrequired
#[serde(rename = "UserVerificationRequired")]
Userverificationrequired,
// Required
#[serde(rename = "Required")]
Required,
}

impl std::str::FromStr for CredentialProtectionPolicy {
type Err = ();
fn from_str(input: &str) -> Result<Self, Self::Err> {
match input {
"UserVerificationOptional" => Ok(Self::Userverificationoptional),
"UserVerificationOptionalWithCredentialIDList" => {
Ok(Self::Userverificationoptionalwithcredentialidlist)
}
"UserVerificationRequired" => Ok(Self::Userverificationrequired),
"Optional" => Ok(Self::Optional),
"OptionalWithCredentialIDList" => Ok(Self::Optionalwithcredentialidlist),
"Required" => Ok(Self::Required),
_ => Err(()),
}
}
Expand Down