5 Commits

Author SHA1 Message Date
e0d919ed4a fix Windows pipe server 2023-10-09 16:29:41 -07:00
3f4efc5f8f bump version to 0.4.0 2023-10-09 10:06:28 -07:00
4881b90b0b merge branch 'pipe' 2023-10-09 08:54:26 -07:00
a293d8f92c ignore .env so it can be system-specific 2023-09-22 12:43:44 -07:00
Joseph Montanaro
367a140e2a disable keyboard shortcuts if registration fails 2023-09-21 14:55:02 -07:00
5 changed files with 12 additions and 13 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "creddy",
"version": "0.3.4",
"version": "0.4.0",
"scripts": {
"dev": "vite",
"build": "vite build",

2
src-tauri/Cargo.lock generated
View File

@@ -1035,7 +1035,7 @@ dependencies = [
[[package]]
name = "creddy"
version = "0.3.4"
version = "0.4.0"
dependencies = [
"argon2",
"auto-launch",

View File

@@ -1,6 +1,6 @@
[package]
name = "creddy"
version = "0.3.4"
version = "0.4.0"
description = "A friendly AWS credentials manager"
authors = ["Joseph Montanaro"]
license = ""

View File

@@ -1,11 +1,10 @@
use tokio::{
net::windows::named_pipe::{
NamedPipeServer,
ServerOptions,
},
sync::oneshot,
use tokio::net::windows::named_pipe::{
NamedPipeServer,
ServerOptions,
};
use tauri::{AppHandle, Manager};
use windows::Win32:: {
Foundation::HANDLE,
System::Pipes::GetNamedPipeClientProcessId,
@@ -52,11 +51,11 @@ impl Server {
// create a new pipe instance to listen for the next client, and swap it in
let new_listener = ServerOptions::new().create(r"\\.\pipe\creddy-requests")?;
let mut stream = std::mem::replace(&mut self.listener, new_listener);
let stream = std::mem::replace(&mut self.listener, new_listener);
let new_handle = self.app_handle.app_handle();
let client_pid = get_client_pid(&stream)?;
rt::spawn(async move {
super::handle(stream, app_handle)
super::handle(stream, new_handle, client_pid)
.await
.error_print_prefix("Error responding to request: ");
});
@@ -71,5 +70,5 @@ fn get_client_pid(pipe: &NamedPipeServer) -> Result<u32, ClientInfoError> {
let mut pid = 0u32;
let handle = HANDLE(raw_handle as _);
unsafe { GetNamedPipeClientProcessId(handle, &mut pid as *mut u32)? };
pid
Ok(pid)
}

View File

@@ -8,7 +8,7 @@
},
"package": {
"productName": "creddy",
"version": "0.3.4"
"version": "0.4.0"
},
"tauri": {
"allowlist": {