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

Add AuthN/AuthZ metrics #59557

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Add AuthN/AuthZ metrics #59557

wants to merge 3 commits into from

Conversation

MackinnonBuck
Copy link
Member

Add AuthN/AuthZ metrics

Adds ASP.NET Core authentication and authorization metrics.

Description

This PR adds the following metrics:

  • Authentication:
    • Authenticated request count
    • Challenge count
    • Forbid count
    • Sign in count
    • Sign out count
  • Authorization:
    • Count of requests requiring authorization

Ready to be reviewed, but the counter names, descriptions, and tags need to go through API review before this merges.

Fixes #47603

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 16 changed files in this pull request and generated 1 comment.

Files not reviewed (11)
  • src/Http/Authentication.Core/src/Microsoft.AspNetCore.Authentication.Core.csproj: Language not supported
  • src/Http/Authentication.Core/src/PublicAPI.Unshipped.txt: Language not supported
  • src/Security/Authentication/test/Microsoft.AspNetCore.Authentication.Test.csproj: Language not supported
  • src/Security/Authorization/Core/src/Microsoft.AspNetCore.Authorization.csproj: Language not supported
  • src/Security/Authorization/Core/src/PublicAPI/net10.0/PublicAPI.Unshipped.txt: Language not supported
  • src/Security/Authorization/Core/src/PublicAPI/net462/PublicAPI.Unshipped.txt: Language not supported
  • src/Security/Authorization/Core/src/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt: Language not supported
  • src/Security/Authorization/test/Microsoft.AspNetCore.Authorization.Test.csproj: Language not supported
  • src/Http/Authentication.Core/src/AuthenticationCoreServiceCollectionExtensions.cs: Evaluated as low risk
  • src/Http/Authentication.Core/src/AuthenticationMetrics.cs: Evaluated as low risk
  • src/Http/Authentication.Core/src/AuthenticationService.cs: Evaluated as low risk

Copy link
Contributor

Looks like this PR hasn't been active for some time and the codebase could have been changed in the meantime.
To make sure no conflicting changes have occurred, please rerun validation before merging. You can do this by leaving an /azp run comment here (requires commit rights), or by simply closing and reopening.

@dotnet-policy-service dotnet-policy-service bot added the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Dec 27, 2024
/// <param name="transform">The <see cref="IClaimsTransformation"/>.</param>
/// <param name="options">The <see cref="AuthenticationOptions"/>.</param>
/// <param name="services">The <see cref="IServiceProvider"/>.</param>
public AuthenticationService(
Copy link
Member

Choose a reason for hiding this comment

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

Question: How is the DI decide which constructor to use creating this service? Was it the order and it would pick the firs one? if it is, should the constructor with IServiceProvider placed first?

Copy link
Member

Choose a reason for hiding this comment

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

Longest constructor wins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-security pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate AuthN/AuthZ metrics in ASP.NET Core
4 participants