12 Commits

Author SHA1 Message Date
dependabot[bot] aa315b45ce Update thiserror requirement from 1.0.48 to 2.0.11
Updates the requirements on [thiserror](https://github.com/dtolnay/thiserror) to permit the latest version.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.48...2.0.11)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-10 18:29:31 +00:00
dependabot[bot] 9b602f70a6 Merge pull request #64 from anthonyoteri/dependabot/cargo/simple_logger-5.0.0 2024-05-21 18:54:24 +00:00
dependabot[bot] f12615a7f2 Update simple_logger requirement from 4.2.0 to 5.0.0
Updates the requirements on [simple_logger](https://github.com/borntyping/rust-simple_logger) to permit the latest version.
- [Release notes](https://github.com/borntyping/rust-simple_logger/releases)
- [Commits](https://github.com/borntyping/rust-simple_logger/compare/v4.2.0...v5.0.0)

---
updated-dependencies:
- dependency-name: simple_logger
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-07 18:23:41 +00:00
dependabot[bot] 39c03a2b5b Merge pull request #59 from anthonyoteri/dependabot/cargo/env_logger-0.11.3 2024-05-06 19:28:45 +00:00
dependabot[bot] f836b26930 Merge pull request #63 from anthonyoteri/dependabot/cargo/reqwest-0.12.3 2024-05-06 19:28:33 +00:00
dependabot[bot] 0d9761178c Update reqwest requirement from 0.11.20 to 0.12.3
Updates the requirements on [reqwest](https://github.com/seanmonstar/reqwest) to permit the latest version.
- [Release notes](https://github.com/seanmonstar/reqwest/releases)
- [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/reqwest/compare/v0.11.20...v0.12.3)

---
updated-dependencies:
- dependency-name: reqwest
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-05 18:44:24 +00:00
dependabot[bot] 358a19f6f7 Update env_logger requirement from 0.10.0 to 0.11.3
Updates the requirements on [env_logger](https://github.com/rust-cli/env_logger) to permit the latest version.
- [Release notes](https://github.com/rust-cli/env_logger/releases)
- [Changelog](https://github.com/rust-cli/env_logger/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-cli/env_logger/compare/v0.10.0...v0.11.3)

---
updated-dependencies:
- dependency-name: env_logger
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-05 18:16:31 +00:00
dependabot[bot] 0527b6268d Merge pull request #55 from anthonyoteri/dependabot/github_actions/github/codeql-action-3 2023-12-27 13:25:38 +00:00
dependabot[bot] 67c02581f3 Bump github/codeql-action from 2 to 3
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-13 18:20:08 +00:00
dependabot[bot] b6fda7162f Merge pull request #54 from anthonyoteri/dependabot/cargo/http-1.0.0 2023-11-16 16:18:29 +00:00
Anthony Oteri 07746429bb Be consistent with use of http and reqwest libraries
The types may have similar names but are distinct types and should be used consistently.  This changes
the code to use the header and status code information directly from the `reqwests` library instead of
mixing the two.

Signed-off-by: Anthony Oteri <anthony.oteri@gmail.com>
2023-11-16 10:30:03 -05:00
dependabot[bot] 23f1d21a2e Update http requirement from 0.2.9 to 1.0.0
Updates the requirements on [http](https://github.com/hyperium/http) to permit the latest version.
- [Release notes](https://github.com/hyperium/http/releases)
- [Changelog](https://github.com/hyperium/http/blob/master/CHANGELOG.md)
- [Commits](https://github.com/hyperium/http/compare/v0.2.9...v1.0.0)

---
updated-dependencies:
- dependency-name: http
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-15 18:32:17 +00:00
3 changed files with 15 additions and 15 deletions
+1 -1
View File
@@ -45,7 +45,7 @@ jobs:
continue-on-error: true
- name: Upload analysis results ot GitHub
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: rust-clippy-results.sarif
wait-for-processing: true
+5 -5
View File
@@ -27,15 +27,15 @@ name = "dredge"
[dependencies]
clap = { version = "4.4.3", features = ["derive", "env", "wrap_help"] }
simple_logger = { version = "4.2.0", features = ["timestamps", "colors", "stderr"] }
http = "0.2.9"
simple_logger = { version = "5.0.0", features = ["timestamps", "colors", "stderr"] }
http = "1.0.0"
indoc = "2.0.4"
log = "0.4.20"
reqwest = { version = "0.11.20", features = ["json", "gzip", "multipart", "native-tls-vendored"] }
reqwest = { version = "0.12.3", features = ["json", "gzip", "multipart", "native-tls-vendored"] }
serde = { version = "1.0.188", features = ["derive"] }
serde_toml = "0.0.1"
serde_yaml = "0.9.25"
thiserror = "1.0.48"
thiserror = "2.0.11"
toml = "0.8.0"
url = { version = "2.4.1", features = ["serde"] }
xdg = "2.5.2"
@@ -43,4 +43,4 @@ tokio = { version = "1.32.0", features = ["macros"] }
[dev-dependencies]
mockito = "1.2.0"
env_logger = "0.10.0"
env_logger = "0.11.3"
+9 -9
View File
@@ -7,7 +7,9 @@
* copied, modified, or distributed except according to those terms.
*/
use http::header;
use reqwest::header;
use reqwest::header::HeaderValue;
use reqwest::StatusCode;
use serde::Deserialize;
use url::Url;
@@ -52,7 +54,7 @@ pub async fn fetch_paginated<T: for<'de> Deserialize<'de>>(
responses.push(json);
}
if let Some(p) = parse_rfc5988(headers.get(http::header::LINK))? {
if let Some(p) = parse_rfc5988(headers.get(header::LINK))? {
next_path = p;
} else {
break;
@@ -73,7 +75,7 @@ pub async fn fetch_paginated<T: for<'de> Deserialize<'de>>(
///
/// Returns and `ApiError` if there is a problem parsing contents of the
/// supplied header value.
fn parse_rfc5988(header_value: Option<&http::HeaderValue>) -> Result<Option<String>, ApiError> {
fn parse_rfc5988(header_value: Option<&HeaderValue>) -> Result<Option<String>, ApiError> {
log::trace!("parse_rfc5988(header_value: {header_value:?})");
if let Some(link_value) = header_value {
@@ -127,7 +129,7 @@ pub fn parse_response_status(response: &reqwest::Response) -> Result<(), ApiErro
log::trace!("parse_response_status(response: {response:?})");
match response.status() {
http::StatusCode::OK | http::StatusCode::ACCEPTED => {
StatusCode::OK | StatusCode::ACCEPTED => {
let headers = response.headers();
if let Some(header_value) = headers.get("Docker-Distribution-API-Version") {
if header_value.to_str()? == "registry/2.0" {
@@ -141,8 +143,8 @@ pub fn parse_response_status(response: &reqwest::Response) -> Result<(), ApiErro
))
}
}
http::StatusCode::METHOD_NOT_ALLOWED => Err(ApiError::MethodNotAllowed),
http::StatusCode::UNAUTHORIZED => {
StatusCode::METHOD_NOT_ALLOWED => Err(ApiError::MethodNotAllowed),
StatusCode::UNAUTHORIZED => {
let headers = response.headers();
if let Some(header_value) = headers.get("Docker-Distribution-API-Version") {
if header_value.to_str()? == "registry/2.0" {
@@ -156,7 +158,7 @@ pub fn parse_response_status(response: &reqwest::Response) -> Result<(), ApiErro
))
}
}
http::StatusCode::NOT_FOUND => Err(ApiError::NotFound),
StatusCode::NOT_FOUND => Err(ApiError::NotFound),
e => Err(ApiError::UnexpectedResponse(format!(
"Undocumented status code: {e:?}"
))),
@@ -192,8 +194,6 @@ pub async fn get_digest(client: &reqwest::Client, url: &Url) -> Result<String, A
#[cfg(test)]
mod tests {
use http::header::HeaderValue;
use super::*;
/// Test parsing a valid RFC5988 header value.