[gh-209] Allowed System.Net.IPAddress.

This commit is contained in:
Andrey Shchekin 2017-10-17 22:57:06 +13:00
Родитель eb23b6de77
Коммит 9bd1904826
2 изменённых файлов: 129 добавлений и 1 удалений

Просмотреть файл

@ -4550,6 +4550,127 @@ System.Linq.Expressions
ReduceExtensions: Allowed
ToString: Allowed
Update: Allowed
System.Net
AuthenticationManager: Denied
AuthenticationSchemes: Denied
AuthenticationSchemeSelector: Denied
Authorization: Denied
BindIPEndPoint: Denied
Cookie: Denied
CookieCollection: Denied
CookieContainer: Denied
CookieException: Denied
CredentialCache: Denied
DecompressionMethods: Denied
Dns: Denied
DnsEndPoint: Denied
DnsPermission: Denied
DnsPermissionAttribute: Denied
DownloadDataCompletedEventArgs: Denied
DownloadDataCompletedEventHandler: Denied
DownloadProgressChangedEventArgs: Denied
DownloadProgressChangedEventHandler: Denied
DownloadStringCompletedEventArgs: Denied
DownloadStringCompletedEventHandler: Denied
EndPoint: Denied
EndpointPermission: Denied
FileWebRequest: Denied
FileWebResponse: Denied
FtpStatusCode: Denied
FtpWebRequest: Denied
FtpWebResponse: Denied
GlobalProxySelection: Denied
HttpContinueDelegate: Denied
HttpListener: Denied
HttpListener+ExtendedProtectionSelector: Denied
HttpListenerBasicIdentity: Denied
HttpListenerContext: Denied
HttpListenerException: Denied
HttpListenerPrefixCollection: Denied
HttpListenerRequest: Denied
HttpListenerResponse: Denied
HttpListenerTimeoutManager: Denied
HttpRequestHeader: Denied
HttpResponseHeader: Denied
HttpStatusCode: Denied
HttpVersion: Denied
HttpWebRequest: Denied
HttpWebResponse: Denied
IAuthenticationModule: Denied
ICertificatePolicy: Denied
ICredentialPolicy: Denied
ICredentials: Denied
ICredentialsByHost: Denied
IPAddress: Allowed
.ctor: Allowed
Equals: Allowed
get_Address: Allowed
get_AddressFamily: Allowed
get_IsIPv4MappedToIPv6: Allowed
get_IsIPv6LinkLocal: Allowed
get_IsIPv6Multicast: Allowed
get_IsIPv6SiteLocal: Allowed
get_IsIPv6Teredo: Allowed
get_ScopeId: Allowed
GetAddressBytes: Allowed
GetHashCode: Allowed
GetType: Allowed
HostToNetworkOrder: Allowed
IsLoopback: Allowed
MapToIPv4: Allowed
MapToIPv6: Allowed
NetworkToHostOrder: Allowed
Parse: Allowed
set_Address: Allowed
set_ScopeId: Allowed
ToString: Allowed
TryParse: Allowed
IPEndPoint: Denied
IPHostEntry: Denied
IWebProxy: Denied
IWebProxyScript: Denied
IWebRequestCreate: Denied
NetworkAccess: Denied
NetworkCredential: Denied
OpenReadCompletedEventArgs: Denied
OpenReadCompletedEventHandler: Denied
OpenWriteCompletedEventArgs: Denied
OpenWriteCompletedEventHandler: Denied
ProtocolViolationException: Denied
SecurityProtocolType: Denied
ServicePoint: Denied
ServicePointManager: Denied
SocketAddress: Denied
SocketPermission: Denied
SocketPermissionAttribute: Denied
TransportContext: Denied
TransportType: Denied
UploadDataCompletedEventArgs: Denied
UploadDataCompletedEventHandler: Denied
UploadFileCompletedEventArgs: Denied
UploadFileCompletedEventHandler: Denied
UploadProgressChangedEventArgs: Denied
UploadProgressChangedEventHandler: Denied
UploadStringCompletedEventArgs: Denied
UploadStringCompletedEventHandler: Denied
UploadValuesCompletedEventArgs: Denied
UploadValuesCompletedEventHandler: Denied
WebClient: Denied
WebException: Denied
WebExceptionStatus: Denied
WebHeaderCollection: Denied
WebPermission: Denied
WebPermissionAttribute: Denied
WebProxy: Denied
WebRequest: Denied
WebRequestMethods: Denied
WebRequestMethods+File: Denied
WebRequestMethods+Ftp: Denied
WebRequestMethods+Http: Denied
WebResponse: Denied
WebUtility: Denied
WriteStreamClosedEventArgs: Denied
WriteStreamClosedEventHandler: Denied
System.Reflection
AmbiguousMatchException: Denied
Assembly: Denied

Просмотреть файл

@ -1,7 +1,9 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Globalization;
using System.Linq.Expressions;
using System.Net;
using System.Reflection;
using Microsoft.FSharp.Collections;
using Microsoft.FSharp.Core;
@ -13,7 +15,6 @@ using Unbreakable.Policy;
using Unbreakable.Policy.Rewriters;
namespace SharpLab.Server.Execution.Internal {
using System.Globalization;
using static ApiAccess;
public static class ApiPolicySetup {
@ -32,6 +33,7 @@ namespace SharpLab.Server.Execution.Internal {
.Namespace("System.Globalization", Neutral, SetupSystemGlobalization)
.Namespace("System.Reflection", Neutral, SetupSystemReflection)
.Namespace("System.Linq.Expressions", Neutral, SetupSystemLinqExpressions)
.Namespace("System.Net", Neutral, SetupSystemNet)
.Namespace("System.IO", Neutral,
// required by F#'s printf
n => n.Type(typeof(TextWriter), Neutral)
@ -179,6 +181,11 @@ namespace SharpLab.Server.Execution.Internal {
});
}
private static void SetupSystemNet(NamespacePolicy namespacePolicy) {
namespacePolicy
.Type(typeof(IPAddress), Allowed);
}
private static void SetupSystemReflection(NamespacePolicy namespacePolicy) {
ForEachTypeInNamespaceOf<MemberInfo>(type => {
if (type.IsEnum) {