GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(serialization): add type and assembly allow-list helpers by ReubenBond · Pull Request #10228 · dotnet/orleans

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Jun 15, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

TypeManifestOptions.AllowedTypes expects Orleans-formatted runtime type names, which is awkward for callers to construct correctly and only covers individual type names.

This adds AddAllowedType(Type) and AddAllowedAssembly(Assembly) helpers, plus an AllowedAssemblies allow-list, so callers can opt in a specific type or an entire assembly using the same formatting Orleans uses internally.

TypeConverter now expands configured allowed type names into their component type-name entries and honors configured assembly names during fail-closed validation against the resolved Type.Assembly. Type-name filters can still deny uncached names, type filters can still deny resolved types, and constructed generic arguments must be independently allowed.

Microsoft Reviewers: Open in CodeFlow

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ReubenBond
ReubenBond requested a review from Copilot June 17, 2026 00:41
Copilot started reviewing on behalf of ReubenBond June 17, 2026 00:41
View session
Copilot AI reviewed Jun 17, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Pull request overview

Adds convenience APIs for configuring serialization type allow-lists using Orleans runtime type-name formatting, and extends fail-closed type validation to support assembly allow-listing and unconditional enum allowance.

Changes:

  • Add TypeManifestOptions.AddAllowedType(Type) / AddAllowedAssembly(Assembly) plus an AllowedAssemblies allow-list.
  • Update TypeConverter validation to honor AllowedAssemblies and treat enums as allowed under fail-closed validation.
  • Update unit tests, README, and generated API surface to cover/reflect the new configuration options.
Show a summary per file
File Description
test/Orleans.Serialization.UnitTests/TypeConverterTests.cs Updates allow-list tests to use new helpers; adds coverage for constructed nested generics, allowed assemblies, and enums.
src/Orleans.Serialization/TypeSystem/TypeConverter.cs Implements configured assembly allow-listing, enum allowance, and improved allow-list handling for configured allowed types.
src/Orleans.Serialization/README.md Documents enum allowance and the new allow-list helper APIs.
src/Orleans.Serialization/Configuration/TypeManifestOptions.cs Adds AllowedAssemblies and helper methods to format/insert allowed types and assemblies consistently.
src/api/Orleans.Serialization/Orleans.Serialization.cs Updates public API surface to include the new options members and helper methods.

Copilot's findings

  • Files reviewed: 5/5 changed files
  • Comments generated: 2

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/Orleans.Serialization/TypeSystem/TypeConverter.cs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/Orleans.Serialization/README.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

@ReubenBond
ReubenBond marked this pull request as ready for review June 17, 2026 01:15
@ReubenBond
ReubenBond requested a review from Copilot June 17, 2026 15:22
@ReubenBond
ReubenBond force-pushed the reubenbond/serialization-opt-ins branch from 9efbcfb to 2625b9f Compare June 17, 2026 15:22
Copilot started reviewing on behalf of ReubenBond June 17, 2026 15:22
View session
Copilot AI reviewed Jun 17, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Copilot's findings

  • Files reviewed: 5/5 changed files
  • Comments generated: 3

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/Orleans.Serialization/TypeSystem/TypeConverter.cs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/Orleans.Serialization/README.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/Orleans.Serialization/TypeSystem/TypeConverter.cs Resolved

Uh oh!

There was an error while loading. Please reload this page.

@ReubenBond
ReubenBond force-pushed the reubenbond/serialization-opt-ins branch from c576c54 to ace447a Compare June 18, 2026 17:25
@ReubenBond ReubenBond changed the title Add serialization type allow-list helpers feat(serialization): add type and assembly allow-list helpers Jun 19, 2026
github-code-quality[bot]
github-code-quality Bot found potential problems Jul 6, 2026
View reviewed changes
Comment thread src/Orleans.Serialization/TypeSystem/TypeConverter.cs Fixed

Uh oh!

There was an error while loading. Please reload this page.

@ReubenBond
ReubenBond force-pushed the reubenbond/serialization-opt-ins branch from 2f2ec32 to 3b3b8b5 Compare July 6, 2026 18:39
ReubenBond and others added 11 commits July 9, 2026 13:36
@ReubenBond
feat: add serialization type allow-list helpers
947a665
Co-authored-by: Copilot <[email protected]>
@ReubenBond
fix: simplify allowed type helper
6957af0
Co-authored-by: Copilot <[email protected]>
@ReubenBond
fix: let filters deny allow-listed types
1897cb5
Co-authored-by: Copilot <[email protected]>
@ReubenBond
fix: check type name filters before assembly allow-list
1978121
Co-authored-by: Copilot <[email protected]>
@ReubenBond
fix: preserve type name validation cache ordering
7f067ec
Co-authored-by: Copilot <[email protected]>
@ReubenBond
refactor: rename named type validation helper
69ec98f
Co-authored-by: Copilot <[email protected]>
@ReubenBond
Potential fix for pull request finding
0060449
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
@ReubenBond
fix: leave enum validation to dedicated change
c02daef
Co-authored-by: Copilot <[email protected]>
@ReubenBond
fix(serialization): require generic arguments to be allowed
4b1cb77
Co-authored-by: Copilot App <[email protected]>
@ReubenBond
fix(serialization): harden type allow-list validation
55b6dd0
Co-authored-by: Copilot App <[email protected]>
@ReubenBond
fix(serialization): preserve type filter generic allowances
e4d3eb5
Co-authored-by: Copilot App <[email protected]>
@ReubenBond
ReubenBond force-pushed the reubenbond/serialization-opt-ins branch from 7fafb83 to e4d3eb5 Compare July 9, 2026 20:45
@ReubenBond
refactor(serialization): use projection for generic type inspection
83686c0
Co-authored-by: Copilot App <[email protected]>
Copilot AI review requested due to automatic review settings July 31, 2026 17:24
Copilot started reviewing on behalf of ReubenBond July 31, 2026 17:25
View session
Copilot AI reviewed Jul 31, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Copilot's findings

Suppressed comments (1)

src/Orleans.Serialization/TypeSystem/TypeConverter.cs:611

  • InspectGenericArguments uses LINQ (GenericTypeArguments.Select(InspectTypeCore)), which allocates an iterator and can add overhead on a hot path (type formatting/parsing). This file had to add using System.Linq; solely for that. Consider replacing this with a simple foreach to avoid allocations and keep the method allocation-free.
    private bool? InspectGenericArguments(Type type)
    {
        foreach (var result in type.GenericTypeArguments.Select(InspectTypeCore))
        {
            if (result != true)
  • Files reviewed: 6/6 changed files
  • Comments generated: 0 new

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
github-code-quality[bot]
github-code-quality Bot found potential problems Jul 31, 2026
View reviewed changes
Comment thread src/Orleans.Serialization/TypeSystem/TypeConverter.cs Fixed

Uh oh!

There was an error while loading. Please reload this page.

@ReubenBond
perf(serialization): avoid LINQ in generic type inspection
ed080a6
Co-authored-by: Copilot App <[email protected]>
Copilot AI review requested due to automatic review settings July 31, 2026 17:31
Copilot started reviewing on behalf of ReubenBond July 31, 2026 17:31
View session
github-code-quality[bot]
github-code-quality Bot found potential problems Jul 31, 2026
View reviewed changes
Comment thread src/Orleans.Serialization/TypeSystem/TypeConverter.cs Dismissed

Uh oh!

There was an error while loading. Please reload this page.

Copilot AI reviewed Jul 31, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Copilot's findings

Suppressed comments (1)

src/Orleans.Serialization/TypeSystem/TypeConverter.cs:399

  • IsNamedTypeAllowed returns true for names present in _allowedTypesConfiguration without updating the _allowedTypes cache. For configs which allow types by unqualified name (eg options.AllowedTypes.Add(typeof(Foo).FullName)), this means the same assembly-qualified QualifiedType will miss the cache on every call and still pay the cost of running ITypeNameFilter instances (via InspectTypeNameFilters) each time.

Since InspectTypeNameFilters has already had an opportunity to deny (false) before this branch, it should be safe to cache the allow decision for the current QualifiedType key here as well, improving performance and making caching behavior more consistent.

        if (_allowedTypesConfiguration.Contains(type.Type))
        {
            return true;
        }
  • Files reviewed: 6/6 changed files
  • Comments generated: 0 new

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ReubenBond
ReubenBond merged commit e06dc27 into main Jul 31, 2026
69 of 70 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@ReubenBond
ReubenBond deleted the reubenbond/serialization-opt-ins branch July 31, 2026 20:26
@ReubenBond ReubenBond mentioned this pull request Aug 10, 2026
Regression (10.1 to 10.2): TypeConverter rejects type-name encoding of IReadOnlyList<TAbstract> for JSON-serialized types #10239
Closed
This was referenced Aug 28, 2026
Bump Microsoft.Orleans.Dashboard from 10.2.2 to 10.3.0 csrakowski/FeedManager#20
Merged
Bump Microsoft.Orleans.Persistence.AdoNet from 10.2.2 to 10.3.0 csrakowski/FeedManager#21
Merged
Bump Microsoft.Orleans.Persistence.Memory from 10.2.2 to 10.3.0 csrakowski/FeedManager#22
Closed
Bump Microsoft.Orleans.Persistence.Redis from 10.2.2 to 10.3.0 csrakowski/FeedManager#23
Merged
Bump Microsoft.Orleans.Runtime from 10.2.2 to 10.3.0 csrakowski/FeedManager#24
Merged
Bump Microsoft.Orleans.Sdk from 10.2.2 to 10.3.0 csrakowski/FeedManager#25
Merged
Bump Microsoft.Orleans.Persistence.Memory and Microsoft.Orleans.Server csrakowski/FeedManager#26
Merged
Bump the dotnet-dependencies group with 1 update dills122/sandtable#67
Merged
Bump the dotnet group with 2 updates Kuestenlogik/Surgewave.Connectors#20
Merged
chore(deps): Bump the nuget-patch-and-minor group with 13 updates petesramek/microservices-vs-virtual-actors#7
Closed
chore: Bump Microsoft.Orleans.Persistence.Memory and Microsoft.Orleans.Runtime managedcode/Communication#151
Closed
chore: Bump Microsoft.Orleans.Runtime from 10.2.2 to 10.3.1 managedcode/Communication#152
Closed
chore: Bump Microsoft.Orleans.Sdk from 10.2.2 to 10.3.1 managedcode/Communication#153
Closed
chore: Bump Microsoft.Orleans.Serialization.Abstractions from 10.2.2 to 10.3.1 managedcode/Communication#154
Merged
chore: Bump Microsoft.Orleans.Persistence.Memory and 3 others managedcode/Communication#155
Closed
chore: Bump Microsoft.Orleans.TestingHost from 10.2.2 to 10.3.1 managedcode/Communication#156
Merged
Bump the orleans group with 1 update vgmello/momentum#341
Closed
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 31, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
+1 more reviewer
@github-code-quality github-code-quality[bot] github-code-quality[bot] left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@ReubenBond
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.