feat: key bans #130

Merged
treadful merged 9 commits from feat/key-bans into main 2026-06-27 03:26:39 +00:00
Owner

refactor: introduces ShortId type
refactor(server): minor init process cleanup

Implements: #128

refactor: introduces `ShortId` type refactor(server): minor init process cleanup Implements: #128
feat: key bans
Some checks failed
/ test-and-check (pull_request) Failing after 17m31s
0598ae0a35
refactor: introduces ShortId type
refactor(server): minor init process cleanup
fix(test): update tests for API changes
All checks were successful
/ test-and-check (pull_request) Successful in 19m42s
863d6d7d88
refactor: Reworks access control, now key bans are also updated in memory
All checks were successful
/ test-and-check (pull_request) Successful in 18m4s
17b25762ab
feat: jot mod key bans
All checks were successful
/ test-and-check (pull_request) Successful in 19m30s
cf1d07d638
feat: implements key unbans
All checks were successful
/ test-and-check (pull_request) Successful in 18m28s
1221b6a5f3
fix(server): key bans endpoint improperly filtering by expire
All checks were successful
/ test-and-check (pull_request) Successful in 18m49s
9ab3953453
@ -261,0 +273,4 @@
Ban {
/// When the ban should expire (unless indefinite)
#[arg(short, long, value_parser = parse_to_future_timestamp)]
expire: Option<Timestamp>,
Author
Owner

until?

until?
treadful marked this conversation as resolved
@ -10,6 +10,177 @@ use crate::cli::out;
use crate::conf::Conf;
use crate::keys::Keys;
/// Get the latest audit log entries
Author
Owner

bad docstring

bad docstring
treadful marked this conversation as resolved
@ -13,0 +96,4 @@
}
}
/// Get the key bans
Author
Owner

show?

show?
treadful marked this conversation as resolved
@ -0,0 +66,4 @@
(*self.deny.lock().await).remove(short_id)
}
/// Determine if the given key_id is allowed to upload to the server
Author
Owner

*to operate

*to operate
treadful marked this conversation as resolved
@ -64,0 +75,4 @@
async fn key_unban(&self, short_id: ShortId) -> DatabaseResult<()>;
/// Get all key bans from the DB
async fn get_key_bans(&self) -> DatabaseResult<Vec<KeyBan>>;
Author
Owner

order of defs

order of defs
treadful marked this conversation as resolved
@ -459,0 +460,4 @@
},
None => None,
};
let adl = match &root_short_id_maybe {
Author
Owner

adl_maybe

adl_maybe
treadful marked this conversation as resolved
@ -463,3 +486,3 @@
// Bind server to port 8000 by default
let acceptor =
let listener =
Author
Owner

acceptor

acceptor
treadful marked this conversation as resolved
@ -16,0 +20,4 @@
debug!(error = err.to_string(), "Failed to decode short_id");
return Err(ResponseError::NotFound);
}
};
Author
Owner

Can impl From<ShortId::Error> for ResponseError {}?

Can `impl From<ShortId::Error> for ResponseError {}`?
treadful marked this conversation as resolved
@ -16,0 +19,4 @@
Err(_) => {
return Err(ResponseError::NotFound);
}
};
Author
Owner

map_err?

map_err?
treadful marked this conversation as resolved
@ -161,2 +166,4 @@
}
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
pub struct ShortId(String);
Author
Owner

could use a docstring

could use a docstring
treadful marked this conversation as resolved
@ -163,0 +219,4 @@
// full hex pubkey
val = val[2..9].to_string()
} else {
if vlen != 7 {
Author
Owner

else if?

else if?
treadful marked this conversation as resolved
treadful changed title from WIP: feat: key bans to feat: key bans 2026-06-26 21:38:24 +00:00
treadful deleted branch feat/key-bans 2026-06-27 03:26:39 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
treadful/jot!130
No description provided.