add version to BaseCredentials
This commit is contained in:
parent
1df849442e
commit
70e23c7e20
@ -9,6 +9,7 @@
|
|||||||
* Icon
|
* Icon
|
||||||
* Auto-updates
|
* Auto-updates
|
||||||
* SSH key handling
|
* SSH key handling
|
||||||
|
* Encrypted sync server
|
||||||
|
|
||||||
## Maybe
|
## Maybe
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "creddy",
|
"name": "creddy",
|
||||||
"version": "0.4.4",
|
"version": "0.4.5",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
|
2
src-tauri/Cargo.lock
generated
2
src-tauri/Cargo.lock
generated
@ -1035,7 +1035,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "creddy"
|
name = "creddy"
|
||||||
version = "0.4.4"
|
version = "0.4.5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"argon2",
|
"argon2",
|
||||||
"auto-launch",
|
"auto-launch",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "creddy"
|
name = "creddy"
|
||||||
version = "0.4.4"
|
version = "0.4.5"
|
||||||
description = "A friendly AWS credentials manager"
|
description = "A friendly AWS credentials manager"
|
||||||
authors = ["Joseph Montanaro"]
|
authors = ["Joseph Montanaro"]
|
||||||
license = ""
|
license = ""
|
||||||
|
@ -126,10 +126,10 @@ impl LockedCredentials {
|
|||||||
let secret_access_key = String::from_utf8(decrypted)
|
let secret_access_key = String::from_utf8(decrypted)
|
||||||
.map_err(|_| UnlockError::InvalidUtf8)?;
|
.map_err(|_| UnlockError::InvalidUtf8)?;
|
||||||
|
|
||||||
let creds = BaseCredentials {
|
let creds = BaseCredentials::new(
|
||||||
access_key_id: self.access_key_id.clone(),
|
self.access_key_id.clone(),
|
||||||
secret_access_key,
|
secret_access_key,
|
||||||
};
|
);
|
||||||
Ok(creds)
|
Ok(creds)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -138,11 +138,16 @@ impl LockedCredentials {
|
|||||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "PascalCase")]
|
#[serde(rename_all = "PascalCase")]
|
||||||
pub struct BaseCredentials {
|
pub struct BaseCredentials {
|
||||||
|
pub version: usize,
|
||||||
pub access_key_id: String,
|
pub access_key_id: String,
|
||||||
pub secret_access_key: String,
|
pub secret_access_key: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl BaseCredentials {
|
impl BaseCredentials {
|
||||||
|
pub fn new(access_key_id: String, secret_access_key: String) -> Self {
|
||||||
|
Self {version: 1, access_key_id, secret_access_key}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn encrypt(&self, passphrase: &str) -> Result<LockedCredentials, CryptoError> {
|
pub fn encrypt(&self, passphrase: &str) -> Result<LockedCredentials, CryptoError> {
|
||||||
let salt = Crypto::salt();
|
let salt = Crypto::salt();
|
||||||
let crypto = Crypto::new(passphrase, &salt)?;
|
let crypto = Crypto::new(passphrase, &salt)?;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
},
|
},
|
||||||
"package": {
|
"package": {
|
||||||
"productName": "creddy",
|
"productName": "creddy",
|
||||||
"version": "0.4.4"
|
"version": "0.4.5"
|
||||||
},
|
},
|
||||||
"tauri": {
|
"tauri": {
|
||||||
"allowlist": {
|
"allowlist": {
|
||||||
|
@ -112,7 +112,7 @@
|
|||||||
|
|
||||||
<div>
|
<div>
|
||||||
<!-- <button class="btn btn-sm btn-ghost">Cancel</button> -->
|
<!-- <button class="btn btn-sm btn-ghost">Cancel</button> -->
|
||||||
<buton class="btn btn-sm btn-primary" on:click={save}>Save</buton>
|
<button class="btn btn-sm btn-primary" on:click={save}>Save</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user