From 2c3b147337f0a8ab9b900b270290e211885f9a1f Mon Sep 17 00:00:00 2001 From: yggverse Date: Thu, 28 Nov 2024 02:46:40 +0200 Subject: [PATCH] rename method --- src/app/browser/window/tab/item/page.rs | 2 +- src/app/browser/window/tab/item/page/navigation.rs | 2 +- src/profile/identity/gemini.rs | 4 ++-- src/profile/identity/gemini/auth/memory.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/browser/window/tab/item/page.rs b/src/app/browser/window/tab/item/page.rs index d11aa567..9912acde 100644 --- a/src/app/browser/window/tab/item/page.rs +++ b/src/app/browser/window/tab/item/page.rs @@ -430,7 +430,7 @@ impl Page { None, // default priority Some(cancellable.clone()), // Search for user certificate match request scope - match self.profile.identity.gemini.match_request(&self.navigation.request.widget.entry.text()) { + match self.profile.identity.gemini.match_scope(&self.navigation.request.widget.entry.text()) { Some(identity) => match TlsCertificate::from_pem(&identity.pem) { Ok(certificate) => Some(certificate), Err(reason) => todo!("{reason}"), diff --git a/src/app/browser/window/tab/item/page/navigation.rs b/src/app/browser/window/tab/item/page/navigation.rs index 7b36fc69..3553081e 100644 --- a/src/app/browser/window/tab/item/page/navigation.rs +++ b/src/app/browser/window/tab/item/page/navigation.rs @@ -81,7 +81,7 @@ impl Navigation { .gemini .auth .memory - .match_request(&request_text) + .match_scope(&request_text) .is_some(), !request_text.is_empty() && request_text.starts_with("gemini"), ); diff --git a/src/profile/identity/gemini.rs b/src/profile/identity/gemini.rs index baa0f569..3647f68e 100644 --- a/src/profile/identity/gemini.rs +++ b/src/profile/identity/gemini.rs @@ -112,8 +112,8 @@ impl Gemini { /// Get `Identity` match `request` /// * [Client certificates specification](https://geminiprotocol.net/docs/protocol-specification.gmi#client-certificates) /// * this function work with memory cache (not database) - pub fn match_request(&self, request: &str) -> Option { - if let Some(auth) = self.auth.memory.match_request(request) { + pub fn match_scope(&self, request: &str) -> Option { + if let Some(auth) = self.auth.memory.match_scope(request) { match self.memory.get(auth.profile_identity_gemini_id) { Ok(pem) => { return Some(Identity { diff --git a/src/profile/identity/gemini/auth/memory.rs b/src/profile/identity/gemini/auth/memory.rs index bff5b61f..8a18b4aa 100644 --- a/src/profile/identity/gemini/auth/memory.rs +++ b/src/profile/identity/gemini/auth/memory.rs @@ -55,7 +55,7 @@ impl Memory { /// Get identity match `request` /// * [Client certificates specification](https://geminiprotocol.net/docs/protocol-specification.gmi#client-certificates) /// * contain unspecified length priority implementation @TODO - pub fn match_request(&self, request: &str) -> Option { + pub fn match_scope(&self, request: &str) -> Option { let mut result = Vec::new(); // Get all records starts with `scope`