-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
67 additions
and
48 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
use clap::ArgMatches; | ||
|
||
use crate::subcommands::Subcommand; | ||
use crate::credential_manager::CredentialManager; | ||
|
||
pub struct LoginSubcommand { | ||
|
||
} | ||
|
||
impl LoginSubcommand { | ||
fn login(user: &str, url: &str) { | ||
let credential_manager = CredentialManager { }; | ||
|
||
if credential_manager.has_credential(url) { | ||
// get password and totp command | ||
} | ||
else { | ||
// get password and totop command | ||
} | ||
|
||
// try login | ||
// if success store | ||
|
||
// else throw error | ||
} | ||
} | ||
|
||
impl Subcommand for LoginSubcommand { | ||
fn execute(&self, arg_matches: &ArgMatches) { | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use crate::subcommands::subcommand::Subcommand; | ||
use crate::credential_manager::CredentialManager; | ||
|
||
pub struct LogoutSubcommand { | ||
|
||
} | ||
|
||
impl LogoutSubcommand { | ||
fn logout(url: &str) { | ||
let credential_manager = CredentialManager { }; | ||
|
||
if credential_manager.has_credential(url) { | ||
credential_manager.remove_credential(url); | ||
} | ||
} | ||
} | ||
|
||
impl Subcommand for LogoutSubcommand { | ||
fn execute(&self, arg_matches: &clap::ArgMatches) { | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
mod subcommand; | ||
mod login_subcommand; | ||
mod logout_subcommand; | ||
|
||
pub use login_subcommand::LoginSubcommand; | ||
pub use logout_subcommand::LogoutSubcommand; | ||
pub use subcommand::Subcommand; |
File renamed without changes.