Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2013-10-29 01:02:32 +0000
committerEike Stepper2013-11-06 07:15:23 +0000
commitf61eb9d90cf4076baab01072c005e9cbf0fecdce (patch)
tree511b51bde08711094b795882a5c29caeee2aad4f /plugins/org.eclipse.emf.cdo.server.net4j
parentc91aa2d8d8c0c7d97e62a69f081333dbd22eafe2 (diff)
downloadcdo-f61eb9d90cf4076baab01072c005e9cbf0fecdce.tar.gz
cdo-f61eb9d90cf4076baab01072c005e9cbf0fecdce.tar.xz
cdo-f61eb9d90cf4076baab01072c005e9cbf0fecdce.zip
[418454] [Admin] Client API and UI for managing repositories in a server
https://bugs.eclipse.org/bugs/show_bug.cgi?id=418454 Implementation of the server-side CDOAdmin, including a new Repository Configuration Manager implemented in a repository dedicated to server administration. It provides local storage of XML configurations files for repositories added via the admin protocol and an app extension to find and start them on CDO server start-up. It also provides server-wide authentication of the repository administration functions (create/delete repository) via its Administrator account. Includes some refactorings: - pull up abstract authentication signal from CDO protocol into Net4j layer (includes pulling up NotAuthenticatedException and deprecating the API from CDO Common) - pull up authentication protocol from internal CDO protocol - add authentication challenge to CDO Admin protocol Also distinguish between repositories that can and cannot be deleted because they are permanently configured in the server's XML configuration file. On top of the revised CDOAdmin protocol are built some UI actions for - deletion of a repository, including confirmation dialog and error handling - creation of a repository (two-step wizard) Both actions require authorization by providing the credentials of the admin repository's administrator user. Change-Id: Iedf26e20c2a379553295806250d63227f0e0a35f Signed-off-by: Eike Stepper <stepper@esc-net.de>
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.server.net4j')
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/AuthenticationRequest.java78
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerProtocol.java9
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ChangeCredentialsIndication.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CredentialsChallengeRequest.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/OpenSessionIndication.java3
5 files changed, 10 insertions, 84 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/AuthenticationRequest.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/AuthenticationRequest.java
deleted file mode 100644
index a4a5da0526..0000000000
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/AuthenticationRequest.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.server.internal.net4j.protocol;
-
-import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
-import org.eclipse.emf.cdo.common.util.NotAuthenticatedException;
-
-import org.eclipse.net4j.signal.RemoteException;
-import org.eclipse.net4j.signal.RequestWithMonitoring;
-import org.eclipse.net4j.util.io.ExtendedDataInputStream;
-import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
-import org.eclipse.net4j.util.om.monitor.OMMonitor;
-import org.eclipse.net4j.util.security.DiffieHellman.Client.Response;
-import org.eclipse.net4j.util.security.DiffieHellman.Server.Challenge;
-
-/**
- * @author Eike Stepper
- */
-public class AuthenticationRequest extends RequestWithMonitoring<Response>
-{
- private Challenge challenge;
-
- public AuthenticationRequest(CDOServerProtocol protocol, Challenge challenge)
- {
- super(protocol, CDOProtocolConstants.SIGNAL_AUTHENTICATION);
- this.challenge = challenge;
- }
-
- @Override
- protected void requesting(ExtendedDataOutputStream out, OMMonitor monitor) throws Exception
- {
- challenge.write(out);
- }
-
- @Override
- protected Response confirming(ExtendedDataInputStream in, OMMonitor monitor) throws Exception
- {
- try
- {
- if (in.readBoolean())
- {
- return new Response(in);
- }
- }
- catch (RemoteException ex)
- {
- if (ex.getCause() instanceof NotAuthenticatedException)
- {
- // Skip silently because user has canceled the authentication
- }
- else
- {
- throw ex;
- }
- }
- catch (Exception ex)
- {
- if (ex instanceof NotAuthenticatedException)
- {
- // Skip silently because user has canceled the authentication
- }
- else
- {
- throw ex;
- }
- }
-
- return null;
- }
-}
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerProtocol.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerProtocol.java
index cc483d5fec..633112c639 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerProtocol.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerProtocol.java
@@ -19,6 +19,7 @@ import org.eclipse.emf.cdo.common.CDOCommonRepository;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.lock.CDOLockChangeInfo;
+import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
import org.eclipse.emf.cdo.server.IRepositoryProvider;
import org.eclipse.emf.cdo.server.internal.net4j.bundle.OM;
import org.eclipse.emf.cdo.session.remote.CDORemoteSessionMessage;
@@ -28,6 +29,7 @@ import org.eclipse.emf.cdo.spi.server.InternalSession;
import org.eclipse.net4j.signal.SignalProtocol;
import org.eclipse.net4j.signal.SignalReactor;
+import org.eclipse.net4j.signal.security.AuthenticationRequest;
import org.eclipse.net4j.util.io.StringCompressor;
import org.eclipse.net4j.util.io.StringIO;
import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
@@ -94,11 +96,12 @@ public class CDOServerProtocol extends SignalProtocol<InternalSession> implement
public Response sendAuthenticationChallenge(Challenge challenge) throws Exception
{
- return new AuthenticationRequest(this, challenge).send(negotiationTimeout);
+ return new AuthenticationRequest(this, CDOProtocolConstants.SIGNAL_AUTHENTICATION, challenge)
+ .send(negotiationTimeout);
}
- public Response sendCredentialsChallenge(Challenge challenge, String userID,
- CredentialsUpdateOperation operation) throws Exception
+ public Response sendCredentialsChallenge(Challenge challenge, String userID, CredentialsUpdateOperation operation)
+ throws Exception
{
return new CredentialsChallengeRequest(this, challenge, userID, operation).send(negotiationTimeout);
}
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ChangeCredentialsIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ChangeCredentialsIndication.java
index 1da4debc74..fc2ff7073f 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ChangeCredentialsIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ChangeCredentialsIndication.java
@@ -13,7 +13,6 @@ package org.eclipse.emf.cdo.server.internal.net4j.protocol;
import org.eclipse.emf.cdo.common.protocol.CDODataInput;
import org.eclipse.emf.cdo.common.protocol.CDODataOutput;
import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
-import org.eclipse.emf.cdo.common.util.NotAuthenticatedException;
import org.eclipse.emf.cdo.server.internal.net4j.bundle.OM;
import org.eclipse.emf.cdo.spi.server.InternalSessionManager;
@@ -21,6 +20,7 @@ import org.eclipse.net4j.util.om.monitor.OMMonitor;
import org.eclipse.net4j.util.om.monitor.OMMonitor.Async;
import org.eclipse.net4j.util.om.trace.ContextTracer;
import org.eclipse.net4j.util.security.CredentialsUpdateOperation;
+import org.eclipse.net4j.util.security.NotAuthenticatedException;
/**
* Handles the request from a client to initiate the change-credentials protocol.
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CredentialsChallengeRequest.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CredentialsChallengeRequest.java
index fa7c901df5..1c28697500 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CredentialsChallengeRequest.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CredentialsChallengeRequest.java
@@ -11,7 +11,6 @@
package org.eclipse.emf.cdo.server.internal.net4j.protocol;
import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
-import org.eclipse.emf.cdo.common.util.NotAuthenticatedException;
import org.eclipse.net4j.signal.RemoteException;
import org.eclipse.net4j.signal.RequestWithMonitoring;
@@ -21,6 +20,7 @@ import org.eclipse.net4j.util.om.monitor.OMMonitor;
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;
+import org.eclipse.net4j.util.security.NotAuthenticatedException;
/**
* Server-initiated request to change the user's password. It incorporates and extends the
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/OpenSessionIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/OpenSessionIndication.java
index 89879c6ae0..32c336d818 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/OpenSessionIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/OpenSessionIndication.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
+ * Christian W. Damus (CEA LIST) - bug 418454
*/
package org.eclipse.emf.cdo.server.internal.net4j.protocol;
@@ -17,7 +18,6 @@ import org.eclipse.emf.cdo.common.model.CDOPackageUnit;
import org.eclipse.emf.cdo.common.protocol.CDODataInput;
import org.eclipse.emf.cdo.common.protocol.CDODataOutput;
import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
-import org.eclipse.emf.cdo.common.util.NotAuthenticatedException;
import org.eclipse.emf.cdo.server.IRepositoryProvider;
import org.eclipse.emf.cdo.server.RepositoryNotFoundException;
import org.eclipse.emf.cdo.server.internal.net4j.bundle.OM;
@@ -28,6 +28,7 @@ import org.eclipse.emf.cdo.spi.server.InternalSessionManager;
import org.eclipse.net4j.util.om.monitor.OMMonitor;
import org.eclipse.net4j.util.om.monitor.OMMonitor.Async;
import org.eclipse.net4j.util.om.trace.ContextTracer;
+import org.eclipse.net4j.util.security.NotAuthenticatedException;
import java.util.Set;

Back to the top