directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1446115 - in /directory/studio/trunk: ./ application/application-plugins/ plugins/apacheds.configuration.v2/ plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ repository/
Date Thu, 14 Feb 2013 11:02:08 GMT
Author: pamarcelot
Date: Thu Feb 14 11:02:07 2013
New Revision: 1446115

URL: http://svn.apache.org/r1446115
Log:
Fix for:
- DIRSTUDIO-872 (The list of possible Kerberos encryption type should be available)
- DIRSTUDIO-873 (Kerberos encryption types are not saved correctly)

Modified:
    directory/studio/trunk/application/application-plugins/pom.xml
    directory/studio/trunk/plugins/apacheds.configuration.v2/pom.xml
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/KerberosServerPage.java
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/messages.properties
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/messages_de.properties
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/messages_fr.properties
    directory/studio/trunk/pom.xml
    directory/studio/trunk/repository/pom.xml

Modified: directory/studio/trunk/application/application-plugins/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/application/application-plugins/pom.xml?rev=1446115&r1=1446114&r2=1446115&view=diff
==============================================================================
--- directory/studio/trunk/application/application-plugins/pom.xml (original)
+++ directory/studio/trunk/application/application-plugins/pom.xml Thu Feb 14 11:02:07 2013
@@ -140,10 +140,6 @@
                 </artifactItem>
                 <artifactItem>
                   <groupId>org.apache.directory.server</groupId>
-                  <artifactId>apacheds-server-config</artifactId>
-                </artifactItem>
-                <artifactItem>
-                  <groupId>org.apache.directory.server</groupId>
                   <artifactId>apacheds-core</artifactId>
                 </artifactItem>
                 <artifactItem>
@@ -164,10 +160,18 @@
                 </artifactItem>
                 <artifactItem>
                   <groupId>org.apache.directory.server</groupId>
+                  <artifactId>apacheds-kerberos-codec</artifactId>
+                </artifactItem>
+                <artifactItem>
+                  <groupId>org.apache.directory.server</groupId>
                   <artifactId>apacheds-ldif-partition</artifactId>
                 </artifactItem>
                 <artifactItem>
                   <groupId>org.apache.directory.server</groupId>
+                  <artifactId>apacheds-server-config</artifactId>
+                </artifactItem>
+                <artifactItem>
+                  <groupId>org.apache.directory.server</groupId>
                   <artifactId>apacheds-xdbm-partition</artifactId>
                 </artifactItem>
                 <artifactItem>

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/pom.xml?rev=1446115&r1=1446114&r2=1446115&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/pom.xml (original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/pom.xml Thu Feb 14 11:02:07 2013
@@ -113,6 +113,7 @@
             <Require-Bundle>org.apache.commons.io;bundle-version="${org.apache.commons.io.version}",
  org.apache.directory.server.core.api;bundle-version="${org.apache.directory.server.validversion}",
  org.apache.directory.server.config;bundle-version="${org.apache.directory.server.validversion}",
+ org.apache.directory.server.kerberos.codec;bundle-version="${org.apache.directory.server.validversion}",
  org.apache.directory.server.ldif.partition;bundle-version="${org.apache.directory.server.validversion}",
  org.apache.directory.server.xdbm.partition;bundle-version="${org.apache.directory.server.validversion}",
  org.apache.directory.api.ldap.model;bundle-version="${org.apache.directory.api.validversion}",
@@ -219,7 +220,7 @@
     </dependency>
     <dependency>
       <groupId>org.apache.directory.server</groupId>
-      <artifactId>apacheds-server-config</artifactId>
+      <artifactId>apacheds-kerberos-codec</artifactId>
       <scope>provided</scope>
     </dependency>
     <dependency>
@@ -229,6 +230,11 @@
     </dependency>
     <dependency>
       <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-server-config</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
       <artifactId>apacheds-xdbm-partition</artifactId>
       <scope>provided</scope>
     </dependency>

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/KerberosServerPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/KerberosServerPage.java?rev=1446115&r1=1446114&r2=1446115&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/KerberosServerPage.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/KerberosServerPage.java
Thu Feb 14 11:02:07 2013
@@ -20,6 +20,7 @@
 package org.apache.directory.studio.apacheds.configuration.v2.editor;
 
 
+import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.directory.api.ldap.model.exception.LdapInvalidDnException;
@@ -29,6 +30,13 @@ import org.apache.directory.server.confi
 import org.apache.directory.server.config.beans.InterceptorBean;
 import org.apache.directory.server.config.beans.KdcServerBean;
 import org.apache.directory.server.config.beans.TransportBean;
+import org.apache.directory.shared.kerberos.codec.types.EncryptionType;
+import org.apache.directory.studio.common.ui.CommonUIUtils;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTableViewer;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.viewers.LabelProvider;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.ModifyEvent;
 import org.eclipse.swt.events.ModifyListener;
@@ -39,6 +47,7 @@ import org.eclipse.swt.layout.GridLayout
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Table;
 import org.eclipse.swt.widgets.Text;
 import org.eclipse.ui.forms.widgets.FormToolkit;
 import org.eclipse.ui.forms.widgets.Section;
@@ -59,6 +68,16 @@ public class KerberosServerPage extends 
     /** The Page Title */
     private static final String TITLE = Messages.getString( "KerberosServerPage.KerberosServer"
); //$NON-NLS-1$
 
+    /** The encryption types supported by ApacheDS */
+    private static final EncryptionType[] SUPPORTED_ENCRYPTION_TYPES = new EncryptionType[]
+        {
+            EncryptionType.DES_CBC_MD5,
+            EncryptionType.DES3_CBC_SHA1_KD,
+            EncryptionType.AES128_CTS_HMAC_SHA1_96,
+            EncryptionType.AES256_CTS_HMAC_SHA1_96,
+            EncryptionType.RC4_HMAC
+    };
+
     // UI Controls
     private Button enableKerberosCheckbox;
     private Text kerberosPortText;
@@ -66,7 +85,7 @@ public class KerberosServerPage extends 
     private Text changePasswordPortText;
     private Text primaryKdcRealmText;
     private Text kdcSearchBaseDnText;
-    private Text encryptionTypesText;
+    private CheckboxTableViewer encryptionTypesTableViewer;
     private Button verifyBodyChecksumCheckbox;
     private Button allowEmptyAddressesCheckbox;
     private Button allowForwardableAddressesCheckbox;
@@ -134,12 +153,42 @@ public class KerberosServerPage extends 
             }
         }
     };
-    private ModifyListener encryptionTypesTextListener = new ModifyListener()
+    private ICheckStateListener encryptionTypesTableViewerListener = new ICheckStateListener()
     {
-        public void modifyText( ModifyEvent e )
+        public void checkStateChanged( CheckStateChangedEvent event )
         {
+            // Checking if the last encryption type is being unchecked
+            if ( ( getKdcServerBean().getKrbEncryptionTypes().size() == 1 ) && (
event.getChecked() == false ) )
+            {
+                // Displaying an error to the user
+                CommonUIUtils.openErrorDialog( Messages.getString( "KerberosServerPage.AtLeastOneEncryptionTypeMustBeSelected"
) ); //$NON-NLS-1$
+
+                // Reverting the current checked state
+                encryptionTypesTableViewer.setChecked( event.getElement(), !event.getChecked()
);
+
+                // Exiting
+                return;
+            }
+
+            // Setting the editor as dirty
+            setEditorDirty();
+
+            // Clearing previous encryption types
             getKdcServerBean().getKrbEncryptionTypes().clear();
-            getKdcServerBean().addKrbEncryptionTypes( encryptionTypesText.getText() );
+
+            // Getting all selected encryption types
+            Object[] selectedEncryptionTypeObjects = encryptionTypesTableViewer.getCheckedElements();
+
+            // Adding each encryption type
+            for ( Object encryptionTypeObject : selectedEncryptionTypeObjects )
+            {
+                if ( encryptionTypeObject instanceof EncryptionType )
+                {
+                    EncryptionType encryptionType = ( EncryptionType ) encryptionTypeObject;
+
+                    getKdcServerBean().addKrbEncryptionTypes( encryptionType.getName() );
+                }
+            }
         }
     };
     private SelectionAdapter verifyBodyChecksumCheckboxListener = new SelectionAdapter()
@@ -332,12 +381,30 @@ public class KerberosServerPage extends 
         Label defaultSaslSearchBaseDnLabel = createDefaultValueLabel( toolkit, composite,
"ou=users,dc=example,dc=com" ); //$NON-NLS-1$
         defaultSaslSearchBaseDnLabel.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true,
false, 2, 1 ) );
 
-        // Encryption Types Text
-        toolkit.createLabel( composite, Messages.getString( "KerberosServerPage.EncryptionTypes"
) ); //$NON-NLS-1$
-        encryptionTypesText = toolkit.createText( composite, "" ); //$NON-NLS-1$
-        setGridDataWithDefaultWidth( encryptionTypesText, new GridData( SWT.FILL, SWT.NONE,
true, false ) );
-        Label defaultEncryptionTypesLabel = createDefaultValueLabel( toolkit, composite,
"[des-cbc-md5]" ); //$NON-NLS-1$
-        defaultEncryptionTypesLabel.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true,
false, 2, 1 ) );
+        // Encryption Types Table Viewer
+        Label encryptionTypesLabel = toolkit.createLabel( composite,
+            Messages.getString( "KerberosServerPage.EncryptionTypes" ) ); //$NON-NLS-1$
+        encryptionTypesLabel.setLayoutData( new GridData( SWT.BEGINNING, SWT.TOP, false,
false ) );
+        encryptionTypesTableViewer = new CheckboxTableViewer( new Table( composite, SWT.BORDER
| SWT.CHECK ) );
+        encryptionTypesTableViewer.setContentProvider( new ArrayContentProvider() );
+        encryptionTypesTableViewer.setLabelProvider( new LabelProvider()
+        {
+            public String getText( Object element )
+            {
+                if ( element instanceof EncryptionType )
+                {
+                    EncryptionType encryptionType = ( EncryptionType ) element;
+
+                    return encryptionType.getName().toUpperCase();
+                }
+
+                return super.getText( element );
+            }
+        } );
+        encryptionTypesTableViewer.setInput( SUPPORTED_ENCRYPTION_TYPES );
+        GridData encryptionTypesTableViewerGridData = new GridData( SWT.FILL, SWT.NONE, true,
false );
+        encryptionTypesTableViewerGridData.heightHint = 60;
+        encryptionTypesTableViewer.getControl().setLayoutData( encryptionTypesTableViewerGridData
);
     }
 
 
@@ -410,7 +477,6 @@ public class KerberosServerPage extends 
         toolkit.createLabel( composite, Messages.getString( "KerberosServerPage.AllowableClockSkew"
) ); //$NON-NLS-1$
         allowableClockSkewText = createIntegerText( toolkit, composite );
         setGridDataWithDefaultWidth( allowableClockSkewText, new GridData( SWT.FILL, SWT.NONE,
true, false ) );
-
     }
 
 
@@ -436,7 +502,20 @@ public class KerberosServerPage extends 
         // Kerberos Settings
         setText( primaryKdcRealmText, kdcServerBean.getKrbPrimaryRealm() );
         setText( kdcSearchBaseDnText, kdcServerBean.getSearchBaseDn().toString() );
-        setText( encryptionTypesText, kdcServerBean.getKrbEncryptionTypes().toString() );
+
+        // Encryption Types
+        List<String> encryptionTypesNames = kdcServerBean.getKrbEncryptionTypes();
+        List<EncryptionType> encryptionTypes = new ArrayList<EncryptionType>();
+        for ( String encryptionTypesName : encryptionTypesNames )
+        {
+            EncryptionType encryptionType = EncryptionType.getByName( encryptionTypesName
);
+
+            if ( !EncryptionType.UNKNOWN.equals( encryptionType ) )
+            {
+                encryptionTypes.add( encryptionType );
+            }
+        }
+        encryptionTypesTableViewer.setCheckedElements( encryptionTypes.toArray() );
 
         // Ticket Settings
         setSelection( verifyBodyChecksumCheckbox, kdcServerBean.isKrbBodyChecksumVerified()
);
@@ -482,9 +561,8 @@ public class KerberosServerPage extends 
         addDirtyListener( kdcSearchBaseDnText );
         addModifyListener( kdcSearchBaseDnText, kdcSearchBaseDnTextListener );
 
-        // Encryption Types Text
-        addDirtyListener( encryptionTypesText );
-        addModifyListener( encryptionTypesText, encryptionTypesTextListener );
+        // Encryption Types Table Viewer
+        encryptionTypesTableViewer.addCheckStateListener( encryptionTypesTableViewerListener
);
 
         // Verify Body Checksum Checkbox
         addDirtyListener( verifyBodyChecksumCheckbox );
@@ -554,9 +632,8 @@ public class KerberosServerPage extends 
         removeDirtyListener( kdcSearchBaseDnText );
         removeModifyListener( kdcSearchBaseDnText, kdcSearchBaseDnTextListener );
 
-        // Encryption Types Text
-        removeDirtyListener( encryptionTypesText );
-        removeModifyListener( encryptionTypesText, encryptionTypesTextListener );
+        // Encryption Types Table Viewer
+        encryptionTypesTableViewer.removeCheckStateListener( encryptionTypesTableViewerListener
);
 
         // Verify Body Checksum Checkbox
         removeDirtyListener( verifyBodyChecksumCheckbox );

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/messages.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/messages.properties?rev=1446115&r1=1446114&r2=1446115&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/messages.properties
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/messages.properties
Thu Feb 14 11:02:07 2013
@@ -26,6 +26,7 @@ KerberosServerPage.AllowEmptyAddresses=A
 KerberosServerPage.AllowForwadableAddresses=Allow Forwardable Addresses
 KerberosServerPage.AllowPostdatedTickets=Allow Postdated Tickets
 KerberosServerPage.AllowRenewableTickets=Allow Renewable Tickets
+KerberosServerPage.AtLeastOneEncryptionTypeMustBeSelected=At least one encryption type must
be selected.
 KerberosServerPage.EnableKerberosChangePassword=Enable Kerberos Change Password Server
 KerberosServerPage.EnableKerberosServer=Enable Kerberos Server
 KerberosServerPage.EncryptionTypes=Encryption Types:

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/messages_de.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/messages_de.properties?rev=1446115&r1=1446114&r2=1446115&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/messages_de.properties
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/messages_de.properties
Thu Feb 14 11:02:07 2013
@@ -26,6 +26,7 @@ KerberosServerPage.AllowEmptyAddresses=L
 KerberosServerPage.AllowForwadableAddresses=Weiterreichbare Adressen erlauben
 KerberosServerPage.AllowPostdatedTickets=Nachdatierte Tickets erlauben
 KerberosServerPage.AllowRenewableTickets=Erneuerbare Tickets erlauben
+KerberosServerPage.AtLeastOneEncryptionTypeMustBeSelected=TODO:At least one encryption type
must be selected.
 KerberosServerPage.EnableKerberosChangePassword=Kerberos Change Password Server aktivieren
 KerberosServerPage.EnableKerberosServer=Kerberos Server aktivieren
 KerberosServerPage.EncryptionTypes=Verschl\u00FCsselungsverfahren:

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/messages_fr.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/messages_fr.properties?rev=1446115&r1=1446114&r2=1446115&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/messages_fr.properties
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/messages_fr.properties
Thu Feb 14 11:02:07 2013
@@ -26,6 +26,7 @@ KerberosServerPage.AllowEmptyAddresses=A
 KerberosServerPage.AllowForwadableAddresses=Autoriser le renvoi d'adresses
 KerberosServerPage.AllowPostdatedTickets=Autoriser les tickets post-datés
 KerberosServerPage.AllowRenewableTickets=Autoriser les tickets renouvelables
+KerberosServerPage.AtLeastOneEncryptionTypeMustBeSelected=Au moins un type d'encryption doit
être sélectionné.
 KerberosServerPage.EnableKerberosChangePassword=Activer le serveur Kerberos Change Password
 KerberosServerPage.EnableKerberosServer=Activer le serveur Kerberos
 KerberosServerPage.EncryptionTypes=Types d'encryption:

Modified: directory/studio/trunk/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/pom.xml?rev=1446115&r1=1446114&r2=1446115&view=diff
==============================================================================
--- directory/studio/trunk/pom.xml (original)
+++ directory/studio/trunk/pom.xml Thu Feb 14 11:02:07 2013
@@ -1768,6 +1768,12 @@
 
       <dependency>
         <groupId>org.apache.directory.server</groupId>
+        <artifactId>apacheds-kerberos-codec</artifactId>
+        <version>${org.apache.directory.server.version}</version>
+      </dependency>
+
+      <dependency>
+        <groupId>org.apache.directory.server</groupId>
         <artifactId>apacheds-ldif-partition</artifactId>
         <version>${org.apache.directory.server.version}</version>
       </dependency>

Modified: directory/studio/trunk/repository/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/repository/pom.xml?rev=1446115&r1=1446114&r2=1446115&view=diff
==============================================================================
--- directory/studio/trunk/repository/pom.xml (original)
+++ directory/studio/trunk/repository/pom.xml Thu Feb 14 11:02:07 2013
@@ -65,10 +65,6 @@
                 <!-- Apache Directory LDAP API dependencies -->
                 <artifactItem>
                   <groupId>org.apache.directory.api</groupId>
-                  <artifactId>api-ldap-client-api</artifactId>
-                </artifactItem>
-                <artifactItem>
-                  <groupId>org.apache.directory.api</groupId>
                   <artifactId>api-asn1-api</artifactId>
                 </artifactItem>
                 <artifactItem>
@@ -85,6 +81,10 @@
                 </artifactItem>
                 <artifactItem>
                   <groupId>org.apache.directory.api</groupId>
+                  <artifactId>api-ldap-client-api</artifactId>
+                </artifactItem>
+                <artifactItem>
+                  <groupId>org.apache.directory.api</groupId>
                   <artifactId>api-ldap-codec-core</artifactId>
                 </artifactItem>
                 <artifactItem>
@@ -109,11 +109,11 @@
                 </artifactItem>
                 <artifactItem>
                   <groupId>org.apache.directory.api</groupId>
-                  <artifactId>api-ldap-schema-data</artifactId>
+                  <artifactId>api-ldap-schema-converter</artifactId>
                 </artifactItem>
                 <artifactItem>
                   <groupId>org.apache.directory.api</groupId>
-                  <artifactId>api-ldap-schema-converter</artifactId>
+                  <artifactId>api-ldap-schema-data</artifactId>
                 </artifactItem>
                 <artifactItem>
                   <groupId>org.apache.directory.api</groupId>
@@ -123,10 +123,6 @@
                 <!-- ApacheDS dependencies -->
                 <artifactItem>
                   <groupId>org.apache.directory.server</groupId>
-                  <artifactId>apacheds-server-config</artifactId>
-                </artifactItem>
-                <artifactItem>
-                  <groupId>org.apache.directory.server</groupId>
                   <artifactId>apacheds-core</artifactId>
                 </artifactItem>
                 <artifactItem>
@@ -143,6 +139,10 @@
                 </artifactItem>
                 <artifactItem>
                   <groupId>org.apache.directory.server</groupId>
+                  <artifactId>apacheds-kerberos-codec</artifactId>
+                </artifactItem>
+                <artifactItem>
+                  <groupId>org.apache.directory.server</groupId>
                   <artifactId>apacheds-i18n</artifactId>
                 </artifactItem>
                 <artifactItem>
@@ -151,6 +151,10 @@
                 </artifactItem>
                 <artifactItem>
                   <groupId>org.apache.directory.server</groupId>
+                  <artifactId>apacheds-server-config</artifactId>
+                </artifactItem>
+                <artifactItem>
+                  <groupId>org.apache.directory.server</groupId>
                   <artifactId>apacheds-xdbm-partition</artifactId>
                 </artifactItem>
                 <artifactItem>



Mime
View raw message