Skip to content

Commit e8ac801

Browse files
authored
Validate location address (#2388)
1 parent 0e73c4e commit e8ac801

71 files changed

Lines changed: 1271 additions & 1676 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.sqlx/query-c58c7b4dc7463a93895b17d591e3e4a83ac3623590674e47bb1a1dbf9c25d77f.json

Lines changed: 0 additions & 152 deletions
This file was deleted.

Cargo.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/defguard_common/src/db/models/auth_code.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,7 @@ impl From<AuthCode<Id>> for AuthCode<NoId> {
6666
impl AuthCode<Id> {
6767
/// Find by code.
6868
/// If found, delete `AuthCode` from the database right away, so it can't be reused.
69-
pub async fn find_code<'e, E>(
70-
executor: E,
71-
code: &str,
72-
) -> Result<Option<AuthCode<NoId>>, sqlx::Error>
69+
pub async fn find_code<'e, E>(executor: E, code: &str) -> sqlx::Result<Option<AuthCode<NoId>>>
7370
where
7471
E: PgExecutor<'e>,
7572
{

crates/defguard_common/src/db/models/authentication_key.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::fmt::Display;
22

33
use model_derive::Model;
44
use serde::{Deserialize, Serialize};
5-
use sqlx::{Error as SqlxError, PgExecutor, Type, query_as};
5+
use sqlx::{PgExecutor, Type, query_as};
66

77
use crate::db::{Id, NoId};
88

@@ -60,7 +60,7 @@ impl AuthenticationKey<Id> {
6060
executor: E,
6161
user_id: Id,
6262
key_type: Option<AuthenticationKeyType>,
63-
) -> Result<Vec<Self>, SqlxError>
63+
) -> sqlx::Result<Vec<Self>>
6464
where
6565
E: PgExecutor<'e>,
6666
{

crates/defguard_common/src/db/models/biometric_auth.rs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,7 @@ impl BiometricAuth {
5757
}
5858

5959
impl BiometricAuth<Id> {
60-
pub async fn find_by_device_id<'e, E>(
61-
executor: E,
62-
device_id: Id,
63-
) -> Result<Option<Self>, sqlx::Error>
60+
pub async fn find_by_device_id<'e, E>(executor: E, device_id: Id) -> sqlx::Result<Option<Self>>
6461
where
6562
E: PgExecutor<'e>,
6663
{
@@ -73,11 +70,7 @@ impl BiometricAuth<Id> {
7370
.await
7471
}
7572

76-
pub async fn verify_owner<'e, E>(
77-
executor: E,
78-
user_id: Id,
79-
pub_key: &str,
80-
) -> Result<bool, sqlx::Error>
73+
pub async fn verify_owner<'e, E>(executor: E, user_id: Id, pub_key: &str) -> sqlx::Result<bool>
8174
where
8275
E: PgExecutor<'e>,
8376
{
@@ -91,7 +84,7 @@ impl BiometricAuth<Id> {
9184
Ok(q_result.is_some())
9285
}
9386

94-
pub async fn find_by_user_id<'e, E>(executor: E, user_id: Id) -> Result<Vec<Self>, sqlx::Error>
87+
pub async fn find_by_user_id<'e, E>(executor: E, user_id: Id) -> sqlx::Result<Vec<Self>>
9588
where
9689
E: PgExecutor<'e>,
9790
{

0 commit comments

Comments
 (0)