Permalink
Browse files

Addressed copyright issues for Tyrus donation:

added --allow-javascript-in-comments for javadoc to pass.
replaced Base64Utils with java 8 native Base64.
removed  unused "websocket-sample-trading" sample.
fixed copyright headers.

Change-Id: I986c7275a5d8de114a29ad08ef3691c72d6ec117
Signed-off-by: Roman Grigoriadi <roman.grigoriadi@oracle.com>
  • Loading branch information...
bravehorsie committed Nov 8, 2017
1 parent de304e3 commit 2f1a80ed6c429134218db6148c2d0405a8c90713
Showing with 39 additions and 3,731 deletions.
  1. +2 −2 client/src/main/java/org/glassfish/tyrus/client/ClientManager.java
  2. +2 −2 client/src/main/java/org/glassfish/tyrus/client/ClientProperties.java
  3. +3 −3 client/src/main/java/org/glassfish/tyrus/client/auth/BasicAuthenticator.java
  4. +4 −6 client/src/test/java/org/glassfish/tyrus/client/TyrusClientEngineTest.java
  5. +7 −7 ...rizzly-client/src/main/java/org/glassfish/tyrus/container/grizzly/client/GrizzlyClientSocket.java
  6. +6 −6 containers/jdk-client/src/main/java/org/glassfish/tyrus/container/jdk/client/ClientFilter.java
  7. +0 −594 core/src/main/java/org/glassfish/tyrus/core/Base64Utils.java
  8. +5 −6 core/src/main/java/org/glassfish/tyrus/core/SecKey.java
  9. +1 −0 etc/config/copyright-exclude
  10. +2 −1 pom.xml
  11. +1 −2 samples/pom.xml
  12. +0 −79 samples/trading/pom.xml
  13. +0 −2 samples/trading/src/conf/MANIFEST.MF
  14. +0 −120 samples/trading/src/main/java/org/glassfish/tyrus/sample/trading/servlets/LogoutServlet.java
  15. +0 −83 samples/trading/src/main/java/org/glassfish/tyrus/sample/trading/wsbeans/Activity.java
  16. +0 −77 samples/trading/src/main/java/org/glassfish/tyrus/sample/trading/wsbeans/ApplicationPreferences.java
  17. +0 −49 samples/trading/src/main/java/org/glassfish/tyrus/sample/trading/wsbeans/Broadcaster.java
  18. +0 −134 samples/trading/src/main/java/org/glassfish/tyrus/sample/trading/wsbeans/Buddies.java
  19. +0 −62 samples/trading/src/main/java/org/glassfish/tyrus/sample/trading/wsbeans/BuddiesRemote.java
  20. +0 −65 samples/trading/src/main/java/org/glassfish/tyrus/sample/trading/wsbeans/HttpSessionTest.java
  21. +0 −135 samples/trading/src/main/java/org/glassfish/tyrus/sample/trading/wsbeans/Quote.java
  22. +0 −59 samples/trading/src/main/java/org/glassfish/tyrus/sample/trading/wsbeans/QuoteRemote.java
  23. +0 −129 samples/trading/src/main/java/org/glassfish/tyrus/sample/trading/wsbeans/Quotes.java
  24. +0 −73 samples/trading/src/main/java/org/glassfish/tyrus/sample/trading/wsbeans/QuotesEncoder.java
  25. +0 −88 samples/trading/src/main/java/org/glassfish/tyrus/sample/trading/wsbeans/ThreadManager.java
  26. +0 −147 samples/trading/src/main/java/org/glassfish/tyrus/sample/trading/wsbeans/Twitter.java
  27. +0 −58 samples/trading/src/main/java/org/glassfish/tyrus/sample/trading/wsbeans/TwitterRemote.java
  28. +0 −78 samples/trading/src/main/java/org/glassfish/tyrus/sample/trading/wsbeans/TwitterSearchResult.java
  29. +0 −75 .../trading/src/main/java/org/glassfish/tyrus/sample/trading/wsbeans/TwitterSearchResultEncoder.java
  30. +0 −72 samples/trading/src/main/java/org/glassfish/tyrus/sample/trading/wsbeans/UpdateThread.java
  31. +0 −59 samples/trading/src/main/java/org/glassfish/tyrus/sample/trading/wsbeans/UsernamesEncoder.java
  32. +0 −88 samples/trading/src/main/java/org/glassfish/tyrus/sample/trading/wsbeans/Util.java
  33. +0 −60 samples/trading/src/main/webapp/WEB-INF/glassfish-web.xml
  34. +0 −86 samples/trading/src/main/webapp/WEB-INF/web.xml
  35. +0 −11 samples/trading/src/main/webapp/apps.txt
  36. BIN samples/trading/src/main/webapp/artwork.key
  37. BIN samples/trading/src/main/webapp/banner.jpg
  38. +0 −107 samples/trading/src/main/webapp/basictests.jsp
  39. +0 −70 samples/trading/src/main/webapp/byebye.jsp
  40. +0 −68 samples/trading/src/main/webapp/error.jsp
  41. +0 −482 samples/trading/src/main/webapp/home.jsp
  42. +0 −93 samples/trading/src/main/webapp/login.jsp
  43. +0 −95 samples/trading/src/main/webapp/newstock.jsp
  44. +0 −67 samples/trading/src/main/webapp/play.jsp
  45. +0 −52 samples/trading/src/main/webapp/playhtml.html
  46. +0 −82 samples/trading/src/main/webapp/stockquotes.jsp
  47. +0 −17 samples/trading/src/main/webapp/tooltip.css
  48. +0 −74 samples/trading/src/main/webapp/tooltip.js
  49. +3 −3 ...deployable/src/test/java/org/glassfish/tyrus/test/e2e/non_deployable/SameHeadersOnClientTest.java
  50. +3 −3 tests/servlet/debug/src/test/java/org/glassfish/tyrus/tests/servlet/debug/DebugSampleTest.java
@@ -1,7 +1,7 @@
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2011-2016 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011-2017 Oracle and/or its affiliates. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
@@ -134,7 +134,7 @@
* <pre>
* final HashMap&lt;String, String&gt; proxyHeaders = new HashMap&lt;String, String&gt;();
* proxyHeaders.put("Proxy-Authorization", "Basic " +
* Base64Utils.encodeToString("username:password".getBytes(Charset.forName("UTF-8")), false));
* Base64.getEncoder().encodeToString("username:password".getBytes(Charset.forName("UTF-8"))));
*
* client.getProperties().put(GrizzlyClientSocket.PROXY_HEADERS, proxyHeaders);
* client.connectToServer(...);
@@ -1,7 +1,7 @@
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2014-2016 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014-2017 Oracle and/or its affiliates. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
@@ -96,7 +96,7 @@
* <pre>
* final HashMap&lt;String, String&gt; proxyHeaders = new HashMap&lt;String, String&gt;();
* proxyHeaders.put("Proxy-Authorization", "Basic " +
* Base64Utils.encodeToString("username:password".getBytes(Charset.forName("UTF-8")), false));
* Base64.getEncoder().encodeToString("username:password".getBytes(Charset.forName("UTF-8"))));
*
* client.getProperties().put(ClientProperties.PROXY_HEADERS, proxyHeaders);
* client.connectToServer(...);
@@ -1,7 +1,7 @@
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2014-2015 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014-2017 Oracle and/or its affiliates. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
@@ -40,8 +40,8 @@
package org.glassfish.tyrus.client.auth;
import java.net.URI;
import java.util.Base64;
import org.glassfish.tyrus.core.Base64Utils;
import org.glassfish.tyrus.core.l10n.LocalizationMessages;
/**
@@ -70,7 +70,7 @@ private String generateAuthorizationHeader(final Credentials credentials) throws
System.arraycopy(prefix, 0, usernamePassword, 0, prefix.length);
System.arraycopy(password, 0, usernamePassword, prefix.length, password.length);
return "Basic " + Base64Utils.encodeToString(usernamePassword, false);
return "Basic " + Base64.getEncoder().encodeToString(usernamePassword);
}
}
@@ -1,7 +1,7 @@
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2014-2015 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014-2017 Oracle and/or its affiliates. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
@@ -44,6 +44,7 @@
import java.net.URI;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Base64;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
@@ -58,7 +59,6 @@
import javax.websocket.server.HandshakeRequest;
import org.glassfish.tyrus.client.auth.Credentials;
import org.glassfish.tyrus.core.Base64Utils;
import org.glassfish.tyrus.core.DebugContext;
import org.glassfish.tyrus.core.HandshakeException;
import org.glassfish.tyrus.core.TyrusEndpointWrapper;
@@ -541,10 +541,8 @@ private String generateServerKey(String clientKey) throws HandshakeException {
throw new HandshakeException(LocalizationMessages.SEC_KEY_INVALID_LENGTH(digest.length));
}
return Base64Utils.encodeToString(digest, false);
} catch (NoSuchAlgorithmException e) {
throw new HandshakeException(e.getMessage());
} catch (UnsupportedEncodingException e) {
return Base64.getEncoder().encodeToString(digest);
} catch (NoSuchAlgorithmException | UnsupportedEncodingException e) {
throw new HandshakeException(e.getMessage());
}
}
@@ -1,7 +1,7 @@
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2011-2016 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011-2017 Oracle and/or its affiliates. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
@@ -48,6 +48,7 @@
import java.net.URISyntaxException;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Base64;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -69,7 +70,6 @@
import org.glassfish.tyrus.client.ClientManager;
import org.glassfish.tyrus.client.ClientProperties;
import org.glassfish.tyrus.client.SslEngineConfigurator;
import org.glassfish.tyrus.core.Base64Utils;
import org.glassfish.tyrus.core.TyrusFuture;
import org.glassfish.tyrus.core.Utils;
import org.glassfish.tyrus.spi.ClientEngine;
@@ -129,7 +129,7 @@
* <pre>
* final HashMap&lt;String, String&gt; proxyHeaders = new HashMap&lt;String, String&gt;();
* proxyHeaders.put("Proxy-Authorization", "Basic " +
* Base64Utils.encodeToString("username:password".getBytes(Charset.forName("UTF-8")),false));
* Base64.getEncoder().encodeToString("username:password".getBytes(Charset.forName("UTF-8"))));
*
* client.getProperties().put(GrizzlyClientSocket.PROXY_HEADERS, proxyHeaders);
* client.connectToServer(...);
@@ -503,8 +503,8 @@ private static TCPNIOTransport createTransport(ThreadPoolConfig workerThreadPool
if (wlsProxyUsername != null && wlsProxyPassword != null) {
proxyHeaders = new HashMap<String, String>();
proxyHeaders.put("Proxy-Authorization", "Basic "
+ Base64Utils.encodeToString(
(wlsProxyUsername + ":" + wlsProxyPassword).getBytes(Charset.forName("UTF-8")), false));
+ Base64.getEncoder().encodeToString(
(wlsProxyUsername + ":" + wlsProxyPassword).getBytes(Charset.forName("UTF-8"))));
}
} else {
boolean proxyAuthPresent = false;
@@ -517,8 +517,8 @@ private static TCPNIOTransport createTransport(ThreadPoolConfig workerThreadPool
// if (proxyAuthPresent == true) then do nothing, proxy authorization header is already added.
if (!proxyAuthPresent && wlsProxyUsername != null && wlsProxyPassword != null) {
proxyHeaders.put("Proxy-Authorization", "Basic "
+ Base64Utils.encodeToString(
(wlsProxyUsername + ":" + wlsProxyPassword).getBytes(Charset.forName("UTF-8")), false));
+ Base64.getEncoder().encodeToString(
(wlsProxyUsername + ":" + wlsProxyPassword).getBytes(Charset.forName("UTF-8"))));
}
}
return proxyHeaders;
@@ -1,7 +1,7 @@
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2014-2016 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014-2017 Oracle and/or its affiliates. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
@@ -44,6 +44,7 @@
import java.net.URI;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import java.util.Base64;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
@@ -58,7 +59,6 @@
import org.glassfish.tyrus.client.ClientManager;
import org.glassfish.tyrus.client.ClientProperties;
import org.glassfish.tyrus.core.Base64Utils;
import org.glassfish.tyrus.core.CloseReasons;
import org.glassfish.tyrus.core.TyrusUpgradeResponse;
import org.glassfish.tyrus.core.Utils;
@@ -384,8 +384,8 @@ public String getRequestUri() {
if (wlsProxyUsername != null && wlsProxyPassword != null) {
proxyHeaders = new HashMap<>();
proxyHeaders.put("Proxy-Authorization", "Basic "
+ Base64Utils.encodeToString(
(wlsProxyUsername + ":" + wlsProxyPassword).getBytes(Charset.forName("UTF-8")), false));
+ Base64.getEncoder().encodeToString(
(wlsProxyUsername + ":" + wlsProxyPassword).getBytes(Charset.forName("UTF-8"))));
}
} else {
boolean proxyAuthPresent = false;
@@ -398,8 +398,8 @@ public String getRequestUri() {
// if (proxyAuthPresent == true) then do nothing, proxy authorization header is already added.
if (!proxyAuthPresent && wlsProxyUsername != null && wlsProxyPassword != null) {
proxyHeaders.put("Proxy-Authorization", "Basic "
+ Base64Utils.encodeToString(
(wlsProxyUsername + ":" + wlsProxyPassword).getBytes(Charset.forName("UTF-8")), false));
+ Base64.getEncoder().encodeToString(
(wlsProxyUsername + ":" + wlsProxyPassword).getBytes(Charset.forName("UTF-8"))));
}
}
return proxyHeaders;
Oops, something went wrong.

0 comments on commit 2f1a80e

Please sign in to comment.