Remove uses of the org.apache.geode.management.internal.security.ResourceConstants class to refer to Security constants and properties.
Resolves gh-70.
This commit is contained in:
@@ -13,17 +13,17 @@
|
||||
* or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.geode.security;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import org.apache.geode.LogWriter;
|
||||
import org.apache.geode.distributed.DistributedMember;
|
||||
import org.apache.geode.management.internal.security.ResourceConstants;
|
||||
import org.apache.geode.security.AuthInitialize;
|
||||
import org.apache.geode.security.AuthenticationFailedException;
|
||||
|
||||
import org.springframework.geode.util.GeodeConstants;
|
||||
|
||||
/**
|
||||
* Simple, test {@link AuthInitialize} implementation.
|
||||
*
|
||||
@@ -51,11 +51,11 @@ public class TestAuthInitialize implements AuthInitialize {
|
||||
|
||||
Properties credentials = new Properties();
|
||||
|
||||
credentials.setProperty(ResourceConstants.USER_NAME,
|
||||
securityProperties.getProperty(ResourceConstants.USER_NAME, DEFAULT_USERNAME));
|
||||
credentials.setProperty(GeodeConstants.USERNAME,
|
||||
securityProperties.getProperty(GeodeConstants.USERNAME, DEFAULT_USERNAME));
|
||||
|
||||
credentials.setProperty(ResourceConstants.PASSWORD,
|
||||
securityProperties.getProperty(ResourceConstants.PASSWORD, DEFAULT_PASSWORD));
|
||||
credentials.setProperty(GeodeConstants.PASSWORD,
|
||||
securityProperties.getProperty(GeodeConstants.PASSWORD, DEFAULT_PASSWORD));
|
||||
|
||||
return credentials;
|
||||
}
|
||||
|
||||
@@ -19,9 +19,10 @@ import java.io.Serializable;
|
||||
import java.security.Principal;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.apache.geode.management.internal.security.ResourceConstants;
|
||||
import org.apache.geode.security.AuthenticationFailedException;
|
||||
|
||||
import org.springframework.geode.util.GeodeConstants;
|
||||
|
||||
/**
|
||||
* Simple, test {@link org.apache.geode.security.SecurityManager}.
|
||||
*
|
||||
@@ -37,8 +38,8 @@ public class TestSecurityManager implements org.apache.geode.security.SecurityMa
|
||||
@Override
|
||||
public Object authenticate(Properties credentials) throws AuthenticationFailedException {
|
||||
|
||||
String username = credentials.getProperty(ResourceConstants.USER_NAME);
|
||||
String password = credentials.getProperty(ResourceConstants.PASSWORD);
|
||||
String username = credentials.getProperty(GeodeConstants.USERNAME);
|
||||
String password = credentials.getProperty(GeodeConstants.PASSWORD);
|
||||
|
||||
if (!String.valueOf(username).equals(password)) {
|
||||
throw new AuthenticationFailedException(String.format("User [%s] could not be authenticated", username));
|
||||
|
||||
Reference in New Issue
Block a user