Permalink
Browse files

Fixing 'annonymous' typo to 'anonymous', in code and comments

  • Loading branch information...
1 parent fecb231 commit e7580aa15b7a6c591b7baae319ccee5b9db3ed42 @tucu00 tucu00 committed Jan 24, 2011
View
4 CHANGES.txt
@@ -1,3 +1,7 @@
+-- Alfredo 0.1.2 release
+
+- Fixing 'annonymous' typo to 'anonymous', in code and comments
+
-- Alfredo 0.1.1 release
- Fixing/Updating javadocs
View
6 alfredo/src/main/java/com/cloudera/alfredo/server/AuthenticationFilter.java
@@ -300,7 +300,7 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha
if (token == null) {
LOG.debug("Request [{}] triggering authentication", getRequestURL(httpRequest));
token = authHandler.authenticate(httpRequest, httpResponse);
- if (token != null && token != AuthenticationToken.ANNONYMOUS) {
+ if (token != null && token != AuthenticationToken.ANONYMOUS) {
token.setExpires(System.currentTimeMillis() + validity);
}
newToken = true;
@@ -322,10 +322,10 @@ public String getRemoteUser() {
@Override
public Principal getUserPrincipal() {
- return (authToken != AuthenticationToken.ANNONYMOUS) ? authToken : null;
+ return (authToken != AuthenticationToken.ANONYMOUS) ? authToken : null;
}
};
- if (newToken && token != AuthenticationToken.ANNONYMOUS) {
+ if (newToken && token != AuthenticationToken.ANONYMOUS) {
String signedToken = signer.sign(token.toString());
httpResponse.addCookie(new Cookie(AuthenticatedURL.AUTH_COOKIE, signedToken));
}
View
8 alfredo/src/main/java/com/cloudera/alfredo/server/AuthenticationToken.java
@@ -37,9 +37,9 @@
public class AuthenticationToken implements Principal {
/**
- * Constant that identifies an annonymous request.
+ * Constant that identifies an anonymous request.
*/
- public static final AuthenticationToken ANNONYMOUS = new AuthenticationToken();
+ public static final AuthenticationToken ANONYMOUS = new AuthenticationToken();
private static final String ATTR_SEPARATOR = ",";
private static final String USER_NAME = "u";
@@ -61,7 +61,7 @@ private AuthenticationToken() {
principal = null;
type = null;
expires = -1;
- token = "ANNONYMOUS";
+ token = "ANONYMOUS";
generateToken();
}
@@ -98,7 +98,7 @@ public AuthenticationToken(String userName, String principal, String type) {
* @param expires expiration time of the token in milliseconds since Epoc.
*/
public void setExpires(long expires) {
- if (this != AuthenticationToken.ANNONYMOUS) {
+ if (this != AuthenticationToken.ANONYMOUS) {
this.expires = expires;
generateToken();
}
View
26 alfredo/src/main/java/com/cloudera/alfredo/server/PseudoAuthenticationHandler.java
@@ -37,7 +37,7 @@
* <p/>
* The supported configuration property is:
* <ul>
- * <li>simple.annonymous.allowed: <code>true|false</code>, default value is <code>false</code></li>
+ * <li>simple.anonymous.allowed: <code>true|false</code>, default value is <code>false</code></li>
* </ul>
*/
public class PseudoAuthenticationHandler implements AuthenticationHandler {
@@ -48,11 +48,11 @@
public static final String TYPE = "simple";
/**
- * Constant for the configuration property that indicates if annonymous users are allowed.
+ * Constant for the configuration property that indicates if anonymous users are allowed.
*/
- public static final String ANNONYMOUS_ALLOWED = TYPE + ".annonymous.allowed";
+ public static final String ANONYMOUS_ALLOWED = TYPE + ".anonymous.allowed";
- private boolean acceptAnnonymous;
+ private boolean acceptAnonymous;
/**
* Initializes the authentication handler instance.
@@ -65,16 +65,16 @@
*/
@Override
public void init(Properties config) throws ServletException {
- acceptAnnonymous = Boolean.parseBoolean(config.getProperty(ANNONYMOUS_ALLOWED, "false"));
+ acceptAnonymous = Boolean.parseBoolean(config.getProperty(ANONYMOUS_ALLOWED, "false"));
}
/**
- * Returns if the handler is configured to support annonymous users.
+ * Returns if the handler is configured to support anonymous users.
*
- * @return if the handler is configured to support annonymous users.
+ * @return if the handler is configured to support anonymous users.
*/
- protected boolean getAcceptAnnonymous() {
- return acceptAnnonymous;
+ protected boolean getAcceptAnonymous() {
+ return acceptAnonymous;
}
/**
@@ -93,7 +93,7 @@ public void destroy() {
* and {@link AuthenticationToken} with it.
* <p/>
* If the HTTP client request does not contain the {@link PseudoAuthenticator#USER_NAME} parameter and
- * the handler is configured to allow anonymous users it returns the {@link AuthenticationToken#ANNONYMOUS}
+ * the handler is configured to allow anonymous users it returns the {@link AuthenticationToken#ANONYMOUS}
* token.
* <p/>
* If the HTTP client request does not contain the {@link PseudoAuthenticator#USER_NAME} parameter and
@@ -111,11 +111,11 @@ public AuthenticationToken authenticate(HttpServletRequest request, HttpServletR
AuthenticationToken token;
String userName = request.getParameter(PseudoAuthenticator.USER_NAME);
if (userName == null) {
- if (getAcceptAnnonymous()) {
- token = AuthenticationToken.ANNONYMOUS;
+ if (getAcceptAnonymous()) {
+ token = AuthenticationToken.ANONYMOUS;
}
else {
- throw new AuthenticationException("Annonymous requests are disallowed");
+ throw new AuthenticationException("Anonymous requests are disallowed");
}
}
else {
View
4 alfredo/src/site/apt/Configuration.apt.vm
@@ -114,7 +114,7 @@ Alfredo, Java HTTP SPNEGO ${project.version} - Server Side Configuration
* <<<[PREFIX.]type>>>: the keyword <<<simple>>>.
- * <<<[PREFIX.]simple.annonymous.allowed>>>: is a boolean parameter that indicates if annonymous requests are allowed
+ * <<<[PREFIX.]simple.anonymous.allowed>>>: is a boolean parameter that indicates if anonymous requests are allowed
or not. The default value is <<<false>>>.
*<<Example>>:
@@ -131,7 +131,7 @@ Alfredo, Java HTTP SPNEGO ${project.version} - Server Side Configuration
<param-value>simple</param-value>
</init-param>
<init-param>
- <param-name>simple.annonymous.allowed</param-name>
+ <param-name>simple.anonymous.allowed</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
View
2 alfredo/src/site/apt/Examples.apt.vm
@@ -101,7 +101,7 @@ conn = new AuthenticatedURL(url, token).openConnection();
$ kinit
Please enter the password for tucu@LOCALHOST:
-$ curl http://localhost:8080/alfredo-examples/annonymous/who
+$ curl http://localhost:8080/alfredo-examples/anonymous/who
$ curl http://localhost:8080/alfredo-examples/simple/who?user.name=foo
View
2 alfredo/src/test/java/com/cloudera/alfredo/client/TestKerberosAuthenticator.java
@@ -43,7 +43,7 @@ private Properties getAuthenticationHandlerConfiguration() {
public void testFallbacktoPseudoAuthenticator() throws Exception {
Properties props = new Properties();
props.setProperty(AuthenticationFilter.AUTH_TYPE, "simple");
- props.setProperty(PseudoAuthenticationHandler.ANNONYMOUS_ALLOWED, "false");
+ props.setProperty(PseudoAuthenticationHandler.ANONYMOUS_ALLOWED, "false");
setAuthenticationHandlerConfig(props);
_testAuthentication(new KerberosAuthenticator(), false);
}
View
16 alfredo/src/test/java/com/cloudera/alfredo/client/TestPseudoAuthenticator.java
@@ -29,10 +29,10 @@
*/
public class TestPseudoAuthenticator extends AuthenticatorTestCase {
- private Properties getAuthenticationHandlerConfiguration(boolean annonymousAllowed) {
+ private Properties getAuthenticationHandlerConfiguration(boolean anonymousAllowed) {
Properties props = new Properties();
props.setProperty(AuthenticationFilter.AUTH_TYPE, "simple");
- props.setProperty(PseudoAuthenticationHandler.ANNONYMOUS_ALLOWED, Boolean.toString(annonymousAllowed));
+ props.setProperty(PseudoAuthenticationHandler.ANONYMOUS_ALLOWED, Boolean.toString(anonymousAllowed));
return props;
}
@@ -41,7 +41,7 @@ public void testGetUserName() throws Exception {
assertEquals(System.getProperty("user.name"), authenticator.getUserName());
}
- public void testAnnonymousAllowed() throws Exception {
+ public void testAnonymousAllowed() throws Exception {
setAuthenticationHandlerConfig(getAuthenticationHandlerConfiguration(true));
start();
try {
@@ -55,7 +55,7 @@ public void testAnnonymousAllowed() throws Exception {
}
}
- public void testAnnonymousDisallowed() throws Exception {
+ public void testAnonymousDisallowed() throws Exception {
setAuthenticationHandlerConfig(getAuthenticationHandlerConfiguration(false));
start();
try {
@@ -69,22 +69,22 @@ public void testAnnonymousDisallowed() throws Exception {
}
}
- public void testAuthenticationAnnonymousAllowed() throws Exception {
+ public void testAuthenticationAnonymousAllowed() throws Exception {
setAuthenticationHandlerConfig(getAuthenticationHandlerConfiguration(true));
_testAuthentication(new PseudoAuthenticator(), false);
}
- public void testAuthenticationAnnonymousDisallowed() throws Exception {
+ public void testAuthenticationAnonymousDisallowed() throws Exception {
setAuthenticationHandlerConfig(getAuthenticationHandlerConfiguration(false));
_testAuthentication(new PseudoAuthenticator(), false);
}
- public void testAuthenticationAnnonymousAllowedWithPost() throws Exception {
+ public void testAuthenticationAnonymousAllowedWithPost() throws Exception {
setAuthenticationHandlerConfig(getAuthenticationHandlerConfiguration(true));
_testAuthentication(new PseudoAuthenticator(), true);
}
- public void testAuthenticationAnnonymousDisallowedWithPost() throws Exception {
+ public void testAuthenticationAnonymousDisallowedWithPost() throws Exception {
setAuthenticationHandlerConfig(getAuthenticationHandlerConfiguration(false));
_testAuthentication(new PseudoAuthenticator(), true);
}
View
14 alfredo/src/test/java/com/cloudera/alfredo/server/TestAuthenticationToken.java
@@ -25,13 +25,13 @@
*/
public class TestAuthenticationToken extends TestCase {
- public void testAnnonymous() {
- assertNotNull(AuthenticationToken.ANNONYMOUS);
- assertEquals(null, AuthenticationToken.ANNONYMOUS.getUserName());
- assertEquals(null, AuthenticationToken.ANNONYMOUS.getName());
- assertEquals(null, AuthenticationToken.ANNONYMOUS.getType());
- assertEquals(-1, AuthenticationToken.ANNONYMOUS.getExpires());
- assertFalse(AuthenticationToken.ANNONYMOUS.isExpired());
+ public void testAnonymous() {
+ assertNotNull(AuthenticationToken.ANONYMOUS);
+ assertEquals(null, AuthenticationToken.ANONYMOUS.getUserName());
+ assertEquals(null, AuthenticationToken.ANONYMOUS.getName());
+ assertEquals(null, AuthenticationToken.ANONYMOUS.getType());
+ assertEquals(-1, AuthenticationToken.ANONYMOUS.getExpires());
+ assertFalse(AuthenticationToken.ANONYMOUS.isExpired());
}
public void testConstructor() throws Exception {
View
22 alfredo/src/test/java/com/cloudera/alfredo/server/TestPseudoAuthenticationHandler.java
@@ -35,39 +35,39 @@ public void testInit() throws Exception {
PseudoAuthenticationHandler handler = new PseudoAuthenticationHandler();
try {
Properties props = new Properties();
- props.setProperty(PseudoAuthenticationHandler.ANNONYMOUS_ALLOWED, "false");
+ props.setProperty(PseudoAuthenticationHandler.ANONYMOUS_ALLOWED, "false");
handler.init(props);
- assertEquals(false, handler.getAcceptAnnonymous());
+ assertEquals(false, handler.getAcceptAnonymous());
}
finally {
handler.destroy();
}
}
- public void testAnnonymousOn() throws Exception {
+ public void testAnonymousOn() throws Exception {
PseudoAuthenticationHandler handler = new PseudoAuthenticationHandler();
try {
Properties props = new Properties();
- props.setProperty(PseudoAuthenticationHandler.ANNONYMOUS_ALLOWED, "true");
+ props.setProperty(PseudoAuthenticationHandler.ANONYMOUS_ALLOWED, "true");
handler.init(props);
HttpServletRequest request = Mockito.mock(HttpServletRequest.class);
HttpServletResponse response = Mockito.mock(HttpServletResponse.class);
AuthenticationToken token = handler.authenticate(request, response);
- assertEquals(AuthenticationToken.ANNONYMOUS, token);
+ assertEquals(AuthenticationToken.ANONYMOUS, token);
}
finally {
handler.destroy();
}
}
- public void testAnnonymousOff() throws Exception {
+ public void testAnonymousOff() throws Exception {
PseudoAuthenticationHandler handler = new PseudoAuthenticationHandler();
try {
Properties props = new Properties();
- props.setProperty(PseudoAuthenticationHandler.ANNONYMOUS_ALLOWED, "false");
+ props.setProperty(PseudoAuthenticationHandler.ANONYMOUS_ALLOWED, "false");
handler.init(props);
HttpServletRequest request = Mockito.mock(HttpServletRequest.class);
@@ -86,11 +86,11 @@ public void testAnnonymousOff() throws Exception {
}
}
- private void _testUserName(boolean annonymous) throws Exception {
+ private void _testUserName(boolean anonymous) throws Exception {
PseudoAuthenticationHandler handler = new PseudoAuthenticationHandler();
try {
Properties props = new Properties();
- props.setProperty(PseudoAuthenticationHandler.ANNONYMOUS_ALLOWED, Boolean.toString(annonymous));
+ props.setProperty(PseudoAuthenticationHandler.ANONYMOUS_ALLOWED, Boolean.toString(anonymous));
handler.init(props);
HttpServletRequest request = Mockito.mock(HttpServletRequest.class);
@@ -109,11 +109,11 @@ private void _testUserName(boolean annonymous) throws Exception {
}
}
- public void testUserNameAnnonymousOff() throws Exception {
+ public void testUserNameAnonymousOff() throws Exception {
_testUserName(false);
}
- public void testUserNameAnnonymousOn() throws Exception {
+ public void testUserNameAnonymousOn() throws Exception {
_testUserName(true);
}
View
12 examples/src/main/webapp/WEB-INF/web.xml
@@ -25,7 +25,7 @@
<servlet-mapping>
<servlet-name>whoServlet</servlet-name>
- <url-pattern>/annonymous/who</url-pattern>
+ <url-pattern>/anonymous/who</url-pattern>
</servlet-mapping>
<servlet-mapping>
@@ -44,14 +44,14 @@
</filter>
<filter>
- <filter-name>annonymousFilter</filter-name>
+ <filter-name>anonymousFilter</filter-name>
<filter-class>com.cloudera.alfredo.server.AuthenticationFilter</filter-class>
<init-param>
<param-name>type</param-name>
<param-value>simple</param-value>
</init-param>
<init-param>
- <param-name>simple.annonymous.allowed</param-name>
+ <param-name>simple.anonymous.allowed</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
@@ -68,7 +68,7 @@
<param-value>simple</param-value>
</init-param>
<init-param>
- <param-name>simple.annonymous.allowed</param-name>
+ <param-name>simple.anonymous.allowed</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
@@ -104,8 +104,8 @@
</filter-mapping>
<filter-mapping>
- <filter-name>annonymousFilter</filter-name>
- <url-pattern>/annonymous/*</url-pattern>
+ <filter-name>anonymousFilter</filter-name>
+ <url-pattern>/anonymous/*</url-pattern>
</filter-mapping>
<filter-mapping>
View
2 examples/src/main/webapp/annonymous/index.html
@@ -17,6 +17,6 @@
-->
<html>
<body>
- <h1>Hello Alfredo Pseudo/Simple Authentication with annonymous users!</h1>
+ <h1>Hello Alfredo Pseudo/Simple Authentication with anonymous users!</h1>
</body>
</html>

0 comments on commit e7580aa

Please sign in to comment.