basic file sharing
This commit is contained in:
@@ -9,6 +9,10 @@ use crate::domain::{
|
||||
models::{
|
||||
auth_session::requests::FetchAuthSessionResponse,
|
||||
file::{AbsoluteFilePath, LsResponse},
|
||||
share::{
|
||||
CreateShareResponse, DeleteShareResponse, GetShareResponse, ListSharesResponse,
|
||||
ShareCatResponse, ShareLsResponse,
|
||||
},
|
||||
user::{
|
||||
ListAllUsersAndWarrensResponse, LoginUserOidcResponse, LoginUserResponse, User,
|
||||
},
|
||||
@@ -115,6 +119,57 @@ impl WarrenNotifier for NotifierDebugLogger {
|
||||
response.warren().name()
|
||||
);
|
||||
}
|
||||
|
||||
async fn warren_share_created(&self, response: &CreateShareResponse) {
|
||||
tracing::debug!(
|
||||
"[Notifier] Created share for file {} in warren {}",
|
||||
response.share().path(),
|
||||
response.share().warren_id(),
|
||||
);
|
||||
}
|
||||
|
||||
async fn warren_shares_listed(&self, response: &ListSharesResponse) {
|
||||
tracing::debug!(
|
||||
"[Notifier] Listed {} share(s) for file {} in warren {}",
|
||||
response.shares().len(),
|
||||
response.path(),
|
||||
response.warren().id(),
|
||||
);
|
||||
}
|
||||
|
||||
async fn warren_share_deleted(&self, response: &DeleteShareResponse) {
|
||||
tracing::debug!(
|
||||
"[Notifier] Deleted share {} for file {} in warren {}",
|
||||
response.share().id(),
|
||||
response.share().path(),
|
||||
response.share().warren_id(),
|
||||
);
|
||||
}
|
||||
|
||||
async fn got_warren_share(&self, response: &GetShareResponse) {
|
||||
tracing::debug!(
|
||||
"[Notifier] Got share {} from warren {}",
|
||||
response.share().id(),
|
||||
response.share().warren_id()
|
||||
);
|
||||
}
|
||||
|
||||
async fn warren_share_ls(&self, response: &ShareLsResponse) {
|
||||
tracing::debug!(
|
||||
"[Notifier] Listed {} file(s) in share {} at path {}",
|
||||
response.base().files().len(),
|
||||
response.share().id(),
|
||||
response.path()
|
||||
);
|
||||
}
|
||||
|
||||
async fn warren_share_cat(&self, response: &ShareCatResponse) {
|
||||
tracing::debug!(
|
||||
"[Notifier] Fetched file {} from share {}",
|
||||
response.path(),
|
||||
response.share().id(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
impl FileSystemNotifier for NotifierDebugLogger {
|
||||
@@ -149,6 +204,10 @@ impl FileSystemNotifier for NotifierDebugLogger {
|
||||
async fn cp(&self, path: &AbsoluteFilePath, target_path: &AbsoluteFilePath) {
|
||||
tracing::debug!("[Notifier] Copied file {} to {}", path, target_path);
|
||||
}
|
||||
|
||||
async fn stat(&self, path: &AbsoluteFilePath) {
|
||||
tracing::debug!("[Notifier] Got stats for file {}", path);
|
||||
}
|
||||
}
|
||||
|
||||
impl AuthNotifier for NotifierDebugLogger {
|
||||
@@ -368,6 +427,35 @@ impl AuthNotifier for NotifierDebugLogger {
|
||||
user.id()
|
||||
)
|
||||
}
|
||||
|
||||
async fn auth_warren_share_created(&self, user: &User, response: &CreateShareResponse) {
|
||||
tracing::debug!(
|
||||
"[Notifier] Created share for file {} in warren {} for authenticated user {}",
|
||||
response.share().path(),
|
||||
response.share().warren_id(),
|
||||
user.id(),
|
||||
);
|
||||
}
|
||||
|
||||
async fn auth_warren_shares_listed(&self, user: &User, response: &ListSharesResponse) {
|
||||
tracing::debug!(
|
||||
"[Notifier] Listed {} share(s) for file {} in warren {} for authenticated user {}",
|
||||
response.shares().len(),
|
||||
response.path(),
|
||||
response.warren().id(),
|
||||
user.id(),
|
||||
);
|
||||
}
|
||||
|
||||
async fn auth_warren_share_deleted(&self, user: &User, response: &DeleteShareResponse) {
|
||||
tracing::debug!(
|
||||
"[Notifier] Deleted share {} for file {} in warren {} for authenticated user {}",
|
||||
response.share().id(),
|
||||
response.share().path(),
|
||||
response.share().warren_id(),
|
||||
user.id(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
impl OidcNotifier for NotifierDebugLogger {
|
||||
|
||||
Reference in New Issue
Block a user