Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2013-10-25 07:36:28 +0000
committerChristian W. Damus2013-10-25 15:20:05 +0000
commit1851055a45b9e47e92949ff4a4dd6d99c831fdfb (patch)
tree25bfba9e6146d33316a48ead249305a479b7dfff /plugins/org.eclipse.emf.cdo.server
parent98dd1927de57f31ef26e6f265a2879eec3ba350c (diff)
downloadcdo-1851055a45b9e47e92949ff4a4dd6d99c831fdfb.tar.gz
cdo-1851055a45b9e47e92949ff4a4dd6d99c831fdfb.tar.xz
cdo-1851055a45b9e47e92949ff4a4dd6d99c831fdfb.zip
[399306] [Security] Add password management
https://bugs.eclipse.org/bugs/show_bug.cgi?id=399306
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.server')
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/ServerCDOView.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java16
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSession.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSessionProtocol.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedServerSessionProtocol.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/ISessionProtocol.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalSessionManager.java8
7 files changed, 24 insertions, 18 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/ServerCDOView.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/ServerCDOView.java
index 051b538335..d680fec1ae 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/ServerCDOView.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/ServerCDOView.java
@@ -7,7 +7,7 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
- * Christian W. Damus (CEA LIST) - 399306
+ * Christian W. Damus (CEA LIST) - bug 399306
*/
package org.eclipse.emf.cdo.internal.server;
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java
index ace06a84e2..55a37a517b 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java
@@ -9,7 +9,7 @@
* Eike Stepper - initial API and implementation
* Simon McDuff - bug 201266
* Simon McDuff - bug 202725
- * Christian W. Damus (CEA LIST) - 399306
+ * Christian W. Damus (CEA LIST) - bug 399306
*/
package org.eclipse.emf.cdo.internal.server;
@@ -37,6 +37,7 @@ import org.eclipse.net4j.util.container.Container;
import org.eclipse.net4j.util.io.ExtendedDataInputStream;
import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
import org.eclipse.net4j.util.om.trace.ContextTracer;
+import org.eclipse.net4j.util.security.CredentialsUpdateOperation;
import org.eclipse.net4j.util.security.DiffieHellman;
import org.eclipse.net4j.util.security.DiffieHellman.Client.Response;
import org.eclipse.net4j.util.security.DiffieHellman.Server.Challenge;
@@ -439,17 +440,18 @@ public class SessionManager extends Container<ISession> implements InternalSessi
}
}
- public void changeUserCredentials(ISessionProtocol sessionProtocol)
+ public void changeUserCredentials(ISessionProtocol sessionProtocol, String userID)
{
- changeUserCredentials(sessionProtocol, null, false);
+ changeUserCredentials(sessionProtocol, userID, CredentialsUpdateOperation.CHANGE_PASSWORD);
}
public void resetUserCredentials(ISessionProtocol sessionProtocol, String userID)
{
- changeUserCredentials(sessionProtocol, userID, true);
+ changeUserCredentials(sessionProtocol, userID, CredentialsUpdateOperation.RESET_PASSWORD);
}
- protected void changeUserCredentials(ISessionProtocol sessionProtocol, String userID, boolean isReset)
+ protected void changeUserCredentials(ISessionProtocol sessionProtocol, String userID,
+ CredentialsUpdateOperation operation)
{
if (sessionProtocol == null)
@@ -470,7 +472,7 @@ public class SessionManager extends Container<ISession> implements InternalSessi
try
{
Challenge challenge = authenticationServer.getChallenge();
- Response response = sessionProtocol.sendChangeCredentialsChallenge(challenge, userID, isReset);
+ Response response = sessionProtocol.sendCredentialsChallenge(challenge, userID, operation);
if (response == null)
{
throw new NotAuthenticatedException();
@@ -480,7 +482,7 @@ public class SessionManager extends Container<ISession> implements InternalSessi
@SuppressWarnings("resource")
ExtendedDataInputStream stream = new ExtendedDataInputStream(baos);
- if (isReset)
+ if (operation == CredentialsUpdateOperation.RESET_PASSWORD)
{
String adminID = stream.readString();
char[] adminPassword = stream.readString().toCharArray();
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSession.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSession.java
index 5f99a9df65..b8a3fb874c 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSession.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSession.java
@@ -8,7 +8,7 @@
* Contributors:
* Eike Stepper - initial API and implementation
* Andre Dietisheim - bug 256649
- * Christian W. Damus (CEA LIST) - 399306
+ * Christian W. Damus (CEA LIST) - bug 399306
*/
package org.eclipse.emf.cdo.internal.server.embedded;
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSessionProtocol.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSessionProtocol.java
index a2bbf9b669..1569e4f9a6 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSessionProtocol.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSessionProtocol.java
@@ -7,7 +7,7 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
- * Christian W. Damus (CEA LIST) - 399306
+ * Christian W. Damus (CEA LIST) - bug 399306
*/
package org.eclipse.emf.cdo.internal.server.embedded;
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedServerSessionProtocol.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedServerSessionProtocol.java
index deb256a718..94ecdf8819 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedServerSessionProtocol.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedServerSessionProtocol.java
@@ -7,7 +7,7 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
- * Christian W. Damus (CEA LIST) - 399306
+ * Christian W. Damus (CEA LIST) - bug 399306
*/
package org.eclipse.emf.cdo.internal.server.embedded;
@@ -22,6 +22,7 @@ import org.eclipse.emf.cdo.spi.server.InternalRepository;
import org.eclipse.emf.cdo.spi.server.InternalSession;
import org.eclipse.net4j.util.lifecycle.Lifecycle;
+import org.eclipse.net4j.util.security.CredentialsUpdateOperation;
import org.eclipse.net4j.util.security.DiffieHellman.Client.Response;
import org.eclipse.net4j.util.security.DiffieHellman.Server.Challenge;
@@ -71,7 +72,8 @@ public class EmbeddedServerSessionProtocol extends Lifecycle implements ISession
throw new UnsupportedOperationException();
}
- public Response sendChangeCredentialsChallenge(Challenge challenge, String userID, boolean isReset) throws Exception
+ public Response sendCredentialsChallenge(Challenge challenge, String userID,
+ CredentialsUpdateOperation operation) throws Exception
{
throw new UnsupportedOperationException();
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/ISessionProtocol.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/ISessionProtocol.java
index 911b88c74b..b70749cd09 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/ISessionProtocol.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/ISessionProtocol.java
@@ -7,7 +7,7 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
- * Christian W. Damus (CEA LIST) - 399306
+ * Christian W. Damus (CEA LIST) - bug 399306
*/
package org.eclipse.emf.cdo.spi.server;
@@ -19,6 +19,7 @@ import org.eclipse.emf.cdo.common.protocol.CDOProtocol;
import org.eclipse.emf.cdo.session.remote.CDORemoteSessionMessage;
import org.eclipse.emf.cdo.spi.common.branch.InternalCDOBranch;
+import org.eclipse.net4j.util.security.CredentialsUpdateOperation;
import org.eclipse.net4j.util.security.DiffieHellman.Client.Response;
import org.eclipse.net4j.util.security.DiffieHellman.Server.Challenge;
@@ -48,7 +49,8 @@ public interface ISessionProtocol extends CDOProtocol
/**
* @since 4.3
*/
- public Response sendChangeCredentialsChallenge(Challenge challenge, String userID, boolean isReset) throws Exception;
+ public Response sendCredentialsChallenge(Challenge challenge, String userID,
+ CredentialsUpdateOperation operation) throws Exception;
public void sendRepositoryTypeNotification(CDOCommonRepository.Type oldType, CDOCommonRepository.Type newType)
throws Exception;
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalSessionManager.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalSessionManager.java
index 1623720a3b..f6c574a149 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalSessionManager.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalSessionManager.java
@@ -7,7 +7,7 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
- * Christian W. Damus (CEA LIST) - 399306
+ * Christian W. Damus (CEA LIST) - bug 399306
*/
package org.eclipse.emf.cdo.spi.server;
@@ -67,15 +67,15 @@ public interface InternalSessionManager extends ISessionManager
/**
* Initiates the change-credentials protocol with the client and processes the
* client response to update the user's credentials.
- *
+ *
* @since 4.3
*/
- public void changeUserCredentials(ISessionProtocol sessionProtocol);
+ public void changeUserCredentials(ISessionProtocol sessionProtocol, String userID);
/**
* Initiates the administrative reset-credentials protocol with the client and
* processes the client response to reset the specified {@code userID}'s credentials.
- *
+ *
* @since 4.3
*/
public void resetUserCredentials(ISessionProtocol sessionProtocol, String userID);

Back to the top