-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from Isawan/credential-helper
Implemented authenticated request
- Loading branch information
Showing
9 changed files
with
57 additions
and
29 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -1,11 +1,12 @@ | ||
use async_trait::async_trait; | ||
use std::marker::Send; | ||
|
||
#[async_trait(?Send)] | ||
#[async_trait] | ||
pub trait CredentialHelper { | ||
async fn get(&self, hostname: impl AsRef<str>) -> Result<Option<String>, anyhow::Error>; | ||
async fn get(&self, hostname: impl AsRef<str> + Send) -> Result<Option<String>, anyhow::Error>; | ||
async fn store(&mut self, hostname: String, cred: String) -> Result<(), anyhow::Error>; | ||
|
||
/// Forget a credential. | ||
/// NOTE: Deleting a non-existing credential is not an error | ||
async fn forget(&mut self, hostname: impl AsRef<str>) -> Result<(), anyhow::Error>; | ||
async fn forget(&mut self, hostname: impl AsRef<str> + Send) -> Result<(), anyhow::Error>; | ||
} |
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
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
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