Skip to content

Commit ffd4310

Browse files
committed
Remove commons-codec dependency
follow-up to f8ad77a we can simply use guava instead and eliminate the extra dependency
1 parent 6137e42 commit ffd4310

File tree

6 files changed

+35
-5
lines changed

6 files changed

+35
-5
lines changed

gradle/libs.versions.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ awssdk-bom = { module = "software.amazon.awssdk:bom", version = "2.33.0" }
4545
awaitility = { module = "org.awaitility:awaitility", version = "4.3.0" }
4646
azuresdk-bom = { module = "com.azure:azure-sdk-bom", version = "1.2.37" }
4747
caffeine = { module = "com.github.ben-manes.caffeine:caffeine", version = "3.2.2" }
48-
commons-codec = { module = "commons-codec:commons-codec", version = "1.19.0" }
4948
commons-lang3 = { module = "org.apache.commons:commons-lang3", version = "3.18.0" }
5049
commons-text = { module = "org.apache.commons:commons-text", version = "1.14.0" }
5150
eclipselink = { module = "org.eclipse.persistence:eclipselink", version = "4.0.7" }

polaris-core/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ dependencies {
4242
runtimeOnly("com.fasterxml.jackson.datatype:jackson-datatype-jsr310")
4343

4444
implementation(libs.caffeine)
45-
implementation(libs.commons.codec)
4645
implementation(libs.guava)
4746
implementation(libs.slf4j.api)
4847

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
package org.apache.polaris.core;
20+
21+
import com.google.common.hash.Hashing;
22+
import java.nio.charset.StandardCharsets;
23+
24+
public final class DigestUtils {
25+
private DigestUtils() {
26+
// utils class
27+
}
28+
29+
public static String sha256Hex(String input) {
30+
return Hashing.sha256().hashString(input, StandardCharsets.UTF_8).toString();
31+
}
32+
}

polaris-core/src/main/java/org/apache/polaris/core/entity/PolarisPrincipalSecrets.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import com.fasterxml.jackson.annotation.JsonProperty;
2323
import jakarta.annotation.Nullable;
2424
import java.security.SecureRandom;
25-
import org.apache.commons.codec.digest.DigestUtils;
25+
import org.apache.polaris.core.DigestUtils;
2626

2727
/**
2828
* Simple class to represent the secrets used to authenticate a catalog principal, These secrets are

polaris-core/src/main/java/org/apache/polaris/core/secrets/UnsafeInMemorySecretsManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import java.util.Map;
2828
import java.util.Objects;
2929
import java.util.concurrent.ConcurrentHashMap;
30-
import org.apache.commons.codec.digest.DigestUtils;
30+
import org.apache.polaris.core.DigestUtils;
3131
import org.apache.polaris.core.entity.PolarisEntityCore;
3232

3333
/**

runtime/service/src/main/java/org/apache/polaris/service/http/IcebergHttpUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919
package org.apache.polaris.service.http;
2020

21-
import org.apache.commons.codec.digest.DigestUtils;
21+
import org.apache.polaris.core.DigestUtils;
2222

2323
/** Utility class that encapsulates logic pertaining to Iceberg REST specific concepts. */
2424
public class IcebergHttpUtil {

0 commit comments

Comments
 (0)