mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-15 17:20:08 +00:00
rename method
This commit is contained in:
parent
9084c10211
commit
2c3b147337
@ -430,7 +430,7 @@ impl Page {
|
|||||||
None, // default priority
|
None, // default priority
|
||||||
Some(cancellable.clone()),
|
Some(cancellable.clone()),
|
||||||
// Search for user certificate match request scope
|
// 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) {
|
Some(identity) => match TlsCertificate::from_pem(&identity.pem) {
|
||||||
Ok(certificate) => Some(certificate),
|
Ok(certificate) => Some(certificate),
|
||||||
Err(reason) => todo!("{reason}"),
|
Err(reason) => todo!("{reason}"),
|
||||||
|
@ -81,7 +81,7 @@ impl Navigation {
|
|||||||
.gemini
|
.gemini
|
||||||
.auth
|
.auth
|
||||||
.memory
|
.memory
|
||||||
.match_request(&request_text)
|
.match_scope(&request_text)
|
||||||
.is_some(),
|
.is_some(),
|
||||||
!request_text.is_empty() && request_text.starts_with("gemini"),
|
!request_text.is_empty() && request_text.starts_with("gemini"),
|
||||||
);
|
);
|
||||||
|
@ -112,8 +112,8 @@ impl Gemini {
|
|||||||
/// Get `Identity` match `request`
|
/// Get `Identity` match `request`
|
||||||
/// * [Client certificates specification](https://geminiprotocol.net/docs/protocol-specification.gmi#client-certificates)
|
/// * [Client certificates specification](https://geminiprotocol.net/docs/protocol-specification.gmi#client-certificates)
|
||||||
/// * this function work with memory cache (not database)
|
/// * this function work with memory cache (not database)
|
||||||
pub fn match_request(&self, request: &str) -> Option<Identity> {
|
pub fn match_scope(&self, request: &str) -> Option<Identity> {
|
||||||
if let Some(auth) = self.auth.memory.match_request(request) {
|
if let Some(auth) = self.auth.memory.match_scope(request) {
|
||||||
match self.memory.get(auth.profile_identity_gemini_id) {
|
match self.memory.get(auth.profile_identity_gemini_id) {
|
||||||
Ok(pem) => {
|
Ok(pem) => {
|
||||||
return Some(Identity {
|
return Some(Identity {
|
||||||
|
@ -55,7 +55,7 @@ impl Memory {
|
|||||||
/// Get identity match `request`
|
/// Get identity match `request`
|
||||||
/// * [Client certificates specification](https://geminiprotocol.net/docs/protocol-specification.gmi#client-certificates)
|
/// * [Client certificates specification](https://geminiprotocol.net/docs/protocol-specification.gmi#client-certificates)
|
||||||
/// * contain unspecified length priority implementation @TODO
|
/// * contain unspecified length priority implementation @TODO
|
||||||
pub fn match_request(&self, request: &str) -> Option<Auth> {
|
pub fn match_scope(&self, request: &str) -> Option<Auth> {
|
||||||
let mut result = Vec::new();
|
let mut result = Vec::new();
|
||||||
|
|
||||||
// Get all records starts with `scope`
|
// Get all records starts with `scope`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user