add Docker credentials to app and CLI
This commit is contained in:
@ -0,0 +1,10 @@
|
||||
use std::io;
|
||||
|
||||
use crate::proto::DockerCredential;
|
||||
|
||||
|
||||
pub fn docker_store() -> anyhow::Result<()> {
|
||||
let input: DockerCredential = serde_json::from_reader(io::stdin())?;
|
||||
dbg!(input);
|
||||
Ok(())
|
||||
}
|
||||
|
@ -22,6 +22,8 @@ use crate::proto::{
|
||||
ShortcutAction,
|
||||
};
|
||||
|
||||
mod docker;
|
||||
|
||||
|
||||
#[derive(Debug, Parser)]
|
||||
#[command(
|
||||
@ -200,11 +202,11 @@ pub fn invoke_shortcut(args: InvokeArgs, global: GlobalArgs) -> anyhow::Result<(
|
||||
|
||||
|
||||
pub fn docker_credential_helper(cmd: DockerCmd) -> anyhow::Result<()> {
|
||||
let req = match cmd {
|
||||
match cmd {
|
||||
DockerCmd::Get => todo!(),
|
||||
DockerCmd::Store => todo!(),
|
||||
DockerCmd::Store => docker::docker_store(),
|
||||
DockerCmd::Erase => todo!(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -41,6 +41,7 @@ impl Display for CliResponse {
|
||||
match self {
|
||||
CliResponse::Credential(CliCredential::AwsBase(_)) => write!(f, "Credential (AwsBase)"),
|
||||
CliResponse::Credential(CliCredential::AwsSession(_)) => write!(f, "Credential (AwsSession)"),
|
||||
CliResponse::Credential(CliCredential::Docker(_)) => write!(f, "Credential (Docker)"),
|
||||
CliResponse::Empty => write!(f, "Empty"),
|
||||
}
|
||||
}
|
||||
@ -84,7 +85,7 @@ fn default_aws_version() -> usize { 1 }
|
||||
#[derive(Debug, Eq, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct DockerCredential {
|
||||
#[serde(rename = "PascalCase")]
|
||||
#[serde(rename = "ServerURL")]
|
||||
pub server_url: String,
|
||||
pub username: String,
|
||||
pub secret: String,
|
||||
|
Reference in New Issue
Block a user