001: /******************************************************************************
002: * $Source: /cvsroot/sshwebproxy/src/java/com/ericdaugherty/sshwebproxy/SshConstants.java,v $
003: * $Revision: 1.2 $
004: * $Author: edaugherty $
005: * $Date: 2003/11/23 00:18:10 $
006: ******************************************************************************
007: * Copyright (c) 2003, Eric Daugherty (http://www.ericdaugherty.com)
008: * All rights reserved.
009: *
010: * Redistribution and use in source and binary forms, with or without
011: * modification, are permitted provided that the following conditions are met:
012: *
013: * * Redistributions of source code must retain the above copyright notice,
014: * this list of conditions and the following disclaimer.
015: * * Redistributions in binary form must reproduce the above copyright
016: * notice, this list of conditions and the following disclaimer in the
017: * documentation and/or other materials provided with the distribution.
018: * * Neither the name of the Eric Daugherty nor the names of its
019: * contributors may be used to endorse or promote products derived
020: * from this software without specific prior written permission.
021: *
022: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
023: * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
024: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
025: * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
026: * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
027: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
028: * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
029: * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
030: * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
031: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
032: * THE POSSIBILITY OF SUCH DAMAGE.
033: * *****************************************************************************
034: * For current versions and more information, please visit:
035: * http://www.ericdaugherty.com/dev/sshwebproxy
036: *
037: * or contact the author at:
038: * web@ericdaugherty.com
039: *****************************************************************************/package com.ericdaugherty.sshwebproxy;
040:
041: /**
042: * Defines a set of constants that are used
043: * throughout this application.
044: *
045: * @author Eric Daugherty
046: */
047: public interface SshConstants {
048:
049: //***************************************************************
050: // Properties
051: //***************************************************************
052:
053: /** Filename of the properties file used to store user information */
054: static final String PROPERTIES_FILENAME = "sshwebproxy.properties";
055:
056: /** The header to add to the properties file when saving. */
057: static final String PROPERTIES_HEADER = "# Defines users and passwords for the SSHWebProxy system.\r\n"
058: + "# To add a user, add an entry username=password.\r\n"
059: + "# The password will be encrypted the first time the user\r\n"
060: + "# logs in.\r\n"
061: + "#\r\n"
062: + "# This file will be reloaded automaticlly after changes, so a\r\n"
063: + "# user can be edited or added without restaring or redeploying.";
064:
065: /** Indicates restricted mode host to connect to. */
066: static final String PROPERTIES_RESTRICTED = "sshwebproxy.restricted";
067:
068: //***************************************************************
069: // Page URLs.
070: //***************************************************************
071:
072: /** Home page for the application */
073: static final String PAGE_HOME = "index.jsp";
074:
075: /** Login page for the application */
076: static final String PAGE_LOGIN = "login.jsp";
077:
078: /** Shell Channel page */
079: static final String PAGE_SHELL_HOME = "shell.jsp";
080:
081: /** File Channel page */
082: static final String PAGE_FILE_HOME = "file.jsp";
083:
084: //***************************************************************
085: // Servlet URLs.
086: //***************************************************************
087:
088: /** The Admin Servlet, used to handle User and Config setup */
089: static final String SERVLET_ADMIN = "admin";
090:
091: /** The SshConnectionServlet */
092: static final String SERVLET_CONNECTION = "connection";
093:
094: /** The SshShellServlet */
095: static final String SERVLET_SHELL = "shell";
096:
097: /** The SshFileServlet */
098: static final String SERVLET_FILE = "file";
099:
100: //***************************************************************
101: // Parameter Name Constants
102: //***************************************************************
103:
104: /** The action to perform */
105: static final String PARAMETER_ACTION = "action";
106:
107: /** The unique connection info */
108: static final String PARAMETER_CONNECTION = "connection";
109:
110: /** The Channel to open after connection is established. */
111: static final String PARAMETER_CHANNEL_TYPE = "channelType";
112:
113: /** The unique channel id for a given connection */
114: static final String PARAMETER_CHANNEL = "channel";
115:
116: /** The host to connect to */
117: static final String PARAMETER_HOST = "host";
118:
119: /** The port to connect to */
120: static final String PARAMETER_PORT = "port";
121:
122: /** The username to use to connect */
123: static final String PARAMETER_USERNAME = "username";
124:
125: /** The Type of authentication to use (radio button) */
126: static final String PARAMETER_AUTHENTICATION_TYPE = "authenticationType";
127:
128: /** The password to use to connect */
129: static final String PARAMETER_PASSWORD = "password";
130:
131: /** The SSH Key to use to authenticate. */
132: static final String PARAMETER_KEY_FILE = "keyfile";
133:
134: /** The passphrase for the key */
135: static final String PARAMETER_KEY_PASSWORD = "keypassword";
136:
137: /** The data to write to the channel */
138: static final String PARAMETER_DATA = "data";
139:
140: /** The name of the file to work with. */
141: static final String PARAMETER_FILENAME = "filename";
142:
143: /** The uploaded file. */
144: static final String PARAMETER_FILE = "file";
145:
146: /** The name of the file to work with. */
147: static final String PARAMETER_DIRECTORY = "directory";
148:
149: //***************************************************************
150: // Action Constants
151: //***************************************************************
152:
153: // Admin Servlet Actions
154:
155: /** A user request to login */
156: static final String ACTION_LOGIN = "login";
157:
158: // SshConnectionServlet and common Actions
159:
160: /** Open a new SSH Connection */
161: static final String ACTION_OPEN_CONNECTION = "openConnection";
162:
163: /** Close an existing SSH Connection */
164: static final String ACTION_CLOSE_CONNECTION = "closeConnection";
165:
166: /** Open a new Shell Channel on an existing Connection */
167: static final String ACTION_OPEN_SHELL_CHANNEL = "openShell";
168:
169: /** Open a new File Channel on an existing Connection */
170: static final String ACTION_OPEN_FILE_CHANNEL = "openFile";
171:
172: /** Close an SshChannel */
173: static final String ACTION_CLOSE_CHANNEL = "closeChannel";
174:
175: // SshShellServlet Actions
176:
177: /** Write to the Channel */
178: static final String ACTION_WRITE = "write";
179:
180: // SshFileServlet Actions
181:
182: /** Download a file */
183: static final String ACTION_DOWNLOAD = "download";
184:
185: /** Upload a file */
186: static final String ACTION_UPLOAD = "upload";
187:
188: /** Change to a different directory */
189: static final String ACTION_CHANGE_DIRECTORY = "changeDirectory";
190:
191: //***************************************************************
192: // Channel Types
193: //***************************************************************
194:
195: /** Do not open any channel after connection */
196: static final String CHANNEL_TYPE_NONE = "None";
197:
198: /** ShellChannel */
199: static final String CHANNEL_TYPE_SHELL = "Shell";
200:
201: /** FileChannel */
202: static final String CHANNEL_TYPE_FILE = "File";
203:
204: //***************************************************************
205: // Authentication Types
206: //***************************************************************
207:
208: static final String AUTHENTICATION_TYPE_PASSWORD = "passwordauthentication";
209:
210: static final String AUTHENTICATION_TYPE_KEY = "keyauthentication";
211:
212: }
|