update forgejo-api

This commit is contained in:
Cyborus 2024-01-01 18:43:34 -05:00
parent bbe5536b4f
commit b85b939376
No known key found for this signature in database
4 changed files with 19 additions and 5 deletions

16
Cargo.lock generated
View file

@ -103,6 +103,12 @@ version = "0.21.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9"
[[package]]
name = "base64ct"
version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b"
[[package]]
name = "bitflags"
version = "1.3.2"
@ -331,8 +337,9 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
[[package]]
name = "forgejo-api"
version = "0.1.0"
source = "git+https://codeberg.org/Cyborus/forgejo-api.git?rev=bfb341c3e6#bfb341c3e6917d58fe65822602cf3eb0b1d5071b"
source = "git+https://codeberg.org/Cyborus/forgejo-api.git?rev=cb192d8eef#cb192d8eefcd0d58b51c05a6e4ded1db22caadbb"
dependencies = [
"base64ct",
"bytes",
"reqwest",
"serde",
@ -342,6 +349,7 @@ dependencies = [
"time",
"tokio",
"url",
"zeroize",
]
[[package]]
@ -1713,3 +1721,9 @@ dependencies = [
"cfg-if",
"windows-sys 0.48.0",
]
[[package]]
name = "zeroize"
version = "1.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d"

View file

@ -10,7 +10,7 @@ auth-git2 = "0.5.3"
clap = { version = "4.3.11", features = ["derive"] }
directories = "5.0.1"
eyre = "0.6.8"
forgejo-api = { git = "https://codeberg.org/Cyborus/forgejo-api.git", rev = "bfb341c3e6" }
forgejo-api = { git = "https://codeberg.org/Cyborus/forgejo-api.git", rev = "cb192d8eef" }
futures = "0.3.28"
git2 = "0.17.2"
open = "5.0.0"

View file

@ -80,6 +80,6 @@ impl LoginInfo {
}
pub fn api_for(&self, url: &Url) -> Result<forgejo_api::Forgejo, forgejo_api::ForgejoError> {
forgejo_api::Forgejo::new(&self.key, url.clone())
forgejo_api::Forgejo::new(forgejo_api::Auth::Token(&self.key), url.clone())
}
}

View file

@ -400,11 +400,11 @@ async fn download_asset(
let release = find_release(repo, api, &release).await?;
let file = match &*asset {
"source.zip" => {
api.download_release_zip(repo.owner(), repo.name(), release.id)
api.download_zip_archive(repo.owner(), repo.name(), &release.tag_name)
.await?
}
"source.tar.gz" => {
api.download_release_tarball(repo.owner(), repo.name(), release.id)
api.download_tarball_archive(repo.owner(), repo.name(), &release.tag_name)
.await?
}
name => {