From 81ada31a306817f1b83a4a5f97e648d171a2d737 Mon Sep 17 00:00:00 2001
From: Endi Sukma Dewata <edewata@redhat.com>
Date: Thu, 7 Jun 2012 01:14:40 -0500
Subject: [PATCH] Added cert revocation CLI.

The cert revocation CLI provides a tool to revoke and unrevoke
certificates.

Ticket #161
---
 base/common/src/CMakeLists.txt                     |    6 +
 .../src/com/netscape/cms/client/cert/CertCLI.java  |  134 ++++++++++++++++++++
 .../com/netscape/cms/client/cert/CertFindCLI.java  |   61 +++++++++
 .../netscape/cms/client/cert/CertRestClient.java   |   69 ++++++++++
 .../netscape/cms/client/cert/CertRevokeCLI.java    |  127 +++++++++++++++++++
 .../com/netscape/cms/client/cert/CertShowCLI.java  |   92 ++++++++++++++
 .../netscape/cms/client/cert/CertUnrevokeCLI.java  |   60 +++++++++
 .../src/com/netscape/cms/client/cli/MainCLI.java   |    4 +-
 8 files changed, 552 insertions(+), 1 deletions(-)
 create mode 100644 base/common/src/com/netscape/cms/client/cert/CertCLI.java
 create mode 100644 base/common/src/com/netscape/cms/client/cert/CertFindCLI.java
 create mode 100644 base/common/src/com/netscape/cms/client/cert/CertRestClient.java
 create mode 100644 base/common/src/com/netscape/cms/client/cert/CertRevokeCLI.java
 create mode 100644 base/common/src/com/netscape/cms/client/cert/CertShowCLI.java
 create mode 100644 base/common/src/com/netscape/cms/client/cert/CertUnrevokeCLI.java

diff --git a/base/common/src/CMakeLists.txt b/base/common/src/CMakeLists.txt
index 0a6fb8ad3866e2fb3c3e94dc7b14aa63ea819ce9..5699077ac19427dea0bee4df075a298d6b85b7f8 100644
--- a/base/common/src/CMakeLists.txt
+++ b/base/common/src/CMakeLists.txt
@@ -460,6 +460,12 @@ set(pki-certsrv_java_SRCS
 set(pki-cms_java_SRCS
     com/netscape/cms/client/cli/CLI.java
     com/netscape/cms/client/cli/MainCLI.java
+    com/netscape/cms/client/cert/CertCLI.java
+    com/netscape/cms/client/cert/CertFindCLI.java
+    com/netscape/cms/client/cert/CertRestClient.java
+    com/netscape/cms/client/cert/CertRevokeCLI.java
+    com/netscape/cms/client/cert/CertShowCLI.java
+    com/netscape/cms/client/cert/CertUnrevokeCLI.java
     com/netscape/cms/client/group/GroupAddCLI.java
     com/netscape/cms/client/group/GroupAddMemberCLI.java
     com/netscape/cms/client/group/GroupFindMemberCLI.java
diff --git a/base/common/src/com/netscape/cms/client/cert/CertCLI.java b/base/common/src/com/netscape/cms/client/cert/CertCLI.java
new file mode 100644
index 0000000000000000000000000000000000000000..2c9ef9abbce0c35ff32a086202ccebc937535861
--- /dev/null
+++ b/base/common/src/com/netscape/cms/client/cert/CertCLI.java
@@ -0,0 +1,134 @@
+// --- BEGIN COPYRIGHT BLOCK ---
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; version 2 of the License.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+//
+// (C) 2012 Red Hat, Inc.
+// All rights reserved.
+// --- END COPYRIGHT BLOCK ---
+
+package com.netscape.cms.client.cert;
+
+import java.util.Arrays;
+
+import org.apache.commons.lang.StringUtils;
+import org.jboss.resteasy.plugins.providers.atom.Link;
+
+import com.netscape.cms.client.cli.CLI;
+import com.netscape.cms.client.cli.MainCLI;
+import com.netscape.cms.servlet.cert.model.CertDataInfo;
+import com.netscape.cms.servlet.cert.model.CertificateData;
+
+/**
+ * @author Endi S. Dewata
+ */
+public class CertCLI extends CLI {
+
+    public MainCLI parent;
+    public CertRestClient client;
+
+    public CertCLI(MainCLI parent) {
+        super("cert", "Certificate management commands");
+        this.parent = parent;
+
+        addModule(new CertFindCLI(this));
+        addModule(new CertShowCLI(this));
+
+        addModule(new CertRevokeCLI(this));
+        addModule(new CertUnrevokeCLI(this));
+    }
+
+    public void printHelp() {
+
+        System.out.println("Commands:");
+
+        int leftPadding = 1;
+        int rightPadding = 25;
+
+        for (CLI module : modules.values()) {
+            String label = name + "-" + module.getName();
+
+            int padding = rightPadding - leftPadding - label.length();
+            if (padding < 1)
+                padding = 1;
+
+            System.out.print(StringUtils.repeat(" ", leftPadding));
+            System.out.print(label);
+            System.out.print(StringUtils.repeat(" ", padding));
+            System.out.println(module.getDescription());
+        }
+    }
+
+    public void execute(String[] args) throws Exception {
+
+        client = new CertRestClient(parent.url + "/pki", parent.certNickname);
+
+        String command = args[0];
+        String[] commandArgs = Arrays.copyOfRange(args, 1, args.length);
+
+        if (command == null) {
+            printHelp();
+            System.exit(1);
+        }
+
+        CLI module = getModule(command);
+        if (module != null) {
+            module.execute(commandArgs);
+
+        } else {
+            System.err.println("Error: Invalid command \"" + command + "\"");
+            printHelp();
+            System.exit(1);
+        }
+    }
+
+    public static void printCertInfo(CertDataInfo info) {
+        System.out.println("  Serial Number: "+info.getID().toHexString());
+        System.out.println("  Subject DN: "+info.getSubjectDN());
+        System.out.println("  Status: "+info.getStatus());
+
+        Link link = info.getLink();
+        if (verbose && link != null) {
+            System.out.println("  Link: " + link.getHref());
+        }
+    }
+
+    public static void printCertData(
+            CertificateData certData,
+            boolean showPrettyPrint,
+            boolean showEncoded) {
+
+        System.out.println("  Serial Number: " + certData.getSerialNumber().toHexString());
+        System.out.println("  Issuer: " + certData.getIssuerDN());
+        System.out.println("  Subject: " + certData.getSubjectDN());
+        System.out.println("  Status: "+certData.getStatus());
+        System.out.println("  Not Before: "+certData.getNotBefore());
+        System.out.println("  Not After: "+certData.getNotAfter());
+
+        Link link = certData.getLink();
+        if (verbose && link != null) {
+            System.out.println("  Link: " + link.getHref());
+        }
+
+        String prettyPrint = certData.getPrettyPrint();
+        if (showPrettyPrint && prettyPrint != null) {
+            System.out.println();
+            System.out.println(prettyPrint);
+        }
+
+        String encoded = certData.getEncoded();
+        if (showEncoded && encoded != null) {
+            System.out.println();
+            System.out.println(encoded);
+        }
+    }
+}
diff --git a/base/common/src/com/netscape/cms/client/cert/CertFindCLI.java b/base/common/src/com/netscape/cms/client/cert/CertFindCLI.java
new file mode 100644
index 0000000000000000000000000000000000000000..9f56eef951ba318a001253ffab1c249fe2fc18cb
--- /dev/null
+++ b/base/common/src/com/netscape/cms/client/cert/CertFindCLI.java
@@ -0,0 +1,61 @@
+// --- BEGIN COPYRIGHT BLOCK ---
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; version 2 of the License.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+//
+// (C) 2012 Red Hat, Inc.
+// All rights reserved.
+// --- END COPYRIGHT BLOCK ---
+
+package com.netscape.cms.client.cert;
+
+import com.netscape.cms.client.cli.CLI;
+import com.netscape.cms.servlet.cert.model.CertDataInfo;
+import com.netscape.cms.servlet.cert.model.CertDataInfos;
+import com.netscape.cms.servlet.cert.model.CertSearchData;
+
+/**
+ * @author Endi S. Dewata
+ */
+public class CertFindCLI extends CLI {
+
+    public CertCLI parent;
+
+    public CertFindCLI(CertCLI parent) {
+        super("find", "Find certificates");
+        this.parent = parent;
+    }
+
+    public void printHelp() {
+        formatter.printHelp(parent.name + "-" + name + " [OPTIONS...]", options);
+    }
+
+    public void execute(String[] args) throws Exception {
+
+        CertSearchData searchData = new CertSearchData();
+        searchData.setSerialNumberRangeInUse(true);
+
+        CertDataInfos certs = parent.client.findCerts(searchData);
+
+        boolean first = true;
+
+        for (CertDataInfo cert : certs.getCertInfos()) {
+            if (first) {
+                first = false;
+            } else {
+                System.out.println();
+            }
+
+            CertCLI.printCertInfo(cert);
+        }
+    }
+}
diff --git a/base/common/src/com/netscape/cms/client/cert/CertRestClient.java b/base/common/src/com/netscape/cms/client/cert/CertRestClient.java
new file mode 100644
index 0000000000000000000000000000000000000000..cd171b194cd302a929307ba690fcb23d1fbdc474
--- /dev/null
+++ b/base/common/src/com/netscape/cms/client/cert/CertRestClient.java
@@ -0,0 +1,69 @@
+//--- BEGIN COPYRIGHT BLOCK ---
+//This program is free software; you can redistribute it and/or modify
+//it under the terms of the GNU General Public License as published by
+//the Free Software Foundation; version 2 of the License.
+//
+//This program is distributed in the hope that it will be useful,
+//but WITHOUT ANY WARRANTY; without even the implied warranty of
+//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//GNU General Public License for more details.
+//
+//You should have received a copy of the GNU General Public License along
+//with this program; if not, write to the Free Software Foundation, Inc.,
+//51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+//
+//(C) 2012 Red Hat, Inc.
+//All rights reserved.
+//--- END COPYRIGHT BLOCK ---
+package com.netscape.cms.client.cert;
+
+import java.net.URISyntaxException;
+
+import com.netscape.certsrv.dbs.certdb.CertId;
+import com.netscape.cms.servlet.cert.CertResource;
+import com.netscape.cms.servlet.cert.CertsResource;
+import com.netscape.cms.servlet.cert.model.CertDataInfos;
+import com.netscape.cms.servlet.cert.model.CertRevokeRequest;
+import com.netscape.cms.servlet.cert.model.CertSearchData;
+import com.netscape.cms.servlet.cert.model.CertUnrevokeRequest;
+import com.netscape.cms.servlet.cert.model.CertificateData;
+import com.netscape.cms.servlet.csadmin.CMSRestClient;
+
+/**
+ * @author Endi S. Dewata
+ */
+public class CertRestClient extends CMSRestClient {
+
+    public CertResource certClient;
+    public CertsResource certsClient;
+
+    public CertRestClient(String baseUri) throws URISyntaxException {
+        this(baseUri, null);
+    }
+
+    public CertRestClient(String baseUri, String nickname) throws URISyntaxException {
+        super(baseUri);
+
+        certClient = createProxy(CertResource.class);
+        certsClient = createProxy(CertsResource.class);
+    }
+
+    public CertificateData getCert(CertId id) {
+        return certClient.getCert(id);
+    }
+
+    public CertDataInfos findCerts(CertSearchData searchData) {
+        return certsClient.searchCerts(
+                searchData,
+                CertsResource.DEFAULT_MAXRESULTS,
+                CertsResource.DEFAULT_MAXTIME);
+    }
+
+    public CertificateData revokeCert(CertId id, CertRevokeRequest request) {
+        return certClient.revokeCert(id, request);
+    }
+
+    public CertificateData unrevokeCert(CertId id, CertUnrevokeRequest request) {
+        return certClient.unrevokeCert(id, request);
+    }
+}
diff --git a/base/common/src/com/netscape/cms/client/cert/CertRevokeCLI.java b/base/common/src/com/netscape/cms/client/cert/CertRevokeCLI.java
new file mode 100644
index 0000000000000000000000000000000000000000..e97e9502ffbb51077cfa3c26971bb5f82fbc9d2a
--- /dev/null
+++ b/base/common/src/com/netscape/cms/client/cert/CertRevokeCLI.java
@@ -0,0 +1,127 @@
+// --- BEGIN COPYRIGHT BLOCK ---
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; version 2 of the License.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+//
+// (C) 2012 Red Hat, Inc.
+// All rights reserved.
+// --- END COPYRIGHT BLOCK ---
+
+package com.netscape.cms.client.cert;
+
+import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.Option;
+import org.apache.commons.cli.ParseException;
+
+import com.netscape.certsrv.dbs.certdb.CertId;
+import com.netscape.cms.client.cli.CLI;
+import com.netscape.cms.client.cli.MainCLI;
+import com.netscape.cms.servlet.cert.model.CertRevokeRequest;
+import com.netscape.cms.servlet.cert.model.CertificateData;
+
+/**
+ * @author Endi S. Dewata
+ */
+public class CertRevokeCLI extends CLI {
+
+    public static final String[] REASONS = {
+        "UNSPECIFIED", "KEY_COMPROMISE", "CA_COMPROMISE", "AFFILIATION_CHANGED",
+        "SUPERSEDED", "CESSATION_OF_OPERATION", "CERTIFICATE_HOLD", null,
+        "REMOVE_FROM_CRL", "PRIVILEGE_WITHDRAWN", "AA_COMPROMISE"
+    };
+
+    public CertCLI parent;
+
+    public CertRevokeCLI(CertCLI parent) {
+        super("revoke", "Revoke certificate");
+        this.parent = parent;
+    }
+
+    public void printHelp() {
+        formatter.printHelp(parent.name + "-" + name + " <Serial Number> [OPTIONS...]", options);
+    }
+
+    public int parseReason(String string) throws ParseException {
+        string = string.toUpperCase();
+
+        for (int i=0; i<REASONS.length; i++) {
+            String reason = REASONS[i];
+            if (reason == null) continue;
+            if (!reason.equals(string)) continue;
+            return i;
+        }
+
+        throw new ParseException("Invalid revocation reason: "+string);
+    }
+
+    public void execute(String[] args) throws Exception {
+
+        StringBuilder sb = new StringBuilder();
+        sb.append("Revocation reason: UNSPECIFIED (default)");
+
+        for (int i=1; i<REASONS.length; i++) {
+            String reason = REASONS[i];
+            if (reason == null) continue;
+            sb.append(", ");
+            sb.append(reason);
+        }
+
+        Option option = new Option(null, "reason", true, sb.toString());
+        option.setArgName("reason");
+        options.addOption(option);
+
+        option = new Option(null, "comments", true, "Revocation comments");
+        option.setArgName("comments");
+        options.addOption(option);
+
+        CommandLine cmd = null;
+
+        try {
+            cmd = parser.parse(options, args);
+
+        } catch (Exception e) {
+            System.err.println("Error: " + e.getMessage());
+            printHelp();
+            System.exit(1);
+        }
+
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 1) {
+            printHelp();
+            System.exit(1);
+        }
+
+        CertId certID = new CertId(cmdArgs[0]);
+
+        int reason;
+        try {
+            reason = parseReason(cmd.getOptionValue("reason", "UNSPECIFIED"));
+
+        } catch (Exception e) {
+            System.err.println("Error: " + e.getMessage());
+            printHelp();
+            System.exit(1);
+            return;
+        }
+
+        CertRevokeRequest request = new CertRevokeRequest();
+        request.setReason(reason);
+        request.setComments(cmd.getOptionValue("comments"));
+
+        CertificateData certData = parent.client.revokeCert(certID, request);
+
+        MainCLI.printMessage("Revoked certificate \"" + certID.toHexString() + "\"");
+
+        CertCLI.printCertData(certData, false, false);
+    }
+}
diff --git a/base/common/src/com/netscape/cms/client/cert/CertShowCLI.java b/base/common/src/com/netscape/cms/client/cert/CertShowCLI.java
new file mode 100644
index 0000000000000000000000000000000000000000..2815e0254eb93f9cbea64ca3fe113f287a1dd9f4
--- /dev/null
+++ b/base/common/src/com/netscape/cms/client/cert/CertShowCLI.java
@@ -0,0 +1,92 @@
+// --- BEGIN COPYRIGHT BLOCK ---
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; version 2 of the License.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+//
+// (C) 2012 Red Hat, Inc.
+// All rights reserved.
+// --- END COPYRIGHT BLOCK ---
+
+package com.netscape.cms.client.cert;
+
+import java.io.FileWriter;
+import java.io.PrintWriter;
+
+import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.Option;
+
+import com.netscape.certsrv.dbs.certdb.CertId;
+import com.netscape.cms.client.cli.CLI;
+import com.netscape.cms.servlet.cert.model.CertificateData;
+
+/**
+ * @author Endi S. Dewata
+ */
+public class CertShowCLI extends CLI {
+
+    public CertCLI parent;
+
+    public CertShowCLI(CertCLI parent) {
+        super("show", "Show certificate");
+        this.parent = parent;
+    }
+
+    public void printHelp() {
+        formatter.printHelp(parent.name + "-" + name + " <Serial Number> [OPTIONS...]", options);
+    }
+
+    public void execute(String[] args) throws Exception {
+
+        Option option = new Option(null, "output", true, "Output file");
+        option.setArgName("file");
+        options.addOption(option);
+
+        options.addOption(null, "pretty", false, "Pretty print");
+        options.addOption(null, "encoded", false, "Base-64 encoded");
+
+        CommandLine cmd = null;
+
+        try {
+            cmd = parser.parse(options, args);
+
+        } catch (Exception e) {
+            System.err.println("Error: " + e.getMessage());
+            printHelp();
+            System.exit(1);
+        }
+
+        boolean showPrettyPrint = cmd.hasOption("pretty");
+        boolean showEncoded = cmd.hasOption("encoded");
+
+        String[] cmdArgs = cmd.getArgs();
+
+        if (cmdArgs.length != 1) {
+            printHelp();
+            System.exit(1);
+        }
+
+        CertId certID = new CertId(args[0]);
+        String file = cmd.getOptionValue("output");
+
+        CertificateData certData = parent.client.getCert(certID);
+
+        String encoded = certData.getEncoded();
+        if (encoded != null && file != null) {
+            // store cert to file
+            PrintWriter out = new PrintWriter(new FileWriter(file));
+            out.print(encoded);
+            out.close();
+        }
+
+        CertCLI.printCertData(certData, showPrettyPrint, showEncoded);
+    }
+}
diff --git a/base/common/src/com/netscape/cms/client/cert/CertUnrevokeCLI.java b/base/common/src/com/netscape/cms/client/cert/CertUnrevokeCLI.java
new file mode 100644
index 0000000000000000000000000000000000000000..9325565d5ca32f7f6cf88886f71abc1175b12cb1
--- /dev/null
+++ b/base/common/src/com/netscape/cms/client/cert/CertUnrevokeCLI.java
@@ -0,0 +1,60 @@
+// --- BEGIN COPYRIGHT BLOCK ---
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; version 2 of the License.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+//
+// (C) 2012 Red Hat, Inc.
+// All rights reserved.
+// --- END COPYRIGHT BLOCK ---
+
+package com.netscape.cms.client.cert;
+
+import com.netscape.certsrv.dbs.certdb.CertId;
+import com.netscape.cms.client.cli.CLI;
+import com.netscape.cms.client.cli.MainCLI;
+import com.netscape.cms.servlet.cert.model.CertUnrevokeRequest;
+import com.netscape.cms.servlet.cert.model.CertificateData;
+
+/**
+ * @author Endi S. Dewata
+ */
+public class CertUnrevokeCLI extends CLI {
+
+    public CertCLI parent;
+
+    public CertUnrevokeCLI(CertCLI parent) {
+        super("unrevoke", "Unrevoke certificate");
+        this.parent = parent;
+    }
+
+    public void printHelp() {
+        formatter.printHelp(parent.name + "-" + name + " <Serial Number> [OPTIONS...]", options);
+    }
+
+    public void execute(String[] args) throws Exception {
+
+        if (args.length != 1) {
+            printHelp();
+            System.exit(1);
+        }
+
+        CertId certID = new CertId(args[0]);
+
+        CertUnrevokeRequest request = new CertUnrevokeRequest();
+
+        CertificateData certData = parent.client.unrevokeCert(certID, request);
+
+        MainCLI.printMessage("Unrevoked certificate \"" + certID.toHexString() + "\"");
+
+        CertCLI.printCertData(certData, false, false);
+    }
+}
diff --git a/base/common/src/com/netscape/cms/client/cli/MainCLI.java b/base/common/src/com/netscape/cms/client/cli/MainCLI.java
index 4932fb183b3bff34c5a61b40b2e221df06124ae0..55cac0b64b51a5479649de7e1fa1780ad87eb350 100644
--- a/base/common/src/com/netscape/cms/client/cli/MainCLI.java
+++ b/base/common/src/com/netscape/cms/client/cli/MainCLI.java
@@ -26,6 +26,7 @@ import org.mozilla.jss.crypto.AlreadyInitializedException;
 import org.mozilla.jss.crypto.CryptoToken;
 import org.mozilla.jss.util.Password;
 
+import com.netscape.cms.client.cert.CertCLI;
 import com.netscape.cms.client.group.GroupCLI;
 import com.netscape.cms.client.user.UserCLI;
 
@@ -48,8 +49,9 @@ public class MainCLI extends CLI {
     public MainCLI() throws Exception {
         super("pki", "PKI command-line interface");
 
-        addModule(new UserCLI(this));
+        addModule(new CertCLI(this));
         addModule(new GroupCLI(this));
+        addModule(new UserCLI(this));
     }
 
     public String getProtocol() {
-- 
1.7.7.6

