Skip to content

Commit c628237

Browse files
authored
Rename AddAuthorization to AddAuthorizationRule (#860)
1 parent c8dc242 commit c628237

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

samples/Samples.Authorization/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
builder.Services.AddGraphQL(b => b
3232
.AddAutoSchema<Query>()
3333
.AddSystemTextJson()
34-
.AddAuthorization());
34+
.AddAuthorizationRule());
3535
// ------------------------------------
3636

3737
var app = builder.Build();

src/Transports.AspNetCore/Extensions/GraphQLBuilderExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public static IGraphQLBuilder AddWebSocketAuthentication(this IGraphQLBuilder bu
134134
/// Registers <see cref="AuthorizationValidationRule"/> with the dependency injection framework
135135
/// and configures it to be used when executing a request.
136136
/// </summary>
137-
public static IGraphQLBuilder AddAuthorization(this IGraphQLBuilder builder)
137+
public static IGraphQLBuilder AddAuthorizationRule(this IGraphQLBuilder builder)
138138
{
139139
builder.AddValidationRule<AuthorizationValidationRule>(true);
140140
builder.Services.TryRegister<IHttpContextAccessor, HttpContextAccessor>(DI.ServiceLifetime.Singleton);

tests/ApiApprovalTests/net5+netcoreapp31/GraphQL.Server.Transports.AspNetCore.approved.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ namespace GraphQL
360360
{
361361
public static class ServerGraphQLBuilderExtensions
362362
{
363-
public static GraphQL.DI.IGraphQLBuilder AddAuthorization(this GraphQL.DI.IGraphQLBuilder builder) { }
363+
public static GraphQL.DI.IGraphQLBuilder AddAuthorizationRule(this GraphQL.DI.IGraphQLBuilder builder) { }
364364
public static GraphQL.DI.IGraphQLBuilder AddUserContextBuilder<TUserContextBuilder>(this GraphQL.DI.IGraphQLBuilder builder)
365365
where TUserContextBuilder : class, GraphQL.Server.Transports.AspNetCore.IUserContextBuilder { }
366366
public static GraphQL.DI.IGraphQLBuilder AddUserContextBuilder<TUserContext>(this GraphQL.DI.IGraphQLBuilder builder, System.Func<Microsoft.AspNetCore.Http.HttpContext, System.Threading.Tasks.Task<TUserContext>> creator)

tests/ApiApprovalTests/netcoreapp21+netstandard20/GraphQL.Server.Transports.AspNetCore.approved.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ namespace GraphQL
378378
{
379379
public static class ServerGraphQLBuilderExtensions
380380
{
381-
public static GraphQL.DI.IGraphQLBuilder AddAuthorization(this GraphQL.DI.IGraphQLBuilder builder) { }
381+
public static GraphQL.DI.IGraphQLBuilder AddAuthorizationRule(this GraphQL.DI.IGraphQLBuilder builder) { }
382382
public static GraphQL.DI.IGraphQLBuilder AddUserContextBuilder<TUserContextBuilder>(this GraphQL.DI.IGraphQLBuilder builder)
383383
where TUserContextBuilder : class, GraphQL.Server.Transports.AspNetCore.IUserContextBuilder { }
384384
public static GraphQL.DI.IGraphQLBuilder AddUserContextBuilder<TUserContext>(this GraphQL.DI.IGraphQLBuilder builder, System.Func<Microsoft.AspNetCore.Http.HttpContext, System.Threading.Tasks.Task<TUserContext>> creator)

tests/Transports.AspNetCore.Tests/AuthorizationTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ public async Task TestPipeline(bool authenticated)
708708
services.AddGraphQL(b => b
709709
.AddSchema(_schema)
710710
.AddSystemTextJson()
711-
.AddAuthorization());
711+
.AddAuthorizationRule());
712712

713713
services.AddSingleton(Mock.Of<IAuthorizationService>(MockBehavior.Strict));
714714

0 commit comments

Comments
 (0)