rchowell commented on code in PR #2311: URL: https://github.com/apache/iceberg-rust/pull/2311#discussion_r3236348977
########## crates/catalog/rest/src/signing.rs: ########## @@ -0,0 +1,263 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +//! HTTP request signing for the REST catalog. + +use std::fmt::Debug; +use std::sync::Arc; + +use async_trait::async_trait; +use iceberg::{Error, ErrorKind, Result}; +use reqsign_aws_v4::{Credential, DefaultCredentialProvider, RequestSigner}; +use reqsign_core::{Context, HttpSend, OsEnv, ProvideCredential, Signer}; +use reqsign_file_read_tokio::TokioFileRead; +use reqwest::{Client, Request}; + +use crate::RestCatalogConfig; + +/// A trait for signing HTTP requests. +#[async_trait] +pub trait HttpRequestSigner: Send + Sync + Debug { Review Comment: I think a clean approach is, 1. Keep the generic signer trait, I had to use one with a custom credential chain recently. 2. Support the rest.signer-type discriminant + dispatch on it rather than if-else chaining. 3. Continue support for the sigv4 property and treat that as equivalent `rest.signer-type=sigv4` This is nice because lower-level users like myself can provider custom signer implementations, whereas builtin ones like sigv4 are just a single config option. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
