Skip to content

Commit d27d11a

Browse files
authored
Move plugin actions and authentication onto PluginHost (#563)
1 parent 1a19a06 commit d27d11a

14 files changed

Lines changed: 731 additions & 360 deletions

File tree

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates-tauri/yaak-app-client/src/grpc.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ use std::collections::BTreeMap;
22

33
use crate::PluginContextExt;
44
use crate::error::Result;
5-
use crate::models_ext::QueryManagerExt;
65
use KeyAndValueRef::{Ascii, Binary};
76
use tauri::{Manager, Runtime, WebviewWindow};
87
use yaak_grpc::{KeyAndValueRef, MetadataMap};
@@ -21,22 +20,6 @@ pub(crate) fn metadata_to_map(metadata: MetadataMap) -> BTreeMap<String, String>
2120
entries
2221
}
2322

24-
pub(crate) fn resolve_grpc_request<R: Runtime>(
25-
window: &WebviewWindow<R>,
26-
request: &GrpcRequest,
27-
) -> Result<(GrpcRequest, String)> {
28-
let mut new_request = request.clone();
29-
30-
let (authentication_type, authentication, authentication_context_id) =
31-
window.db().resolve_auth_for_grpc_request(request)?;
32-
new_request.authentication_type = authentication_type;
33-
new_request.authentication = authentication;
34-
35-
let metadata = window.db().resolve_metadata_for_grpc_request(request)?;
36-
new_request.metadata = metadata;
37-
38-
Ok((new_request, authentication_context_id))
39-
}
4023

4124
pub(crate) async fn build_metadata<R: Runtime>(
4225
window: &WebviewWindow<R>,

crates-tauri/yaak-app-client/src/http_request.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -179,19 +179,3 @@ async fn send_http_request_inner<R: Runtime>(
179179
Ok(SentHttpRequest { response: result.response, body: result.response_body })
180180
}
181181

182-
pub fn resolve_http_request<R: Runtime>(
183-
window: &WebviewWindow<R>,
184-
request: &HttpRequest,
185-
) -> Result<(HttpRequest, String)> {
186-
let mut new_request = request.clone();
187-
188-
let (authentication_type, authentication, authentication_context_id) =
189-
window.db().resolve_auth_for_http_request(request)?;
190-
new_request.authentication_type = authentication_type;
191-
new_request.authentication = authentication;
192-
193-
let headers = window.db().resolve_headers_for_http_request(request)?;
194-
new_request.headers = headers;
195-
196-
Ok((new_request, authentication_context_id))
197-
}

0 commit comments

Comments
 (0)