jdk/test/java/net/httpclient/security/2.policy
author dfuchs
Fri, 04 Aug 2017 10:54:48 +0100
changeset 46093 5d86e010d558
parent 42460 7133f144981a
permissions -rw-r--r--
8185794: java/net/httpclient/security/Driver.java fails in timeout Summary: added missing permission in policy files and increased timeout. Reviewed-by: rriggs, xiaofeya
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
36131
379db4b2f95d 8087112: HTTP API and HTTP/1.1 implementation
michaelm
parents:
diff changeset
     1
// Policy 2
379db4b2f95d 8087112: HTTP API and HTTP/1.1 implementation
michaelm
parents:
diff changeset
     2
grant {
379db4b2f95d 8087112: HTTP API and HTTP/1.1 implementation
michaelm
parents:
diff changeset
     3
    // permissions common to all tests
37791
ae33107fd8b3 8155928: Remove hardcoded port numbers from httpclient/Security.java test
michaelm
parents: 36131
diff changeset
     4
    permission java.util.PropertyPermission "*", "read";
36131
379db4b2f95d 8087112: HTTP API and HTTP/1.1 implementation
michaelm
parents:
diff changeset
     5
    permission java.io.FilePermission "${test.classes}${/}-", "read,write,delete";
379db4b2f95d 8087112: HTTP API and HTTP/1.1 implementation
michaelm
parents:
diff changeset
     6
    permission java.net.NetPermission "getDefaultHttpClient";
379db4b2f95d 8087112: HTTP API and HTTP/1.1 implementation
michaelm
parents:
diff changeset
     7
    permission java.lang.RuntimePermission "modifyThread";
379db4b2f95d 8087112: HTTP API and HTTP/1.1 implementation
michaelm
parents:
diff changeset
     8
    permission java.util.logging.LoggingPermission "control", "";
379db4b2f95d 8087112: HTTP API and HTTP/1.1 implementation
michaelm
parents:
diff changeset
     9
    permission java.net.SocketPermission "localhost:1024-", "accept,listen";
379db4b2f95d 8087112: HTTP API and HTTP/1.1 implementation
michaelm
parents:
diff changeset
    10
    permission java.io.FilePermission "${test.src}${/}docs${/}-", "read";
379db4b2f95d 8087112: HTTP API and HTTP/1.1 implementation
michaelm
parents:
diff changeset
    11
    permission java.lang.RuntimePermission "createClassLoader";
379db4b2f95d 8087112: HTTP API and HTTP/1.1 implementation
michaelm
parents:
diff changeset
    12
379db4b2f95d 8087112: HTTP API and HTTP/1.1 implementation
michaelm
parents:
diff changeset
    13
379db4b2f95d 8087112: HTTP API and HTTP/1.1 implementation
michaelm
parents:
diff changeset
    14
    // permissions specific to this test
379db4b2f95d 8087112: HTTP API and HTTP/1.1 implementation
michaelm
parents:
diff changeset
    15
    permission java.net.URLPermission "http://127.0.0.1:*/files/*", "GET";
379db4b2f95d 8087112: HTTP API and HTTP/1.1 implementation
michaelm
parents:
diff changeset
    16
};
379db4b2f95d 8087112: HTTP API and HTTP/1.1 implementation
michaelm
parents:
diff changeset
    17
379db4b2f95d 8087112: HTTP API and HTTP/1.1 implementation
michaelm
parents:
diff changeset
    18
// For proxy only. Not being tested
379db4b2f95d 8087112: HTTP API and HTTP/1.1 implementation
michaelm
parents:
diff changeset
    19
grant codebase "file:${test.classes}/proxydir/-" {
379db4b2f95d 8087112: HTTP API and HTTP/1.1 implementation
michaelm
parents:
diff changeset
    20
    permission java.net.SocketPermission "localhost:1024-", "accept,listen,connect";
379db4b2f95d 8087112: HTTP API and HTTP/1.1 implementation
michaelm
parents:
diff changeset
    21
    permission java.net.SocketPermission "127.0.0.1:1024-", "connect,resolve";
379db4b2f95d 8087112: HTTP API and HTTP/1.1 implementation
michaelm
parents:
diff changeset
    22
};
379db4b2f95d 8087112: HTTP API and HTTP/1.1 implementation
michaelm
parents:
diff changeset
    23
42460
7133f144981a 8170648: Move java.net.http package out of Java SE to incubator namespace
michaelm
parents: 37791
diff changeset
    24
grant codeBase "jrt:/jdk.incubator.httpclient" {
7133f144981a 8170648: Move java.net.http package out of Java SE to incubator namespace
michaelm
parents: 37791
diff changeset
    25
    permission java.lang.RuntimePermission "accessClassInPackage.sun.net";
46093
5d86e010d558 8185794: java/net/httpclient/security/Driver.java fails in timeout
dfuchs
parents: 42460
diff changeset
    26
    permission java.lang.RuntimePermission "accessClassInPackage.sun.net.util";
42460
7133f144981a 8170648: Move java.net.http package out of Java SE to incubator namespace
michaelm
parents: 37791
diff changeset
    27
    permission java.lang.RuntimePermission "accessClassInPackage.sun.net.www";
7133f144981a 8170648: Move java.net.http package out of Java SE to incubator namespace
michaelm
parents: 37791
diff changeset
    28
    permission java.lang.RuntimePermission "accessClassInPackage.jdk.internal.misc";
7133f144981a 8170648: Move java.net.http package out of Java SE to incubator namespace
michaelm
parents: 37791
diff changeset
    29
7133f144981a 8170648: Move java.net.http package out of Java SE to incubator namespace
michaelm
parents: 37791
diff changeset
    30
    // ## why is SP not good enough. Check API @throws signatures and impl
7133f144981a 8170648: Move java.net.http package out of Java SE to incubator namespace
michaelm
parents: 37791
diff changeset
    31
    permission java.net.SocketPermission "*","connect,resolve";
7133f144981a 8170648: Move java.net.http package out of Java SE to incubator namespace
michaelm
parents: 37791
diff changeset
    32
    permission java.net.URLPermission "http:*","*:*";
7133f144981a 8170648: Move java.net.http package out of Java SE to incubator namespace
michaelm
parents: 37791
diff changeset
    33
    permission java.net.URLPermission "https:*","*:*";
7133f144981a 8170648: Move java.net.http package out of Java SE to incubator namespace
michaelm
parents: 37791
diff changeset
    34
    permission java.net.URLPermission "ws:*","*:*";
7133f144981a 8170648: Move java.net.http package out of Java SE to incubator namespace
michaelm
parents: 37791
diff changeset
    35
    permission java.net.URLPermission "wss:*","*:*";
7133f144981a 8170648: Move java.net.http package out of Java SE to incubator namespace
michaelm
parents: 37791
diff changeset
    36
    permission java.net.URLPermission "socket:*","CONNECT";  // proxy
7133f144981a 8170648: Move java.net.http package out of Java SE to incubator namespace
michaelm
parents: 37791
diff changeset
    37
7133f144981a 8170648: Move java.net.http package out of Java SE to incubator namespace
michaelm
parents: 37791
diff changeset
    38
    // For request/response body processors, fromFile, asFile
7133f144981a 8170648: Move java.net.http package out of Java SE to incubator namespace
michaelm
parents: 37791
diff changeset
    39
    permission java.io.FilePermission "<<ALL FILES>>","read,write";  // delete???
7133f144981a 8170648: Move java.net.http package out of Java SE to incubator namespace
michaelm
parents: 37791
diff changeset
    40
7133f144981a 8170648: Move java.net.http package out of Java SE to incubator namespace
michaelm
parents: 37791
diff changeset
    41
    permission java.util.PropertyPermission "jdk.httpclient.*","read";
7133f144981a 8170648: Move java.net.http package out of Java SE to incubator namespace
michaelm
parents: 37791
diff changeset
    42
7133f144981a 8170648: Move java.net.http package out of Java SE to incubator namespace
michaelm
parents: 37791
diff changeset
    43
    // ## these permissions do not appear in the NetPermission spec!!! JDK bug?
7133f144981a 8170648: Move java.net.http package out of Java SE to incubator namespace
michaelm
parents: 37791
diff changeset
    44
    permission java.net.NetPermission "getSSLContext";
7133f144981a 8170648: Move java.net.http package out of Java SE to incubator namespace
michaelm
parents: 37791
diff changeset
    45
    permission java.net.NetPermission "setSSLContext";
7133f144981a 8170648: Move java.net.http package out of Java SE to incubator namespace
michaelm
parents: 37791
diff changeset
    46
};
7133f144981a 8170648: Move java.net.http package out of Java SE to incubator namespace
michaelm
parents: 37791
diff changeset
    47