Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#5993] refactor: Move the JdbcAuthorizationPlugin to authorization-common module #5994

Merged
merged 2 commits into from
Dec 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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: 1 addition & 0 deletions authorizations/authorization-common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ dependencies {
}
implementation(libs.bundles.log4j)
implementation(libs.commons.lang3)
implementation(libs.commons.dbcp2)
implementation(libs.guava)
implementation(libs.javax.jaxb.api) {
exclude("*")
Expand Down
Copy link
Member

Choose a reason for hiding this comment

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

I think it is better moving to authorization/jdbc/ directory.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.gravitino.authorization.jdbc;
package org.apache.gravitino.authorization.common;

import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.Lists;
Expand All @@ -40,7 +40,6 @@
import org.apache.gravitino.authorization.RoleChange;
import org.apache.gravitino.authorization.SecurableObject;
import org.apache.gravitino.authorization.User;
import org.apache.gravitino.authorization.common.JdbcAuthorizationProperties;
import org.apache.gravitino.connector.authorization.AuthorizationPlugin;
import org.apache.gravitino.exceptions.AuthorizationPluginException;
import org.apache.gravitino.meta.AuditInfo;
Expand All @@ -55,7 +54,7 @@
* JDBC-based authorization plugins can inherit this class and implement their own SQL statements.
*/
@Unstable
abstract class JdbcAuthorizationPlugin implements AuthorizationPlugin, JdbcAuthorizationSQL {
public abstract class JdbcAuthorizationPlugin implements AuthorizationPlugin, JdbcAuthorizationSQL {

private static final String GROUP_PREFIX = "GRAVITINO_GROUP_";
private static final Logger LOG = LoggerFactory.getLogger(JdbcAuthorizationPlugin.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.gravitino.authorization.jdbc;
package org.apache.gravitino.authorization.common;

import java.util.List;
import org.apache.gravitino.MetadataObject;
Expand All @@ -25,7 +25,7 @@

/** Interface for SQL operations of the underlying access control system. */
@Unstable
interface JdbcAuthorizationSQL {
public interface JdbcAuthorizationSQL {

/**
* Get SQL statements for creating a user.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.gravitino.authorization.jdbc;
package org.apache.gravitino.authorization.common;

import com.google.common.base.Preconditions;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.gravitino.authorization.jdbc;
package org.apache.gravitino.authorization.common;

import org.apache.gravitino.authorization.AuthorizationPrivilege;
import org.apache.gravitino.authorization.Privilege;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.gravitino.authorization.jdbc;
package org.apache.gravitino.authorization.common;

import java.util.List;
import org.apache.gravitino.MetadataObject;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.gravitino.authorization.jdbc;
package org.apache.gravitino.authorization.common;

import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.gravitino.authorization.jdbc;
package org.apache.gravitino.authorization.common;

import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
Expand All @@ -34,15 +34,14 @@
import org.apache.gravitino.authorization.SecurableObject;
import org.apache.gravitino.authorization.SecurableObjects;
import org.apache.gravitino.authorization.User;
import org.apache.gravitino.authorization.common.JdbcAuthorizationProperties;
import org.apache.gravitino.meta.AuditInfo;
import org.apache.gravitino.meta.GroupEntity;
import org.apache.gravitino.meta.RoleEntity;
import org.apache.gravitino.meta.UserEntity;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public class JdbcAuthorizationPluginTest {
public class TestJdbcAuthorizationPlugin {
private static List<String> expectSQLs = Lists.newArrayList();
private static List<MetadataObject.Type> expectTypes = Lists.newArrayList();
private static List<String> expectObjectNames = Lists.newArrayList();
Expand Down
96 changes: 0 additions & 96 deletions authorizations/authorization-jdbc/build.gradle.kts

This file was deleted.

2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ if (gradle.startParameter.projectProperties["enableFuse"]?.toBoolean() == true)
}
include("iceberg:iceberg-common")
include("iceberg:iceberg-rest-server")
include("authorizations:authorization-ranger", "authorizations:authorization-jdbc", "authorizations:authorization-common", "authorizations:authorization-chain")
include("authorizations:authorization-ranger", "authorizations:authorization-common", "authorizations:authorization-chain")
include("trino-connector:trino-connector", "trino-connector:integration-test")
include("spark-connector:spark-common")
// kyuubi hive connector doesn't support 2.13 for Spark3.3
Expand Down
Loading