Skip to content

Commit

Permalink
chore: remove all lints
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuthor committed Nov 4, 2024
1 parent 1ed27b9 commit 90d1e81
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 22 deletions.
3 changes: 2 additions & 1 deletion crate/cli/src/actions/permissions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ impl CreateIndex {
/// grant:
/// * `read` permission: the user can only read the index
/// * `write` permission: the user can read and write the index
/// * `admin` permission: the user can read, write and grant permission to the index
/// * `admin` permission: the user can read, write and grant permission to the
/// index
#[derive(Parser, Debug)]
pub struct GrantPermission {
/// The user identifier to allow
Expand Down
2 changes: 0 additions & 2 deletions crate/cli/src/tests/permissions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ pub(crate) fn create_index_id_cmd(cli_conf_path: &str) -> CliResult<String> {
))
}

#[allow(dead_code)]
pub(crate) fn grant_permission_cmd(
cli_conf_path: &str,
action: GrantPermission,
Expand Down Expand Up @@ -76,7 +75,6 @@ pub(crate) fn grant_permission_cmd(
))
}

#[allow(dead_code)]
pub(crate) fn revoke_permission_cmd(
cli_conf_path: &str,
action: RevokePermission,
Expand Down
1 change: 0 additions & 1 deletion crate/server/src/core/implementation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ impl FindexServer {
user
}

#[allow(dead_code)]
#[instrument(ret(Display), err, skip(self))]
pub(crate) async fn get_permission(
&self,
Expand Down
1 change: 0 additions & 1 deletion crate/server/src/database/database_trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,5 @@ pub(crate) trait Database: Sync + Send {
index_id: &Uuid,
) -> FResult<()>;

#[allow(dead_code)]
async fn revoke_permission(&self, user_id: &str, index_id: &Uuid) -> FResult<()>;
}
2 changes: 0 additions & 2 deletions crate/server/src/database/redis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ fn build_key(index_id: &Uuid, table: FindexTable, uid: &[u8]) -> Vec<u8> {
[index_id.as_bytes().as_ref(), &[0x00, u8::from(table)], uid].concat()
}

#[allow(dead_code)]
pub(crate) struct Redis {
mgr: ConnectionManager,
upsert_script: Script,
Expand Down Expand Up @@ -282,7 +281,6 @@ impl Database for Redis {
Permissions::deserialize(&serialized_value)
}

#[allow(dead_code)]
#[instrument(ret(Display), err, skip(self))]
async fn get_permission(&self, user_id: &str, index_id: &Uuid) -> FResult<Permission> {
let permissions = self.get_permissions(user_id).await?;
Expand Down
13 changes: 0 additions & 13 deletions crate/server/src/middlewares/jwt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,6 @@ pub(crate) struct UserClaim {
pub google_email: Option<String>,
}

#[derive(Debug, Deserialize)]
#[allow(dead_code)]
pub(crate) struct JwtTokenHeaders {
typ: Option<String>,
cty: Option<String>,
alg: Option<String>,
kid: Option<String>,
x5t: Option<String>,
x5u: Option<String>,
x5c: Option<Vec<String>>,
crit: Option<String>,
}

#[derive(Debug)]
pub(crate) struct JwtConfig {
pub jwt_issuer_uri: String,
Expand Down
4 changes: 2 additions & 2 deletions crate/server/src/routes/permissions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ pub(crate) async fn grant_permission(
if Permission::Admin != user_permission {
return Err(FindexServerError::Unauthorized(format!(
"Delegating permission to an index requires an admin permission. User {user} with \
permission {user_permission} does not allow granting permission to index {index_id} with \
permission {permission}",
permission {user_permission} does not allow granting permission to index {index_id} \
with permission {permission}",
)));
}

Expand Down

0 comments on commit 90d1e81

Please sign in to comment.