Skip to content

feat: allow [TraxAuthorize] on interfaces#53

Merged
Theauxm merged 1 commit intomainfrom
feat/api-auth-hardening
Apr 15, 2026
Merged

feat: allow [TraxAuthorize] on interfaces#53
Theauxm merged 1 commit intomainfrom
feat/api-auth-hardening

Conversation

@Theauxm
Copy link
Copy Markdown
Member

@Theauxm Theauxm commented Apr 15, 2026

Summary

  • Expands AttributeUsage on TraxAuthorizeAttribute from Class to Class | Interface so IServiceTrain<TIn, TOut> contract interfaces can carry authorization metadata directly.
  • Documents combinator semantics when multiple attributes are applied: policies AND'd across attributes, roles unioned + OR'd, within-attribute `Roles` a comma-separated OR list.

Why this lands first

This is a prerequisite for the Trax.Mediator PR in the same feature series. Mediator's AuthorizationRegistrationValidator and TrainDiscoveryAuthorizationTests place [TraxAuthorize] on interface-side train contracts; those tests fail to compile against the currently-published Trax.Effect.

Paired PRs

Test plan

  • dotnet build zero warnings
  • Downstream Mediator CI green once this package is published

Expands AttributeUsage on TraxAuthorizeAttribute from Class to
Class | Interface so IServiceTrain<TIn, TOut> contract interfaces can
carry authorization metadata directly. Downstream readers
(TrainDiscoveryService, AuthorizationRegistrationValidator) already
walk inheritance via GetCustomAttributes(inherit: true), so
interface-side declarations flow through to the implementation's
registration entry without further changes.

Also documents the combinator semantics when multiple attributes are
applied: policies are AND'd across attributes, roles are unioned and
OR'd, within a single attribute Roles is a comma-separated OR list.
@Theauxm Theauxm merged commit 7c57c78 into main Apr 15, 2026
1 check passed
@Theauxm Theauxm deleted the feat/api-auth-hardening branch April 15, 2026 17:17
@traxsharp
Copy link
Copy Markdown

traxsharp Bot commented Apr 15, 2026

This PR is included in version 1.32.0

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.

1 participant