mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-17 10:17:55 +00:00
db8f55cb97
* feat(table-catalog): finalize Iceberg REST behavior * fix(table-catalog): address REST finalization regressions * test(table-catalog): expect REST commit conflicts * test(table-catalog): avoid serialized view test deadlocks * fix(table-catalog): adapt shared test backend * fix(table-catalog): enforce Iceberg metadata invariants * fix(table-catalog): preserve manifest length in test * test(table-catalog): use valid metadata fixtures * test(table-catalog): seed manifests before manifest lists * fix(table-catalog): restore validation gates --------- Co-authored-by: Henry Guo <marshawcoco@users.noreply.github.com> Co-authored-by: overtrue <anzhengchao@gmail.com>
35 lines
1.6 KiB
Rust
35 lines
1.6 KiB
Rust
// Copyright 2024 RustFS Team
|
|
//
|
|
// 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 super::*;
|
|
|
|
pub struct RestLoadCredentialsHandler {}
|
|
|
|
#[async_trait::async_trait]
|
|
impl Operation for RestLoadCredentialsHandler {
|
|
async fn call(&self, req: S3Request<Body>, params: Params<'_, '_>) -> S3Result<S3Response<(StatusCode, Body)>> {
|
|
let warehouse = warehouse_from_params(¶ms)?;
|
|
let namespace = namespace_from_params(¶ms)?;
|
|
let table = table_name_from_params(¶ms)?;
|
|
let resource = TableCatalogResource::table(&warehouse, &namespace, &table);
|
|
let principal = authorize_table_catalog_resource_request(&req, &resource, AdminAction::GetTableCredentialsAction).await?;
|
|
ensure_table_bucket_enabled_from_extensions(&req.extensions, &warehouse).await?;
|
|
let store = table_catalog_store_from_extensions(&req.extensions)?;
|
|
let issuer = IamTableCredentialIssuer::from_request(&req)?;
|
|
let response =
|
|
load_credentials_response(&store, &warehouse, &namespace, &table, &issuer, Some(&principal.credentials)).await?;
|
|
build_sensitive_json_response(StatusCode::OK, &response)
|
|
}
|
|
}
|