summaryrefslogtreecommitdiff
path: root/src/repo/token.rs
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2024-09-25 01:22:07 -0400
committerOwen Jacobson <owen@grimoire.ca>2024-09-25 02:15:25 -0400
commit697e90f291cec1bbd89965c2731f9481ec4507c4 (patch)
treeb40ef7142da474b0ad2bd370b2c89d2008570976 /src/repo/token.rs
parentaf7ece7dd5433051d67526ae15ad64f0f5b5e568 (diff)
rustdoc comment for the (very limited) public API of the crate.
This silences some `-Wclippy::pedantic` warning, and it's just a good thing to do. I've made the choice to have the docs comment face programmers, and to provide `hi --help` and `hi -h` content via Clap attributes instead of inferring it from the docs comment. Internal (private) "rustdoc" comments have been converted to regular comments until I learn how to write better rustdoc.
Diffstat (limited to 'src/repo/token.rs')
-rw-r--r--src/repo/token.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/repo/token.rs b/src/repo/token.rs
index 4eaa6ea..8276bea 100644
--- a/src/repo/token.rs
+++ b/src/repo/token.rs
@@ -17,8 +17,8 @@ impl<'c> Provider for Transaction<'c, Sqlite> {
pub struct Tokens<'t>(&'t mut SqliteConnection);
impl<'c> Tokens<'c> {
- /// Issue a new token for an existing login. The issued_at timestamp will
- /// be used to control expiry, until the token is actually used.
+ // Issue a new token for an existing login. The issued_at timestamp will
+ // be used to control expiry, until the token is actually used.
pub async fn issue(
&mut self,
login: &Login,
@@ -43,7 +43,7 @@ impl<'c> Tokens<'c> {
Ok(secret)
}
- /// Revoke a token by its secret.
+ // Revoke a token by its secret.
pub async fn revoke(&mut self, secret: &str) -> Result<(), sqlx::Error> {
sqlx::query!(
r#"
@@ -60,8 +60,8 @@ impl<'c> Tokens<'c> {
Ok(())
}
- /// Expire and delete all tokens that haven't been used more recently than
- /// ``expire_at``.
+ // Expire and delete all tokens that haven't been used more recently than
+ // `expire_at`.
pub async fn expire(&mut self, expire_at: &DateTime) -> Result<(), sqlx::Error> {
sqlx::query!(
r#"
@@ -77,9 +77,9 @@ impl<'c> Tokens<'c> {
Ok(())
}
- /// Validate a token by its secret, retrieving the associated Login record.
- /// Will return [None] if the token is not valid. The token's last-used
- /// timestamp will be set to `used_at`.
+ // Validate a token by its secret, retrieving the associated Login record.
+ // Will return [None] if the token is not valid. The token's last-used
+ // timestamp will be set to `used_at`.
pub async fn validate(
&mut self,
secret: &str,