test/jdk/java/net/httpclient/security/8.policy
changeset 47216 71c04702a3d5
parent 46093 5d86e010d558
child 48083 b1c1b4ef4be2
child 55821 fa0fc03c0853
equal deleted inserted replaced
47215:4ebc2e2fb97c 47216:71c04702a3d5
       
     1 // Policy 8
       
     2 grant {
       
     3     // permissions common to all tests
       
     4     permission java.util.PropertyPermission "*", "read";
       
     5     permission java.io.FilePermission "${test.classes}${/}-", "read,write,delete";
       
     6     permission java.net.NetPermission "getDefaultHttpClient";
       
     7     permission java.lang.RuntimePermission "modifyThread";
       
     8     permission java.util.logging.LoggingPermission "control", "";
       
     9     permission java.net.SocketPermission "localhost:1024-", "accept,listen";
       
    10     permission java.io.FilePermission "${test.src}${/}docs${/}-", "read";
       
    11     permission java.lang.RuntimePermission "createClassLoader";
       
    12 
       
    13 
       
    14     // permissions specific to this test
       
    15     permission java.net.URLPermission "http://127.0.0.1:*/files/foo.txt", "GET:X-Foo1,X-Foo,X-Bar";
       
    16 };
       
    17 
       
    18 // For proxy only. Not being tested
       
    19 grant codebase "file:${test.classes}/proxydir/-" {
       
    20     permission java.net.SocketPermission "localhost:1024-", "accept,listen,connect";
       
    21     permission java.net.SocketPermission "127.0.0.1:1024-", "connect,resolve";
       
    22 };
       
    23 
       
    24 grant codeBase "jrt:/jdk.incubator.httpclient" {
       
    25     permission java.lang.RuntimePermission "accessClassInPackage.sun.net";
       
    26     permission java.lang.RuntimePermission "accessClassInPackage.sun.net.util";
       
    27     permission java.lang.RuntimePermission "accessClassInPackage.sun.net.www";
       
    28     permission java.lang.RuntimePermission "accessClassInPackage.jdk.internal.misc";
       
    29 
       
    30     // ## why is SP not good enough. Check API @throws signatures and impl
       
    31     permission java.net.SocketPermission "*","connect,resolve";
       
    32     permission java.net.URLPermission "http:*","*:*";
       
    33     permission java.net.URLPermission "https:*","*:*";
       
    34     permission java.net.URLPermission "ws:*","*:*";
       
    35     permission java.net.URLPermission "wss:*","*:*";
       
    36     permission java.net.URLPermission "socket:*","CONNECT";  // proxy
       
    37 
       
    38     // For request/response body processors, fromFile, asFile
       
    39     permission java.io.FilePermission "<<ALL FILES>>","read,write";  // delete???
       
    40 
       
    41     permission java.util.PropertyPermission "jdk.httpclient.*","read";
       
    42 
       
    43     // ## these permissions do not appear in the NetPermission spec!!! JDK bug?
       
    44     permission java.net.NetPermission "getSSLContext";
       
    45     permission java.net.NetPermission "setSSLContext";
       
    46 };
       
    47