juruoO-o commented on code in PR #2153: URL: https://github.com/apache/polaris/pull/2153#discussion_r2221566843
########## polaris-core/src/main/java/org/apache/polaris/core/storage/oss/OssCredentialsStorageIntegration.java: ########## @@ -0,0 +1,345 @@ +/* + * 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. + */ +package org.apache.polaris.core.storage.oss; + +import static org.apache.polaris.core.config.FeatureConfiguration.STORAGE_CREDENTIAL_DURATION_SECONDS; + +import com.aliyuncs.AcsRequest; +import com.aliyuncs.AcsResponse; +import com.aliyuncs.DefaultAcsClient; +import com.aliyuncs.IAcsClient; +import com.aliyuncs.profile.DefaultProfile; +import com.aliyuncs.auth.sts.AssumeRoleRequest; +import com.aliyuncs.auth.sts.AssumeRoleResponse; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import jakarta.annotation.Nonnull; +import java.net.URI; +import java.time.Instant; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.EnumMap; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.apache.polaris.core.context.CallContext; +import org.apache.polaris.core.storage.InMemoryStorageIntegration; +import org.apache.polaris.core.storage.PolarisStorageActions; +import org.apache.polaris.core.storage.StorageAccessProperty; +import org.apache.polaris.core.storage.StorageUtil; +import org.apache.polaris.core.storage.oss.OssStsClientProvider.StsDestination; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** OSS credential vendor that supports generating temporary credentials using Alibaba Cloud STS */ +public class OssCredentialsStorageIntegration + extends InMemoryStorageIntegration<OssStorageConfigurationInfo> { + + private static final Logger LOGGER = + LoggerFactory.getLogger(OssCredentialsStorageIntegration.class); + + private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); + private final OssStsClientProvider stsClientProvider; + + public OssCredentialsStorageIntegration() { + this(new OssStsClientProvider()); + } + + + public OssCredentialsStorageIntegration(OssStsClientProvider stsClientProvider) { + super(OssCredentialsStorageIntegration.class.getName()); + this.stsClientProvider = stsClientProvider; + } + + /** {@inheritDoc} */ + @Override + public EnumMap<StorageAccessProperty, String> getSubscopedCreds( Review Comment: It seems that Alibaba Cloud doesn't have this kind of testing environment. I'm testing with my own account. The main reason for rewriting OSS support is due to assume role authentication - OSS cannot reuse AWS. Can I share the test results, or could you tell me what content needs to be tested? -- 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: issues-unsubscr...@polaris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org