diff --git a/Cargo.toml b/Cargo.toml index abecd0b450..bd72e1e41f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -108,10 +108,6 @@ path = "examples/rekor/get_log_proof/main.rs" name = "get_public_key" path = "examples/rekor/get_public_key/main.rs" -[[example]] -name = "get_rekor_version" -path = "examples/rekor/get_rekor_version/main.rs" - [[example]] name = "search_index" path = "examples/rekor/search_index/main.rs" diff --git a/examples/rekor/get_rekor_version/main.rs b/examples/rekor/get_rekor_version/main.rs deleted file mode 100644 index c06740b868..0000000000 --- a/examples/rekor/get_rekor_version/main.rs +++ /dev/null @@ -1,30 +0,0 @@ -// -// Copyright 2021 The Sigstore Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use sigstore::rekor::apis::{configuration::Configuration, server_api}; - -/* -Gets the current version of the rekor server - -Example command : -cargo run --example get_rekor_version -*/ - -#[tokio::main] -async fn main() { - let configuration = Configuration::default(); - let rekor_version = server_api::get_rekor_version(&configuration).await; - println!("{:#?}", rekor_version.unwrap()); -} diff --git a/src/lib.rs b/src/lib.rs index 770d54e628..84ab28d866 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -199,7 +199,6 @@ //!- get_log_info //!- get_log_proof //!- get_public_key -//!- get_rekor_version //!- get_timestamp_cert_chain //!- get_timestamp_response //!- search_index diff --git a/src/rekor/apis/mod.rs b/src/rekor/apis/mod.rs index f60ef055fb..a32d86e437 100644 --- a/src/rekor/apis/mod.rs +++ b/src/rekor/apis/mod.rs @@ -39,5 +39,4 @@ pub mod configuration; pub mod entries_api; pub mod index_api; pub mod pubkey_api; -pub mod server_api; pub mod tlog_api; diff --git a/src/rekor/apis/server_api.rs b/src/rekor/apis/server_api.rs deleted file mode 100644 index f1874200e8..0000000000 --- a/src/rekor/apis/server_api.rs +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Rekor - * - * Rekor is a cryptographically secure, immutable transparency log for signed software releases. - * - * The version of the OpenAPI document: 0.0.1 - * - * Generated by: https://openapi-generator.tech - */ - -use reqwest; - -use super::{configuration, Error}; -use crate::rekor::apis::ResponseContent; -use serde::{Deserialize, Serialize}; - -/// struct for typed errors of method [`get_rekor_version`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetRekorVersionError { - DefaultResponse(crate::rekor::models::Error), - UnknownValue(serde_json::Value), -} - -pub async fn get_rekor_version( - configuration: &configuration::Configuration, -) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/api/v1/version", local_var_configuration.base_path); - let mut local_var_req_builder = - local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = - local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = - serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { - status: local_var_status, - content: local_var_content, - entity: local_var_entity, - }; - Err(Error::ResponseError(local_var_error)) - } -} diff --git a/src/rekor/lib.rs b/src/rekor/lib.rs index a6ae33ed3b..f136a1bebf 100644 --- a/src/rekor/lib.rs +++ b/src/rekor/lib.rs @@ -78,7 +78,6 @@ //!- get_log_info //!- get_log_proof //!- get_public_key -//!- get_rekor_version //!- get_timestamp_cert_chain //!- get_timestamp_response //!- search_index diff --git a/src/rekor/models/mod.rs b/src/rekor/models/mod.rs index 102366f4ee..67ba961315 100644 --- a/src/rekor/models/mod.rs +++ b/src/rekor/models/mod.rs @@ -30,8 +30,6 @@ pub mod log_info; pub use self::log_info::LogInfo; pub mod proposed_entry; pub use self::proposed_entry::ProposedEntry; -pub mod rekor_version; -pub use self::rekor_version::RekorVersion; pub mod rekord; pub use self::rekord::Rekord; pub mod rekord_all_of; diff --git a/src/rekor/models/rekor_version.rs b/src/rekor/models/rekor_version.rs deleted file mode 100644 index eb457d5c03..0000000000 --- a/src/rekor/models/rekor_version.rs +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Rekor - * - * Rekor is a cryptographically secure, immutable transparency log for signed software releases. - * - * The version of the OpenAPI document: 0.0.1 - * - * Generated by: https://openapi-generator.tech - */ -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct RekorVersion { - #[serde(rename = "version")] - pub version: String, - #[serde(rename = "commit")] - pub commit: String, - #[serde(rename = "treestate")] - pub treestate: String, - #[serde(rename = "builddate")] - pub builddate: String, -} - -impl RekorVersion { - pub fn new( - version: String, - commit: String, - treestate: String, - builddate: String, - ) -> RekorVersion { - RekorVersion { - version, - commit, - treestate, - builddate, - } - } -}