1 //
 2 // Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
 3 // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 4 //
 5 // This code is free software; you can redistribute it and/or modify it
 6 // under the terms of the GNU General Public License version 2 only, as
 7 // published by the Free Software Foundation.
 8 //
 9 // This code is distributed in the hope that it will be useful, but WITHOUT
10 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 // FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12 // version 2 for more details (a copy is included in the LICENSE file that
13 // accompanied this code).
14 //
15 // You should have received a copy of the GNU General Public License version
16 // 2 along with this work; if not, write to the Free Software Foundation,
17 // Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 //
19 // Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 // or visit www.oracle.com if you need additional information or have any
21 // questions.
22 //
23 
24 // for JTwork//classes/0/test/lib/jdk/test/lib/util/FileUtils.class
25 grant codeBase "file:${test.classes}/../../../../test/lib/-" {
26     permission java.util.PropertyPermission "*", "read";
27     permission java.io.FilePermission "RequestBodyTest.tmp", "read,delete";
28 };
29 
30 // for JTwork/classes/0/test/lib/jdk/test/lib/net/SimpleSSLContext.class
31 grant codeBase "file:${test.classes}/../../../../test/lib/-" {
32     permission java.util.PropertyPermission "test.src.path", "read";
33     permission java.io.FilePermission "${test.src}/../../../../lib/jdk/test/lib/net/testkeys", "read";
34 };
35 
36 // for jdk/httpclient/test/lib/* classes
37 grant codeBase "file:${test.classes}/../../../../test/jdk/java/net/httpclient/lib/-" {
38     permission java.lang.RuntimePermission "accessClassInPackage.jdk.internal.net.http.common";
39 };
40 
41 grant codeBase "file:${test.classes}/*" {
42     permission java.io.FilePermission "${test.src}${/}docs${/}files${/}smallfile.txt", "read";
43     permission java.io.FilePermission "${test.src}${/}docs${/}files${/}notsobigfile.txt", "read";
44     permission java.io.FilePermission "RequestBodyTest.tmp", "read,write,delete";
45 
46     permission java.net.URLPermission "http://127.0.0.1:*/echo/foo",   "POST";
47     permission java.net.URLPermission "https://127.0.0.1:*/echo/foo",  "POST";
48     permission java.net.URLPermission "http://[::1]:*/echo/foo",   "POST";
49     permission java.net.URLPermission "https://[::1]:*/echo/foo",  "POST";
50 
51     // for HTTP/1.1 server logging
52     permission java.util.logging.LoggingPermission "control";
53 
54     // needed to grant the HTTP server
55     permission java.net.SocketPermission "127.0.0.1:*", "accept,resolve";
56     permission java.net.SocketPermission "[::1]:*", "accept,resolve";
57 
58     permission java.util.PropertyPermission "*", "read";
59     permission java.lang.RuntimePermission "modifyThread";
60 
61     permission java.lang.RuntimePermission "accessClassInPackage.jdk.internal.net.http.common";
62 };