forked from apache/shardingsphere
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename AuthorityProviderAlgorithm to AuthorityProvider (apache#23984)
- Loading branch information
Showing
9 changed files
with
28 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,8 +19,8 @@ | |
|
||
import org.apache.shardingsphere.authority.model.AuthorityRegistry; | ||
import org.apache.shardingsphere.authority.model.ShardingSpherePrivileges; | ||
import org.apache.shardingsphere.authority.provider.database.DatabasePermittedPrivilegesProviderAlgorithm; | ||
import org.apache.shardingsphere.authority.spi.AuthorityProviderAlgorithm; | ||
import org.apache.shardingsphere.authority.provider.database.DatabasePermittedPrivilegesProvider; | ||
import org.apache.shardingsphere.authority.spi.AuthorityProvider; | ||
import org.apache.shardingsphere.infra.metadata.user.Grantee; | ||
import org.apache.shardingsphere.infra.metadata.user.ShardingSphereUser; | ||
import org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPILoader; | ||
|
@@ -39,9 +39,9 @@ public final class DatabasePermittedPrivilegesProviderAlgorithmTest { | |
@Test | ||
public void assertBuildAuthorityRegistry() { | ||
Properties props = PropertiesBuilder.build( | ||
new Property(DatabasePermittedPrivilegesProviderAlgorithm.PROP_USER_DATABASE_MAPPINGS, "root@localhost=test, [email protected]=db_dal_admin, user1@=test, user1@=test1, user1@=*")); | ||
AuthorityProviderAlgorithm algorithm = TypedSPILoader.getService(AuthorityProviderAlgorithm.class, "DATABASE_PERMITTED", props); | ||
AuthorityRegistry actual = algorithm.buildAuthorityRegistry(Collections.emptyMap(), Collections.singletonList(new ShardingSphereUser("user1", "", "127.0.0.2"))); | ||
new Property(DatabasePermittedPrivilegesProvider.PROP_USER_DATABASE_MAPPINGS, "root@localhost=test, [email protected]=db_dal_admin, user1@=test, user1@=test1, user1@=*")); | ||
AuthorityProvider provider = TypedSPILoader.getService(AuthorityProvider.class, "DATABASE_PERMITTED", props); | ||
AuthorityRegistry actual = provider.buildAuthorityRegistry(Collections.emptyMap(), Collections.singletonList(new ShardingSphereUser("user1", "", "127.0.0.2"))); | ||
Optional<ShardingSpherePrivileges> privileges = actual.findPrivileges(new Grantee("user1", "127.0.0.2")); | ||
assertTrue(privileges.isPresent()); | ||
assertTrue(privileges.get().hasPrivileges("test")); | ||
|