Skip to content

Commit

Permalink
Add proper reflection configuration for java classes available to JS …
Browse files Browse the repository at this point in the history
…sandbox by default
  • Loading branch information
danslapman committed Feb 15, 2024
1 parent 7e8145c commit 31f265f
Show file tree
Hide file tree
Showing 3 changed files with 144 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@
"name":"java.lang.Boolean",
"methods":[{"name":"getBoolean","parameterTypes":["java.lang.String"] }]
},
{
"name":"java.lang.Class",
"methods":[{"name":"getClassLoader","parameterTypes":[] }]
},
{
"name":"java.lang.ClassLoader",
"methods":[{"name":"getPlatformClassLoader","parameterTypes":[] }, {"name":"loadClass","parameterTypes":["java.lang.String"] }]
Expand Down Expand Up @@ -167,6 +171,9 @@
"name":"java.nio.channels.ClosedChannelException",
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"jdk.internal.loader.ClassLoaders$AppClassLoader"
},
{
"name":"jdk.internal.loader.ClassLoaders$PlatformClassLoader"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@
{
"name":"io.grpc.census.InternalCensusTracingAccessor"
},
{
"name":"io.grpc.okhttp.OkHttpServerProvider"
},
{
"name":"io.micrometer.core.instrument.DistributionSummary$Builder",
"queryAllPublicMethods":true
Expand Down Expand Up @@ -553,11 +556,19 @@
},
{
"name":"java.lang.Boolean",
"fields":[{"name":"TYPE"}]
"allDeclaredFields": true,
"allDeclaredMethods": true,
"allPublicMethods": true,
"queryAllDeclaredMethods": true,
"queryAllPublicMethods" : true
},
{
"name":"java.lang.Byte",
"fields":[{"name":"TYPE"}]
"allDeclaredFields": true,
"allDeclaredMethods": true,
"allPublicMethods": true,
"queryAllDeclaredMethods": true,
"queryAllPublicMethods" : true
},
{
"name":"java.lang.Character",
Expand All @@ -572,25 +583,49 @@
},
{
"name":"java.lang.Double",
"fields":[{"name":"TYPE"}]
"allDeclaredFields": true,
"allDeclaredMethods": true,
"allPublicMethods": true,
"queryAllDeclaredMethods": true,
"queryAllPublicMethods" : true
},
{
"name":"java.lang.Exception"
},
{
"name":"java.lang.Float",
"fields":[{"name":"TYPE"}]
"allDeclaredFields": true,
"allDeclaredMethods": true,
"allPublicMethods": true,
"queryAllDeclaredMethods": true,
"queryAllPublicMethods" : true
},
{
"name":"java.lang.IllegalArgumentException"
},
{
"name":"java.lang.Integer",
"fields":[{"name":"TYPE"}]
"allDeclaredFields": true,
"allDeclaredMethods": true,
"allPublicMethods": true,
"queryAllDeclaredMethods": true,
"queryAllPublicMethods" : true
},
{
"name":"java.lang.Long",
"fields":[{"name":"TYPE"}]
"allDeclaredFields": true,
"allDeclaredMethods": true,
"allPublicMethods": true,
"queryAllDeclaredMethods": true,
"queryAllPublicMethods" : true
},
{
"name":"java.lang.Math",
"allDeclaredFields": true,
"allDeclaredMethods": true,
"allPublicMethods": true,
"queryAllDeclaredMethods": true,
"queryAllPublicMethods" : true
},
{
"name":"java.lang.Module",
Expand All @@ -614,11 +649,19 @@
},
{
"name":"java.lang.Short",
"fields":[{"name":"TYPE"}]
"allDeclaredFields": true,
"allDeclaredMethods": true,
"allPublicMethods": true,
"queryAllDeclaredMethods": true,
"queryAllPublicMethods" : true
},
{
"name":"java.lang.String",
"fields":[{"name":"TYPE"}]
"allDeclaredFields": true,
"allDeclaredMethods": true,
"allPublicMethods": true,
"queryAllDeclaredMethods": true,
"queryAllPublicMethods" : true
},
{
"name":"java.lang.Thread",
Expand Down Expand Up @@ -663,10 +706,20 @@
"methods":[{"name":"getInputArguments","parameterTypes":[] }, {"name":"getName","parameterTypes":[] }]
},
{
"name":"java.math.BigDecimal"
"name":"java.math.BigDecimal",
"allDeclaredFields": true,
"allDeclaredMethods": true,
"allPublicMethods": true,
"queryAllDeclaredMethods": true,
"queryAllPublicMethods" : true
},
{
"name":"java.math.BigInteger"
"name":"java.math.BigInteger",
"allDeclaredFields": true,
"allDeclaredMethods": true,
"allPublicMethods": true,
"queryAllDeclaredMethods": true,
"queryAllPublicMethods" : true
},
{
"name":"java.net.InetAddress",
Expand Down Expand Up @@ -762,12 +815,68 @@
{
"name":"java.time.Instant"
},
{
"name":"java.time.LocalDate",
"allDeclaredFields": true,
"allDeclaredMethods": true,
"allPublicMethods": true,
"queryAllDeclaredMethods": true,
"queryAllPublicMethods" : true
},
{
"name":"java.time.LocalDateTime",
"allDeclaredFields": true,
"allDeclaredMethods": true,
"allPublicMethods": true,
"queryAllDeclaredMethods": true,
"queryAllPublicMethods" : true
},
{
"name":"java.time.format.DateTimeFormatter",
"allDeclaredFields": true,
"allDeclaredMethods": true,
"allPublicMethods": true,
"queryAllDeclaredMethods": true,
"queryAllPublicMethods" : true
},
{
"name":"java.util.Date"
},
{
"name":"java.util.List",
"allDeclaredFields": true,
"allDeclaredMethods": true,
"allPublicMethods": true,
"queryAllDeclaredMethods": true,
"queryAllPublicMethods" : true
},
{
"name":"java.util.Map",
"allDeclaredFields": true,
"allDeclaredMethods": true,
"allPublicMethods": true,
"queryAllDeclaredMethods": true,
"queryAllPublicMethods" : true
},
{
"name":"java.util.PropertyPermission"
},
{
"name":"java.util.Random",
"allDeclaredFields": true,
"allDeclaredMethods": true,
"allPublicMethods": true,
"queryAllDeclaredMethods": true,
"queryAllPublicMethods" : true
},
{
"name":"java.util.Set",
"allDeclaredFields": true,
"allDeclaredMethods": true,
"allPublicMethods": true,
"queryAllDeclaredMethods": true,
"queryAllPublicMethods" : true
},
{
"name":"java.util.concurrent.ForkJoinTask",
"fields":[{"name":"aux"}, {"name":"status"}]
Expand Down Expand Up @@ -812,6 +921,14 @@
"name":"jdk.internal.misc.Unsafe",
"methods":[{"name":"getUnsafe","parameterTypes":[] }]
},
{
"name":"org.graalvm.polyglot.io.IOHelper",
"fields":[{"name":"ACCESS"}]
},
{
"name":"org.graalvm.polyglot.management.Management",
"fields":[{"name":"ACCESS"}]
},
{
"name":"org.slf4j.Logger"
},
Expand Down Expand Up @@ -972,6 +1089,10 @@
"name":"sun.security.rsa.RSASignature$SHA256withRSA",
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"sun.security.ssl.KeyManagerFactoryImpl$SunX509",
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"sun.security.ssl.SSLContextImpl",
"fields":[{"name":"trustManager"}]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@
"pattern":"\\Qcats/data/Chain$.class\\E"
}, {
"pattern":"\\Qcats/effect/concurrent/Ref$SyncRef.class\\E"
}, {
"pattern":"\\Qcats/instances/ListInstances$$anon$1.class\\E"
}, {
"pattern":"\\Qcats/instances/VectorInstances$$anon$1.class\\E"
}, {
"pattern":"\\Qcats/syntax/ApplicativeErrorOps$.class\\E"
}, {
"pattern":"\\Qcom/oracle/truffle/js/lang/JavaScriptLanguage.class\\E"
}, {
"pattern":"\\Qcom/oracle/truffle/regex/RegexLanguage.class\\E"
}, {
"pattern":"\\Qeu/timepit/fs2cron/package$.class\\E"
}, {
Expand Down

0 comments on commit 31f265f

Please sign in to comment.