Skip to content

Support multiple authorize policies - #329

Merged
viceroypenguin merged 4 commits into
ImmediatePlatform:mainfrom
leorg99:fix/multiple-authorize-policies
Aug 12, 2026
Merged

Support multiple authorize policies#329
viceroypenguin merged 4 commits into
ImmediatePlatform:mainfrom
leorg99:fix/multiple-authorize-policies

Conversation

@leorg99

@leorg99 leorg99 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Fixes #328

Summary

  • Collect all supported [Authorize] policy attributes instead of using only the first.
  • Preserve parameterless authorization when combined with named policies.
  • Keep existing single-policy output and [AllowAnonymous] precedence unchanged.

Tests

  • Added Verify.SourceGenerators coverage across all five HTTP methods.
  • Changed generator and test projects compile successfully for net8.0, net9.0, and net10.0.
  • Focused net10.0 suite: 462 passed, 0 failed, 0 skipped.
  • CI-style net10.0 build, coverage test, package, and package validation passed.

Summary by CodeRabbit

  • New Features

    • Endpoints can now combine default authorization with multiple named authorization policies.
    • All authorization attributes are recognized, ensuring configured policies are applied together across supported HTTP methods.
  • Bug Fixes

    • Authorization validation now checks every authorization attribute and reports invalid named parameters consistently.
  • Tests

    • Added coverage for combined default and named authorization policies across generated endpoints and HTTP methods.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@viceroypenguin, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 53 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 94f1c8ff-7ef5-417f-87c0-dc961cdb3925

📥 Commits

Reviewing files that changed from the base of the PR and between 58014d6 and ac12f2e.

📒 Files selected for processing (6)
  • src/Immediate.Apis.Generators/ImmediateApisGenerator.Transform.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithMultipleAuthorizePoliciesTest_method=Delete#IA.Dummy.GetUsersQuery.g.verified.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithMultipleAuthorizePoliciesTest_method=Get#IA.Dummy.GetUsersQuery.g.verified.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithMultipleAuthorizePoliciesTest_method=Patch#IA.Dummy.GetUsersQuery.g.verified.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithMultipleAuthorizePoliciesTest_method=Post#IA.Dummy.GetUsersQuery.g.verified.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithMultipleAuthorizePoliciesTest_method=Put#IA.Dummy.GetUsersQuery.g.verified.cs

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5c89a2c3-b830-450f-843e-4acf57132272

📥 Commits

Reviewing files that changed from the base of the PR and between 70ab263 and 58014d6.

📒 Files selected for processing (23)
  • src/Immediate.Apis.Generators/ImmediateApisGenerator.Transform.cs
  • src/Immediate.Apis.Generators/Templates/Route.sbntxt
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithAuthorizeConstructorTest_method=Delete#IA.Dummy.GetUsersQuery.g.verified.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithAuthorizeConstructorTest_method=Get#IA.Dummy.GetUsersQuery.g.verified.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithAuthorizeConstructorTest_method=Patch#IA.Dummy.GetUsersQuery.g.verified.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithAuthorizeConstructorTest_method=Post#IA.Dummy.GetUsersQuery.g.verified.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithAuthorizeConstructorTest_method=Put#IA.Dummy.GetUsersQuery.g.verified.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithAuthorizeNamedPolicyArgumentTest_method=Delete#IA.Dummy.GetUsersQuery.g.verified.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithAuthorizeNamedPolicyArgumentTest_method=Get#IA.Dummy.GetUsersQuery.g.verified.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithAuthorizeNamedPolicyArgumentTest_method=Patch#IA.Dummy.GetUsersQuery.g.verified.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithAuthorizeNamedPolicyArgumentTest_method=Post#IA.Dummy.GetUsersQuery.g.verified.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithAuthorizeNamedPolicyArgumentTest_method=Put#IA.Dummy.GetUsersQuery.g.verified.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithMultipleAuthorizePoliciesTest_method=Delete#IA.Dummy.GetUsersQuery.g.verified.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithMultipleAuthorizePoliciesTest_method=Get#IA.Dummy.GetUsersQuery.g.verified.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithMultipleAuthorizePoliciesTest_method=Patch#IA.Dummy.GetUsersQuery.g.verified.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithMultipleAuthorizePoliciesTest_method=Post#IA.Dummy.GetUsersQuery.g.verified.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithMultipleAuthorizePoliciesTest_method=Put#IA.Dummy.GetUsersQuery.g.verified.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/MultipleRoutesTests.MapMethodMultipleRoutesWithAllFeaturesTest#IA.Dummy.GetUsersQuery.g.verified.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/MultipleRoutesTests.MapMethodMultipleRoutesWithAuthorizeTest_method=Delete#IA.Dummy.GetUsersQuery.g.verified.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/MultipleRoutesTests.MapMethodMultipleRoutesWithAuthorizeTest_method=Get#IA.Dummy.GetUsersQuery.g.verified.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/MultipleRoutesTests.MapMethodMultipleRoutesWithAuthorizeTest_method=Patch#IA.Dummy.GetUsersQuery.g.verified.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/MultipleRoutesTests.MapMethodMultipleRoutesWithAuthorizeTest_method=Post#IA.Dummy.GetUsersQuery.g.verified.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/MultipleRoutesTests.MapMethodMultipleRoutesWithAuthorizeTest_method=Put#IA.Dummy.GetUsersQuery.g.verified.cs
💤 Files with no reviewable changes (1)
  • src/Immediate.Apis.Generators/Templates/Route.sbntxt
🚧 Files skipped from review as they are similar to previous changes (6)
  • src/Immediate.Apis.Generators/ImmediateApisGenerator.Transform.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithMultipleAuthorizePoliciesTest_method=Put#IA.Dummy.GetUsersQuery.g.verified.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithMultipleAuthorizePoliciesTest_method=Get#IA.Dummy.GetUsersQuery.g.verified.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithMultipleAuthorizePoliciesTest_method=Patch#IA.Dummy.GetUsersQuery.g.verified.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithMultipleAuthorizePoliciesTest_method=Delete#IA.Dummy.GetUsersQuery.g.verified.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithMultipleAuthorizePoliciesTest_method=Post#IA.Dummy.GetUsersQuery.g.verified.cs

📝 Walkthrough

Walkthrough

The generator now processes every [Authorize] attribute. It separates default authorization from explicit policies and emits all requirements in generated endpoint mappings. The analyzer validates named arguments on every authorization attribute. Tests cover five mapping methods.

Changes

Authorization policy generation

Layer / File(s) Summary
Authorization aggregation
src/Immediate.Apis.Generators/ImmediateApisGenerator.Models.cs, src/Immediate.Apis.Generators/ImmediateApisGenerator.Transform.cs
The generator stores default authorization separately from an equatable collection of explicit policy names. It processes all [Authorize] attributes.
Endpoint authorization emission
src/Immediate.Apis.Generators/Templates/Route.sbntxt, tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/*
The route template emits default authorization and all explicit policies as separate endpoint requirements. Generated snapshots cover combined policies and updated authorization-call formatting.
Authorization validation and regression coverage
src/Immediate.Apis.Analyzers/InvalidAuthorizeAttributeAnalyzer.cs, tests/Immediate.Apis.Tests/AnalyzerTests/InvalidAuthorizeAttributeAnalyzerTests.cs, tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.cs
The analyzer checks every [Authorize] attribute. Tests verify invalid named arguments and combined authorization for DELETE, GET, PATCH, POST, and PUT mappings.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant AuthorizeAttributes
  participant GeneratorTransform
  participant RouteTemplate
  participant GeneratedEndpoint
  AuthorizeAttributes->>GeneratorTransform: provide all [Authorize] attributes
  GeneratorTransform->>RouteTemplate: pass default flag and policy collection
  RouteTemplate->>GeneratedEndpoint: emit default authorization
  RouteTemplate->>GeneratedEndpoint: emit all configured policy requirements
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the primary change: support for multiple authorization policies.
Linked Issues check ✅ Passed The generator now preserves all declared authorization policies and includes regression coverage for multiple attributes [#328].
Out of Scope Changes check ✅ Passed The analyzer updates, tests, and snapshot changes directly support multiple-policy authorization and related regression coverage.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/Immediate.Apis.Generators/ImmediateApisGenerator.Transform.cs`:
- Around line 50-64: Update the authorizeAttribute processing in the generator
transform to inspect named arguments for every AuthorizeAttribute, including
those with constructor arguments. Validate all named arguments without rejecting
supported Roles or AuthenticationSchemes, and let a named Policy override the
constructor-derived policy; ensure authorization attributes beyond the first are
also processed.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 041a686a-8de0-4dec-a79b-46019acf4d0a

📥 Commits

Reviewing files that changed from the base of the PR and between a5e0904 and 04ae6f0.

📒 Files selected for processing (9)
  • src/Immediate.Apis.Generators/ImmediateApisGenerator.Models.cs
  • src/Immediate.Apis.Generators/ImmediateApisGenerator.Transform.cs
  • src/Immediate.Apis.Generators/Templates/Route.sbntxt
  • tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithMultipleAuthorizePoliciesTest_method=Delete#IA.Dummy.GetUsersQuery.g.verified.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithMultipleAuthorizePoliciesTest_method=Get#IA.Dummy.GetUsersQuery.g.verified.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithMultipleAuthorizePoliciesTest_method=Patch#IA.Dummy.GetUsersQuery.g.verified.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithMultipleAuthorizePoliciesTest_method=Post#IA.Dummy.GetUsersQuery.g.verified.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithMultipleAuthorizePoliciesTest_method=Put#IA.Dummy.GetUsersQuery.g.verified.cs

Comment thread src/Immediate.Apis.Generators/ImmediateApisGenerator.Transform.cs Outdated
@leorg99

leorg99 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

Addressed in commit 494663f:

  • Named Policy arguments are now inspected on every supported [Authorize] attribute.
  • A named Policy overrides a positional constructor policy.
  • Regression coverage now includes this mixed form.

Roles and AuthenticationSchemes remain intentionally unsupported, consistent with IAPI0002 and the library documentation, which currently support policy-based authorization only.

@leorg99

leorg99 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

Full audit follow-up in commit 7666734:

  • Updated InvalidAuthorizeAttributeAnalyzer to validate every [Authorize] attribute, not only the first.
  • Added analyzer coverage for an unsupported Roles parameter on a subsequent attribute.
  • This keeps the existing policy-only authorization contract consistent between the generator and analyzer.

Final local validation: 467 tests passed; net8.0/net9.0 changed-project builds passed; net10.0 solution build passed with 0 warnings/errors; package validation passed.

@leorg99
leorg99 force-pushed the fix/multiple-authorize-policies branch 5 times, most recently from afc8e6e to 459e13e Compare August 11, 2026 18:53
@viceroypenguin

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 459e13e2ad

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +64 to +65
var authorizeAttributes = attributes.Where(a => a.AttributeClass.IsAuthorizeAttribute).ToArray();
if (authorizeAttributes.Length is 0)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
var authorizeAttributes = attributes.Where(a => a.AttributeClass.IsAuthorizeAttribute).ToArray();
if (authorizeAttributes.Length is 0)
var authorizeAttributes = attributes.Where(a => a.AttributeClass.IsAuthorizeAttribute);
if (!authorizeAttributes.Any())

Comment on lines +52 to +56
_ = global::Microsoft.AspNetCore.Builder.AuthorizationEndpointConventionBuilderExtensions.RequireAuthorization(endpoint,{{~
for policy in method.authorize_policies
~}}{{ " " }}"{{ policy }}"{{ if !for.last }},{{ end }}{{~
end
~}});

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
_ = global::Microsoft.AspNetCore.Builder.AuthorizationEndpointConventionBuilderExtensions.RequireAuthorization(endpoint,{{~
for policy in method.authorize_policies
~}}{{ " " }}"{{ policy }}"{{ if !for.last }},{{ end }}{{~
end
~}});
_ = global::Microsoft.AspNetCore.Builder.AuthorizationEndpointConventionBuilderExtensions.RequireAuthorization(
endpoint
{{~ for policy in method.authorize_policies ~}}
, "{{ policy }}"
{{~ end ~}}
);

Comment thread src/Immediate.Apis.Generators/ImmediateApisGenerator.Transform.cs Outdated
@leorg99
leorg99 force-pushed the fix/multiple-authorize-policies branch from 459e13e to 70ab263 Compare August 12, 2026 01:16
@leorg99

leorg99 commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up after maintainer review; this supersedes my earlier implementation notes.

Addressed in 70ab263:

  • Preserved constructor-first policy precedence and used the requested pattern-matching structure.
  • Updated the analyzer to validate every [Authorize] attribute.
  • Preserved existing single-policy output while using the requested multiline format for multiple policies.

CI will validate the pushed commit.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithMultipleAuthorizePoliciesTest_method`=Get#IA.Dummy.GetUsersQuery.g.verified.cs:
- Around line 31-35: Update TransformEndpoint to emit the effective named policy
from AuthorizeAttribute.Policy when both policy arguments are specified,
preserving the expected "NamedPolicy" value instead of emitting the constructor
policy. Then regenerate the affected snapshots.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 719143cf-42d8-40a9-b540-01cb8ff6d05c

📥 Commits

Reviewing files that changed from the base of the PR and between d1a6e64 and 70ab263.

📒 Files selected for processing (10)
  • src/Immediate.Apis.Analyzers/InvalidAuthorizeAttributeAnalyzer.cs
  • src/Immediate.Apis.Generators/ImmediateApisGenerator.Transform.cs
  • src/Immediate.Apis.Generators/Templates/Route.sbntxt
  • tests/Immediate.Apis.Tests/AnalyzerTests/InvalidAuthorizeAttributeAnalyzerTests.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithMultipleAuthorizePoliciesTest_method=Delete#IA.Dummy.GetUsersQuery.g.verified.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithMultipleAuthorizePoliciesTest_method=Get#IA.Dummy.GetUsersQuery.g.verified.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithMultipleAuthorizePoliciesTest_method=Patch#IA.Dummy.GetUsersQuery.g.verified.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithMultipleAuthorizePoliciesTest_method=Post#IA.Dummy.GetUsersQuery.g.verified.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithMultipleAuthorizePoliciesTest_method=Put#IA.Dummy.GetUsersQuery.g.verified.cs
🚧 Files skipped from review as they are similar to previous changes (9)
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithMultipleAuthorizePoliciesTest_method=Post#IA.Dummy.GetUsersQuery.g.verified.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithMultipleAuthorizePoliciesTest_method=Put#IA.Dummy.GetUsersQuery.g.verified.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.cs
  • src/Immediate.Apis.Generators/Templates/Route.sbntxt
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithMultipleAuthorizePoliciesTest_method=Patch#IA.Dummy.GetUsersQuery.g.verified.cs
  • src/Immediate.Apis.Analyzers/InvalidAuthorizeAttributeAnalyzer.cs
  • tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/ApiAuthorizeTests.MapMethodWithMultipleAuthorizePoliciesTest_method=Delete#IA.Dummy.GetUsersQuery.g.verified.cs
  • src/Immediate.Apis.Generators/ImmediateApisGenerator.Transform.cs
  • tests/Immediate.Apis.Tests/AnalyzerTests/InvalidAuthorizeAttributeAnalyzerTests.cs

Comment thread src/Immediate.Apis.Generators/Templates/Route.sbntxt Outdated
viceroypenguin
viceroypenguin previously approved these changes Aug 12, 2026
@coveralls

coveralls commented Aug 12, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 31563875634

Coverage decreased (-0.04%) to 96.304%

Details

  • Coverage decreased (-0.04%) from the base build.
  • Patch coverage: 1 uncovered change across 1 file (26 of 27 lines covered, 96.3%).
  • 1 coverage regression across 1 file.

Uncovered Changes

File Changed Covered %
src/Immediate.Apis.Generators/ImmediateApisGenerator.Transform.cs 14 13 92.86%
Total (2 files) 27 26 96.3%

Coverage Regressions

1 previously-covered line in 1 file lost coverage.

File Lines Losing Coverage Coverage
src/Immediate.Apis.Analyzers/InvalidAuthorizeAttributeAnalyzer.cs 1 96.67%

Coverage Stats

Coverage Status
Relevant Lines: 1515
Covered Lines: 1459
Line Coverage: 96.3%
Coverage Strength: 3.85 hits per line

💛 - Coveralls

@viceroypenguin
viceroypenguin merged commit 8efc0a8 into ImmediatePlatform:main Aug 12, 2026
2 of 3 checks passed
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.

Multiple [Authorize] attributes only emit the first policy

3 participants