Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ awssdk-bom = { module = "software.amazon.awssdk:bom", version = "2.33.0" }
awaitility = { module = "org.awaitility:awaitility", version = "4.3.0" }
azuresdk-bom = { module = "com.azure:azure-sdk-bom", version = "1.2.38" }
caffeine = { module = "com.github.ben-manes.caffeine:caffeine", version = "3.2.2" }
commons-codec = { module = "commons-codec:commons-codec", version = "1.19.0" }
commons-lang3 = { module = "org.apache.commons:commons-lang3", version = "3.18.0" }
commons-text = { module = "org.apache.commons:commons-text", version = "1.14.0" }
eclipselink = { module = "org.eclipse.persistence:eclipselink", version = "4.0.7" }
Expand Down
1 change: 0 additions & 1 deletion polaris-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ dependencies {
runtimeOnly("com.fasterxml.jackson.datatype:jackson-datatype-jsr310")

implementation(libs.caffeine)
implementation(libs.commons.codec)
implementation(libs.guava)
implementation(libs.slf4j.api)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* 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;

import com.google.common.hash.Hashing;
import java.nio.charset.StandardCharsets;

public final class DigestUtils {
private DigestUtils() {
// utils class
}

public static String sha256Hex(String input) {
return Hashing.sha256().hashString(input, StandardCharsets.UTF_8).toString();
Copy link
Contributor Author

@XN137 XN137 Aug 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some basic local testing to confirm this produces the same results as org.apache.polaris.core.DigestUtils.sha256Hex:

Input: 
guava -> e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
codec -> e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
Input: foobar
guava -> c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2
codec -> c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2
Input: ajsdljaksl-92301928i390!@#$%^&*()_+
guava -> ee7a434dd148156b40dd00ad567c37dea7297ebccb6df0f7a5be064c97dcb18b
codec -> ee7a434dd148156b40dd00ad567c37dea7297ebccb6df0f7a5be064c97dcb18b
Input: 😀
guava -> f0443a342c5ef54783a111b51ba56c938e474c32324d90c3a60c9c8e3a37e2d9
codec -> f0443a342c5ef54783a111b51ba56c938e474c32324d90c3a60c9c8e3a37e2d9

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import jakarta.annotation.Nullable;
import java.security.SecureRandom;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.polaris.core.DigestUtils;

/**
* Simple class to represent the secrets used to authenticate a catalog principal, These secrets are
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.polaris.core.DigestUtils;
import org.apache.polaris.core.entity.PolarisEntityCore;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
package org.apache.polaris.service.http;

import org.apache.commons.codec.digest.DigestUtils;
import org.apache.polaris.core.DigestUtils;

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