mirror of
https://github.com/telemt/telemt.git
synced 2026-11-02 13:52:03 +03:00
Proxy Shared User Drafts
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user