Skip to content

Commit

Permalink
feat: introduce keyring
Browse files Browse the repository at this point in the history
  • Loading branch information
ccrutchf committed Nov 16, 2024
1 parent f7dbcc9 commit 3903e9b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ edition = "2021"

[dependencies]
clap = "4.5.21"
keyring = "3.6.1"
12 changes: 12 additions & 0 deletions src/credential_manager.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
pub struct CredentialManager {
}

impl CredentialManager {
fn get_password(&self, user: &str, url: &str) {

}

fn set_password(&self, user: &str, url: &str, password: &str) {

}
}
16 changes: 11 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
use clap::{Command, Arg};

mod credential_manager;

use credential_manager::CredentialManager;

fn cli() -> Command {
Command::new("git-lfs-synology")
.about("This is an implementation of a git lfs custom transfer agent. See https://github.com/git-lfs/git-lfs/blob/main/docs/custom-transfers.md for mor information.")
.about("This is an implementation of a git lfs custom transfer agent. See https://github.com/git-lfs/git-lfs/blob/main/docs/custom-transfers.md for more information.")
.allow_external_subcommands(true)
.subcommand(
Command::new("login")
Expand All @@ -26,14 +30,16 @@ fn cli() -> Command {
)
}

fn login() {
let credential_manager = CredentialManager { };
}

fn main() {
let matches = cli().get_matches();

match matches.subcommand() {
Some(("login", sub_matches)) => {
println!("{:?}", sub_matches);

println!("login")
Some(("login", _)) => {
login();
},
_ => println!("No subcommand")
}
Expand Down

0 comments on commit 3903e9b

Please sign in to comment.