|
17 | 17 | import java.net.MalformedURLException; |
18 | 18 | import java.net.NetPermission; |
19 | 19 | import java.net.SocketPermission; |
| 20 | +import java.net.URI; |
| 21 | +import java.net.URISyntaxException; |
20 | 22 | import java.net.URL; |
21 | 23 | import java.net.URLDecoder; |
22 | 24 | import java.nio.charset.StandardCharsets; |
|
38 | 40 |
|
39 | 41 | @SuppressWarnings("removal") |
40 | 42 | public class PolicyFile extends java.security.Policy { |
41 | | - public static final Set<String> PERM_CLASSES_TO_SKIP = Set.of( |
42 | | - "org.opensearch.secure_sm.ThreadContextPermission", |
43 | | - "org.opensearch.secure_sm.ThreadPermission", |
44 | | - "org.opensearch.SpecialPermission", |
45 | | - "org.bouncycastle.crypto.CryptoServicesPermission", |
46 | | - "org.opensearch.script.ClassPermission", |
47 | | - "javax.security.auth.AuthPermission", |
48 | | - "javax.security.auth.kerberos.ServicePermission" |
49 | | - ); |
50 | | - |
51 | 43 | public static final Set<Class<?>> KNOWN_PERM_CLASSES = Set.of( |
52 | 44 | SocketPermission.class, |
53 | 45 | FilePermission.class, |
@@ -355,8 +347,7 @@ private static class PolicyInfo { |
355 | 347 | } |
356 | 348 | } |
357 | 349 |
|
358 | | - @SuppressWarnings("deprecation") |
359 | | - private static URL newURL(String spec) throws MalformedURLException { |
360 | | - return new URL(spec); |
| 350 | + private static URL newURL(String spec) throws MalformedURLException, URISyntaxException { |
| 351 | + return new URI(spec).toURL(); |
361 | 352 | } |
362 | 353 | } |
0 commit comments