mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-04-27 11:56:05 +02:00
Merge pull request #46 from tauri-apps/fix/clippy
fix: make clippy 1.66 happy
This commit is contained in:
@@ -75,8 +75,8 @@ pub fn register(application: String, timeout: u64, challenge: String) -> crate::
|
||||
|
||||
let (key_handle, public_key) =
|
||||
_u2f_get_key_handle_and_public_key_from_register_response(®ister_data).unwrap();
|
||||
let key_handle_base64 = encode_config(&key_handle, URL_SAFE_NO_PAD);
|
||||
let public_key_base64 = encode_config(&public_key, URL_SAFE_NO_PAD);
|
||||
let key_handle_base64 = encode_config(key_handle, URL_SAFE_NO_PAD);
|
||||
let public_key_base64 = encode_config(public_key, URL_SAFE_NO_PAD);
|
||||
let register_data_base64 = encode_config(®ister_data, URL_SAFE_NO_PAD);
|
||||
println!("Key Handle: {}", &key_handle_base64);
|
||||
println!("Public Key: {}", &public_key_base64);
|
||||
@@ -108,7 +108,7 @@ pub fn sign(
|
||||
challenge: String,
|
||||
key_handle: String,
|
||||
) -> crate::Result<String> {
|
||||
let credential = match decode_config(&key_handle, URL_SAFE_NO_PAD) {
|
||||
let credential = match decode_config(key_handle, URL_SAFE_NO_PAD) {
|
||||
Ok(v) => v,
|
||||
Err(e) => {
|
||||
return Err(e.into());
|
||||
@@ -152,7 +152,7 @@ pub fn sign(
|
||||
|
||||
let (_, handle_used, sign_data, device_info) = sign_result.unwrap();
|
||||
|
||||
let sig = encode_config(&sign_data, URL_SAFE_NO_PAD);
|
||||
let sig = encode_config(sign_data, URL_SAFE_NO_PAD);
|
||||
|
||||
println!("Sign result: {}", sig);
|
||||
println!(
|
||||
|
||||
@@ -15,7 +15,7 @@ static VERSION: &str = "U2F_V2";
|
||||
pub fn make_challenge(app_id: &str, challenge_bytes: Vec<u8>) -> Challenge {
|
||||
let utc: DateTime<Utc> = Utc::now();
|
||||
Challenge {
|
||||
challenge: encode_config(&challenge_bytes, URL_SAFE_NO_PAD),
|
||||
challenge: encode_config(challenge_bytes, URL_SAFE_NO_PAD),
|
||||
timestamp: format!("{:?}", utc),
|
||||
app_id: app_id.to_string(),
|
||||
}
|
||||
@@ -35,10 +35,10 @@ pub fn verify_registration(
|
||||
register_data: String,
|
||||
client_data: String,
|
||||
) -> crate::Result<String> {
|
||||
let challenge_bytes = decode_config(&challenge, URL_SAFE_NO_PAD)?;
|
||||
let challenge_bytes = decode_config(challenge, URL_SAFE_NO_PAD)?;
|
||||
let challenge = make_challenge(&app_id, challenge_bytes);
|
||||
let client_data_bytes: Vec<u8> = client_data.as_bytes().into();
|
||||
let client_data_base64 = encode_config(&client_data_bytes, URL_SAFE_NO_PAD);
|
||||
let client_data_base64 = encode_config(client_data_bytes, URL_SAFE_NO_PAD);
|
||||
let client = U2f::new(app_id);
|
||||
match client.register_response(
|
||||
challenge,
|
||||
@@ -74,12 +74,12 @@ pub fn verify_signature(
|
||||
key_handle: String,
|
||||
pub_key: String,
|
||||
) -> crate::Result<u32> {
|
||||
let challenge_bytes = decode_config(&challenge, URL_SAFE_NO_PAD)?;
|
||||
let challenge_bytes = decode_config(challenge, URL_SAFE_NO_PAD)?;
|
||||
let chal = make_challenge(&app_id, challenge_bytes);
|
||||
let client_data_bytes: Vec<u8> = client_data.as_bytes().into();
|
||||
let client_data_base64 = encode_config(&client_data_bytes, URL_SAFE_NO_PAD);
|
||||
let client_data_base64 = encode_config(client_data_bytes, URL_SAFE_NO_PAD);
|
||||
let key_handle_bytes = decode_config(&key_handle, URL_SAFE_NO_PAD)?;
|
||||
let pubkey_bytes = decode_config(&pub_key, URL_SAFE_NO_PAD)?;
|
||||
let pubkey_bytes = decode_config(pub_key, URL_SAFE_NO_PAD)?;
|
||||
let client = U2f::new(app_id);
|
||||
let mut _counter: u32 = 0;
|
||||
match client.sign_response(
|
||||
|
||||
@@ -56,13 +56,13 @@ pub fn init<R: Runtime>() -> TauriPlugin<R> {
|
||||
.unwrap_or_default();
|
||||
for allowed in scope.allowed_paths {
|
||||
// allows the path as is
|
||||
let _ = fs_scope.allow_file(&allowed);
|
||||
let _ = fs_scope.allow_file(allowed);
|
||||
#[cfg(feature = "protocol-asset")]
|
||||
let _ = asset_protocol_scope.allow_file(allowed);
|
||||
}
|
||||
for forbidden in scope.forbidden_patterns {
|
||||
// forbid the path as is
|
||||
let _ = fs_scope.forbid_file(&forbidden);
|
||||
let _ = fs_scope.forbid_file(forbidden);
|
||||
#[cfg(feature = "protocol-asset")]
|
||||
let _ = asset_protocol_scope.forbid_file(forbidden);
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ impl Store {
|
||||
.expect("failed to resolve app dir");
|
||||
let store_path = app_dir.join(&self.path);
|
||||
|
||||
let bytes = read(&store_path)?;
|
||||
let bytes = read(store_path)?;
|
||||
|
||||
self.cache = (self.deserialize)(&bytes).map_err(Error::Deserialize)?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user