-
Notifications
You must be signed in to change notification settings - Fork 51
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 #392 from Xynnn007/feat-proxy
Cosign | Add support for client to configure a proxy to pull signatures
- Loading branch information
Showing
16 changed files
with
187 additions
and
174 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
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 |
---|---|---|
|
@@ -36,7 +36,7 @@ | |
//! In case you want to mock sigstore interactions inside of your own code, you | ||
//! can implement the [`CosignCapabilities`] trait inside of your test suite. | ||
|
||
use std::collections::HashMap; | ||
use std::collections::BTreeMap; | ||
|
||
use async_trait::async_trait; | ||
use tracing::warn; | ||
|
@@ -126,9 +126,9 @@ pub trait CosignCapabilities { | |
|
||
/// Push [`SignatureLayer`] objects to the registry. This function will do | ||
/// the following steps: | ||
/// * Generate a series of [`oci_distribution::client::ImageLayer`]s due to | ||
/// * Generate a series of [`oci_client::client::ImageLayer`]s due to | ||
/// the given [`Vec<SignatureLayer>`]. | ||
/// * Generate a `OciImageManifest` of [`oci_distribution::manifest::OciManifest`] | ||
/// * Generate a `OciImageManifest` of [`oci_client::manifest::OciManifest`] | ||
/// due to the given `source_image_digest` and `signature_layers`. It supports | ||
/// to be extended when newly published | ||
/// [Referrers API of OCI Registry v1.1.0](https://github.com/opencontainers/distribution-spec/blob/v1.1.0-rc1/spec.md#listing-referrers), | ||
|
@@ -146,7 +146,7 @@ pub trait CosignCapabilities { | |
/// - `signature_layers`: [`SignatureLayer`] objects containing signature information | ||
async fn push_signature( | ||
&mut self, | ||
annotations: Option<HashMap<String, String>>, | ||
annotations: Option<BTreeMap<String, String>>, | ||
auth: &Auth, | ||
target_reference: &OciReference, | ||
signature_layers: Vec<SignatureLayer>, | ||
|
@@ -357,7 +357,7 @@ TNMea7Ix/stJ5TfcLLeABLE4BNJOsQ4vnBHJ | |
let email = "[email protected]".to_string(); | ||
let issuer = "an issuer".to_string(); | ||
|
||
let mut annotations: HashMap<String, String> = HashMap::new(); | ||
let mut annotations: BTreeMap<String, String> = BTreeMap::new(); | ||
annotations.insert("key1".into(), "value1".into()); | ||
annotations.insert("key2".into(), "value2".into()); | ||
|
||
|
@@ -370,7 +370,7 @@ TNMea7Ix/stJ5TfcLLeABLE4BNJOsQ4vnBHJ | |
cert_signature.subject = cert_subj; | ||
sl.certificate_signature = Some(cert_signature); | ||
|
||
let mut extra: HashMap<String, serde_json::Value> = annotations | ||
let mut extra: BTreeMap<String, serde_json::Value> = annotations | ||
.iter() | ||
.map(|(k, v)| (k.clone(), json!(v))) | ||
.collect(); | ||
|
@@ -422,7 +422,7 @@ TNMea7Ix/stJ5TfcLLeABLE4BNJOsQ4vnBHJ | |
cert_signature.subject = cert_subj; | ||
sl.certificate_signature = Some(cert_signature); | ||
|
||
let mut extra: HashMap<String, serde_json::Value> = HashMap::new(); | ||
let mut extra: BTreeMap<String, serde_json::Value> = BTreeMap::new(); | ||
extra.insert("something extra".into(), json!("value extra")); | ||
|
||
let mut simple_signing = sl.simple_signing; | ||
|
@@ -470,7 +470,7 @@ TNMea7Ix/stJ5TfcLLeABLE4BNJOsQ4vnBHJ | |
cert_signature.subject = cert_subj; | ||
sl.certificate_signature = Some(cert_signature); | ||
|
||
let mut extra: HashMap<String, serde_json::Value> = HashMap::new(); | ||
let mut extra: BTreeMap<String, serde_json::Value> = BTreeMap::new(); | ||
extra.insert("something extra".into(), json!("value extra")); | ||
|
||
let mut simple_signing = sl.simple_signing; | ||
|
@@ -652,8 +652,8 @@ TNMea7Ix/stJ5TfcLLeABLE4BNJOsQ4vnBHJ | |
.registry_client | ||
.pull( | ||
&SIGNED_IMAGE.parse().expect("failed to parse image ref"), | ||
&oci_distribution::secrets::RegistryAuth::Anonymous, | ||
vec![oci_distribution::manifest::IMAGE_DOCKER_LAYER_GZIP_MEDIA_TYPE], | ||
&oci_client::secrets::RegistryAuth::Anonymous, | ||
vec![oci_client::manifest::IMAGE_DOCKER_LAYER_GZIP_MEDIA_TYPE], | ||
) | ||
.await | ||
.expect("pull test image failed"); | ||
|
@@ -664,7 +664,7 @@ TNMea7Ix/stJ5TfcLLeABLE4BNJOsQ4vnBHJ | |
&image_ref.oci_reference, | ||
&data.layers[..], | ||
data.config.clone(), | ||
&oci_distribution::secrets::RegistryAuth::Anonymous, | ||
&oci_client::secrets::RegistryAuth::Anonymous, | ||
None, | ||
) | ||
.await | ||
|
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
Oops, something went wrong.