File tree Expand file tree Collapse file tree 4 files changed +40
-4
lines changed
fluss-filesystems/fluss-fs-s3
src/main/java/org/apache/fluss/fs/s3 Expand file tree Collapse file tree 4 files changed +40
-4
lines changed Original file line number Diff line number Diff line change 233233 <groupId >org.slf4j</groupId >
234234 <artifactId >slf4j-reload4j</artifactId >
235235 </exclusion >
236+ <exclusion >
237+ <groupId >software.amazon.awssdk</groupId >
238+ <artifactId >bundle</artifactId >
239+ </exclusion >
236240 </exclusions >
237241 </dependency >
238242
Original file line number Diff line number Diff line change 1+ /*
2+ * Licensed to the Apache Software Foundation (ASF) under one or more
3+ * contributor license agreements. See the NOTICE file distributed with
4+ * this work for additional information regarding copyright ownership.
5+ * The ASF licenses this file to You under the Apache License, Version 2.0
6+ * (the "License"); you may not use this file except in compliance with
7+ * the License. You may obtain a copy of the License at
8+ *
9+ * http://www.apache.org/licenses/LICENSE-2.0
10+ *
11+ * Unless required by applicable law or agreed to in writing, software
12+ * distributed under the License is distributed on an "AS IS" BASIS,
13+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+ * See the License for the specific language governing permissions and
15+ * limitations under the License.
16+ */
17+
18+ package org .apache .fluss .fs .s3 .exception ;
19+
20+ /** Exception thrown when no credentials were found. */
21+ public class InvalidCredentialsException extends RuntimeException {
22+
23+ public static final String E_NO_AWS_CREDENTIALS = "No AWS Credentials" ;
24+
25+ public InvalidCredentialsException (String credentialProvider ) {
26+ this (credentialProvider , null );
27+ }
28+
29+ public InvalidCredentialsException (String credentialProvider , Throwable throwable ) {
30+ super (credentialProvider + ": " + E_NO_AWS_CREDENTIALS , throwable );
31+ }
32+ }
Original file line number Diff line number Diff line change 1717
1818package org .apache .fluss .fs .s3 .token ;
1919
20+ import org .apache .fluss .fs .s3 .exception .InvalidCredentialsException ;
2021import org .apache .fluss .fs .token .Credentials ;
2122
2223import com .amazonaws .auth .AWSCredentials ;
2324import com .amazonaws .auth .AWSCredentialsProvider ;
2425import com .amazonaws .auth .BasicSessionCredentials ;
25- import org .apache .hadoop .fs .s3a .auth .NoAwsCredentialsException ;
2626import org .slf4j .Logger ;
2727import org .slf4j .LoggerFactory ;
2828
@@ -46,7 +46,7 @@ public AWSCredentials getCredentials() {
4646 Credentials credentials = S3DelegationTokenReceiver .getCredentials ();
4747
4848 if (credentials == null ) {
49- throw new NoAwsCredentialsException (COMPONENT );
49+ throw new InvalidCredentialsException (COMPONENT );
5050 }
5151 LOG .debug ("Providing session credentials" );
5252 return new BasicSessionCredentials (
Original file line number Diff line number Diff line change 1717
1818package org .apache .fluss .fs .s3 .token ;
1919
20+ import org .apache .fluss .fs .s3 .exception .InvalidCredentialsException ;
2021import org .apache .fluss .fs .token .Credentials ;
2122import org .apache .fluss .fs .token .CredentialsJsonSerde ;
2223import org .apache .fluss .fs .token .ObtainedSecurityToken ;
2324import org .apache .fluss .fs .token .SecurityTokenReceiver ;
2425
25- import org .apache .hadoop .fs .s3a .auth .NoAwsCredentialsException ;
2626import org .slf4j .Logger ;
2727import org .slf4j .LoggerFactory ;
2828
@@ -63,7 +63,7 @@ public static void updateHadoopConfig(org.apache.hadoop.conf.Configuration hadoo
6363 if (additionInfos == null ) {
6464 // if addition info is null, it also means we have not received any token,
6565 // we throw InvalidCredentialsException
66- throw new NoAwsCredentialsException (DynamicTemporaryAWSCredentialsProvider .COMPONENT );
66+ throw new InvalidCredentialsException (DynamicTemporaryAWSCredentialsProvider .COMPONENT );
6767 } else {
6868 for (Map .Entry <String , String > entry : additionInfos .entrySet ()) {
6969 hadoopConfig .set (entry .getKey (), entry .getValue ());
You can’t perform that action at this time.
0 commit comments