ezidam: apps: view, update, new secret

This commit is contained in:
Philippe Loctaux 2023-04-02 00:52:16 +02:00
parent 4b99905ee0
commit 2caf584cb7
12 changed files with 407 additions and 9 deletions

View file

@ -78,4 +78,29 @@ impl App {
.await?
.map(Self::from))
}
pub async fn update(
conn: impl SqliteExecutor<'_>,
id: &AppID,
label: &str,
redirect_uri: &Url,
is_confidential: bool,
) -> Result<Option<()>, Error> {
Ok(DatabaseApps::update(
conn,
id.as_ref(),
label,
redirect_uri.as_str(),
is_confidential,
)
.await?)
}
pub async fn new_secret(
&self,
conn: impl SqliteExecutor<'_>,
secret: &Secret,
) -> Result<Option<()>, Error> {
Ok(DatabaseApps::new_secret(conn, self.id.as_ref(), secret.hash()).await?)
}
}