Proxy Shared User Drafts

This commit is contained in:
Alexey
2026-09-14 20:19:48 +03:00
parent b37f1ebdeb
commit 0ac236955a
59 changed files with 1485 additions and 401 deletions
+15 -1
View File
@@ -69,7 +69,10 @@ impl WebProcessRuntime {
let Some(entry) = state.bootstraps.get(&bootstrap_hash) else {
return Err(ManagerError::Authentication);
};
if entry.profile.host != host || now > entry.expires_at {
if entry.profile.host != host
|| now > entry.expires_at
|| entry.user_registration.is_cancelled()
{
return Err(ManagerError::Authentication);
}
if entry.used {
@@ -301,6 +304,15 @@ impl WebProcessRuntime {
return Err(ManagerError::Protocol);
};
let _operator_admission = self.try_operator_admission()?;
let Some(mut user_publication) = generation
.proxy_shared
.claim_authenticated_user(&profile.user, profile.credential_id)
else {
return Err(ManagerError::Closed);
};
let Some(user_registration) = user_publication.take_registration() else {
return Err(ManagerError::Closed);
};
if !admit_initial(self, &mut state, now, client_ip, profile_key, &profile) {
return Err(ManagerError::Limit);
}
@@ -338,6 +350,7 @@ impl WebProcessRuntime {
recovery,
self.limits.clone(),
issued_timeouts.clone(),
Some(user_registration),
);
state.sessions.insert(session_hash, Arc::clone(&session));
*state.sessions_per_ip.entry(client_ip).or_insert(0) += 1;
@@ -402,6 +415,7 @@ impl WebProcessRuntime {
user_agent_id,
},
);
user_publication.commit();
drop(state);
self.telemetry
.record_carrier_selection(carrier, learning_disposition);