Skip to content
This repository was archived by the owner on Dec 24, 2020. It is now read-only.

Commit 12bc12d

Browse files
committed
Adhere to the ASP.NET team coding style guidelines
1 parent 9a6a0eb commit 12bc12d

50 files changed

Lines changed: 1332 additions & 667 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ AspNet.Security.OAuth.Extensions
1111
## Get started
1212

1313
```csharp
14-
app.UseOAuthValidation(options => {
14+
app.UseOAuthValidation(options =>
15+
{
1516
options.Audiences.Add("resource_server");
1617
});
1718
```
1819

1920
```csharp
20-
app.UseOAuthIntrospection(options => {
21+
app.UseOAuthIntrospection(options =>
22+
{
2123
options.AutomaticAuthenticate = true;
2224
options.AutomaticChallenge = true;
2325
options.Audiences.Add("resource_server");

src/AspNet.Security.OAuth.Introspection/Events/CreateTicketContext.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,20 @@
1010
using Microsoft.AspNetCore.Http;
1111
using Newtonsoft.Json.Linq;
1212

13-
namespace AspNet.Security.OAuth.Introspection {
13+
namespace AspNet.Security.OAuth.Introspection
14+
{
1415
/// <summary>
1516
/// Allows interception of the AuthenticationTicket creation process.
1617
/// </summary>
17-
public class CreateTicketContext : BaseControlContext {
18+
public class CreateTicketContext : BaseControlContext
19+
{
1820
public CreateTicketContext(
1921
[NotNull] HttpContext context,
2022
[NotNull] OAuthIntrospectionOptions options,
2123
[NotNull] AuthenticationTicket ticket,
2224
[NotNull] JObject payload)
23-
: base(context) {
25+
: base(context)
26+
{
2427
Options = options;
2528
Ticket = ticket;
2629
Payload = payload;

src/AspNet.Security.OAuth.Introspection/Events/RequestTokenIntrospectionContext.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,20 @@
99
using Microsoft.AspNetCore.Authentication;
1010
using Microsoft.AspNetCore.Http;
1111

12-
namespace AspNet.Security.OAuth.Introspection {
12+
namespace AspNet.Security.OAuth.Introspection
13+
{
1314
/// <summary>
1415
/// Allows for custom handling of the call to the Authorization Server's Introspection endpoint.
1516
/// </summary>
16-
public class RequestTokenIntrospectionContext : BaseContext {
17+
public class RequestTokenIntrospectionContext : BaseContext
18+
{
1719
public RequestTokenIntrospectionContext(
1820
[NotNull] HttpContext context,
1921
[NotNull] OAuthIntrospectionOptions options,
2022
[NotNull] HttpRequestMessage message,
2123
[NotNull] string token)
22-
: base(context) {
24+
: base(context)
25+
{
2326
Options = options;
2427
Message = message;
2528
Token = token;

src/AspNet.Security.OAuth.Introspection/Events/RetrieveTokenContext.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,18 @@
88
using Microsoft.AspNetCore.Authentication;
99
using Microsoft.AspNetCore.Http;
1010

11-
namespace AspNet.Security.OAuth.Introspection {
11+
namespace AspNet.Security.OAuth.Introspection
12+
{
1213
/// <summary>
1314
/// Allows custom parsing of access tokens from requests.
1415
/// </summary>
15-
public class RetrieveTokenContext : BaseControlContext {
16+
public class RetrieveTokenContext : BaseControlContext
17+
{
1618
public RetrieveTokenContext(
1719
[NotNull] HttpContext context,
1820
[NotNull] OAuthIntrospectionOptions options)
19-
: base(context) {
21+
: base(context)
22+
{
2023
Options = options;
2124
}
2225

src/AspNet.Security.OAuth.Introspection/Events/ValidateTokenContext.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,19 @@
88
using Microsoft.AspNetCore.Authentication;
99
using Microsoft.AspNetCore.Http;
1010

11-
namespace AspNet.Security.OAuth.Introspection {
11+
namespace AspNet.Security.OAuth.Introspection
12+
{
1213
/// <summary>
1314
/// Allows customization of the token validation logic.
1415
/// </summary>
15-
public class ValidateTokenContext : BaseControlContext {
16+
public class ValidateTokenContext : BaseControlContext
17+
{
1618
public ValidateTokenContext(
1719
[NotNull] HttpContext context,
1820
[NotNull] OAuthIntrospectionOptions options,
1921
[NotNull] AuthenticationTicket ticket)
20-
: base(context) {
22+
: base(context)
23+
{
2124
Options = options;
2225
Ticket = ticket;
2326
}

src/AspNet.Security.OAuth.Introspection/OAuthIntrospectionConstants.cs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44
* concerning the license and the contributors participating to this project.
55
*/
66

7-
namespace AspNet.Security.OAuth.Introspection {
8-
public static class OAuthIntrospectionConstants {
9-
public static class Claims {
7+
namespace AspNet.Security.OAuth.Introspection
8+
{
9+
public static class OAuthIntrospectionConstants
10+
{
11+
public static class Claims
12+
{
1013
public const string Active = "active";
1114
public const string Audience = "aud";
1215
public const string ExpiresAt = "exp";
@@ -19,23 +22,27 @@ public static class Claims {
1922
public const string Username = "username";
2023
}
2124

22-
public static class Metadata {
25+
public static class Metadata
26+
{
2327
public const string IntrospectionEndpoint = "introspection_endpoint";
2428
}
2529

26-
public static class Parameters {
30+
public static class Parameters
31+
{
2732
public const string Token = "token";
2833
public const string TokenTypeHint = "token_type_hint";
2934
}
3035

31-
public static class Properties {
36+
public static class Properties
37+
{
3238
public const string Audiences = ".audiences";
3339
public const string Scopes = ".scopes";
3440
public const string TicketId = ".ticket_id";
3541
public const string Token = "access_token";
3642
}
3743

38-
public static class TokenTypes {
44+
public static class TokenTypes
45+
{
3946
public const string AccessToken = "access_token";
4047
}
4148
}

src/AspNet.Security.OAuth.Introspection/OAuthIntrospectionDefaults.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
* concerning the license and the contributors participating to this project.
55
*/
66

7-
namespace AspNet.Security.OAuth.Introspection {
8-
public static class OAuthIntrospectionDefaults {
7+
namespace AspNet.Security.OAuth.Introspection
8+
{
9+
public static class OAuthIntrospectionDefaults
10+
{
911
/// <summary>
1012
/// Gets the default scheme used by the introspection middleware.
1113
/// </summary>

src/AspNet.Security.OAuth.Introspection/OAuthIntrospectionEvents.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@
77
using System;
88
using System.Threading.Tasks;
99

10-
namespace AspNet.Security.OAuth.Introspection {
10+
namespace AspNet.Security.OAuth.Introspection
11+
{
1112
/// <summary>
1213
/// Allows customization of introspection handling within the middleware.
1314
/// </summary>
14-
public class OAuthIntrospectionEvents {
15+
public class OAuthIntrospectionEvents
16+
{
1517
/// <summary>
1618
/// Invoked when a ticket is to be created from an introspection response.
1719
/// </summary>

src/AspNet.Security.OAuth.Introspection/OAuthIntrospectionExtensions.cs

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@
99
using JetBrains.Annotations;
1010
using Microsoft.Extensions.Options;
1111

12-
namespace Microsoft.AspNetCore.Builder {
12+
namespace Microsoft.AspNetCore.Builder
13+
{
1314
/// <summary>
1415
/// Provides extension methods used to configure the OAuth2
1516
/// introspection middleware in an ASP.NET 5 pipeline.
1617
/// </summary>
17-
public static class OAuthIntrospectionExtensions {
18+
public static class OAuthIntrospectionExtensions
19+
{
1820
/// <summary>
1921
/// Adds a new instance of the OAuth2 introspection middleware in the ASP.NET 5 pipeline.
2022
/// </summary>
@@ -23,12 +25,15 @@ public static class OAuthIntrospectionExtensions {
2325
/// <returns>The application builder.</returns>
2426
public static IApplicationBuilder UseOAuthIntrospection(
2527
[NotNull] this IApplicationBuilder app,
26-
[NotNull] Action<OAuthIntrospectionOptions> configuration) {
27-
if (app == null) {
28+
[NotNull] Action<OAuthIntrospectionOptions> configuration)
29+
{
30+
if (app == null)
31+
{
2832
throw new ArgumentNullException(nameof(app));
2933
}
3034

31-
if (configuration == null) {
35+
if (configuration == null)
36+
{
3237
throw new ArgumentNullException(nameof(configuration));
3338
}
3439

@@ -46,12 +51,15 @@ public static IApplicationBuilder UseOAuthIntrospection(
4651
/// <returns>The application builder.</returns>
4752
public static IApplicationBuilder UseOAuthIntrospection(
4853
[NotNull] this IApplicationBuilder app,
49-
[NotNull] OAuthIntrospectionOptions options) {
50-
if (app == null) {
54+
[NotNull] OAuthIntrospectionOptions options)
55+
{
56+
if (app == null)
57+
{
5158
throw new ArgumentNullException(nameof(app));
5259
}
5360

54-
if (options == null) {
61+
if (options == null)
62+
{
5563
throw new ArgumentNullException(nameof(options));
5664
}
5765

0 commit comments

Comments
 (0)