Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup type blacklist PR #254

Merged
merged 3 commits into from
Aug 16, 2021

Conversation

Arkatufus
Copy link
Contributor

No description provided.

@@ -23,7 +23,8 @@ public class SerializerOptions
serializerFactories: null,
knownTypes: null,
ignoreISerializable: false,
packageNameOverrides: null);
packageNameOverrides: null,
disallowUnsafeTypes: true);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move disallow unsafe types flag to options

private static bool IsValueType(this Type type)
=> type.IsSubclassOf(typeof(ValueType));

private static bool IsSubclassOf(this Type p, Type c)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add missing type functions to netstandard 1.6, needed for the type blacklisting feature.

@@ -398,6 +406,11 @@ public class T
/// </summary>
private static bool IsSimilarType(this Type thisType, Type type)
{
if (thisType == null && type == null)
return true;
if (thisType == null || type == null)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Null check for safety

@Arkatufus Arkatufus changed the title Cleanup deny list PR Cleanup type blacklist PR Aug 16, 2021
@Arkatufus Arkatufus self-assigned this Aug 16, 2021
public SerializerOptions(bool versionTolerance, bool preserveObjectReferences, System.Collections.Generic.IEnumerable<Hyperion.Surrogate> surrogates, System.Collections.Generic.IEnumerable<Hyperion.SerializerFactories.ValueSerializerFactory> serializerFactories, System.Collections.Generic.IEnumerable<System.Type> knownTypes, bool ignoreISerializable, System.Collections.Generic.IEnumerable<System.Func<string, string>> packageNameOverrides) { }
public SerializerOptions(bool versionTolerance, bool preserveObjectReferences, System.Collections.Generic.IEnumerable<Hyperion.Surrogate> surrogates, System.Collections.Generic.IEnumerable<Hyperion.SerializerFactories.ValueSerializerFactory> serializerFactories, System.Collections.Generic.IEnumerable<System.Type> knownTypes, bool ignoreISerializable, System.Collections.Generic.IEnumerable<System.Func<string, string>> packageNameOverrides, bool disallowUnsafeTypes) { }
public Hyperion.SerializerOptions WithDisallowUnsafeType(bool disallowUnsafeType) { }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Aaronontheweb Aaronontheweb merged commit 5284534 into akkadotnet:dev Aug 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants