Skip to content

Commit 43f2d7c

Browse files
authored
Small fixes (#528)
1 parent 980c728 commit 43f2d7c

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
</PropertyGroup>
2828

2929
<ItemGroup>
30-
<None Include="..\..\assets\logo.64x64.png" Pack="true" PackagePath="\"/>
30+
<None Include="..\..\assets\logo.64x64.png" Pack="true" PackagePath="\" Condition="'$(IsPackable)' == 'true'" />
3131
</ItemGroup>
3232

3333
<ItemGroup>

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Provides the following packages:
3030
| GraphQL.Server.Transports.AspNetCore.NewtonsoftJson | [![Nuget](https://img.shields.io/nuget/dt/GraphQL.Server.Transports.AspNetCore.NewtonsoftJson)](https://www.nuget.org/packages/GraphQL.Server.Transports.AspNetCore.NewtonsoftJson) | [![Nuget](https://img.shields.io/nuget/v/GraphQL.Server.Transports.AspNetCore.NewtonsoftJson)](https://www.nuget.org/packages/GraphQL.Server.Transports.AspNetCore.NewtonsoftJson) |
3131
| GraphQL.Server.Transports.AspNetCore.SystemTextJson | [![Nuget](https://img.shields.io/nuget/dt/GraphQL.Server.Transports.AspNetCore.SystemTextJson)](https://www.nuget.org/packages/GraphQL.Server.Transports.AspNetCore.SystemTextJson) | [![Nuget](https://img.shields.io/nuget/v/GraphQL.Server.Transports.AspNetCore.SystemTextJson)](https://www.nuget.org/packages/GraphQL.Server.Transports.AspNetCore.SystemTextJson) |
3232
| GraphQL.Server.Transports.Subscriptions.Abstractions | [![Nuget](https://img.shields.io/nuget/dt/GraphQL.Server.Transports.Subscriptions.Abstractions)](https://www.nuget.org/packages/GraphQL.Server.Transports.Subscriptions.Abstractions) | [![Nuget](https://img.shields.io/nuget/v/GraphQL.Server.Transports.Subscriptions.Abstractions)](https://www.nuget.org/packages/GraphQL.Server.Transports.Subscriptions.Abstractions) |
33-
| GraphQL.Server.Transports.WebSockets | [![Nuget](https://img.shields.io/nuget/dt/GraphQL.Server.Transports.WebSockets)](https://www.nuget.org/packages/GraphQL.Server.Transports.WebSockets) | [![Nuget](https://img.shields.io/nuget/v/GraphQL.Server.Transports.WebSockets)](https://www.nuget.org/packages/GraphQL.Server.Transports.WebSockets) |
33+
| GraphQL.Server.Transports.Subscriptions.WebSockets | [![Nuget](https://img.shields.io/nuget/dt/GraphQL.Server.Transports.Subscriptions.WebSockets)](https://www.nuget.org/packages/GraphQL.Server.Transports.Subscriptions.WebSockets) | [![Nuget](https://img.shields.io/nuget/v/GraphQL.Server.Transports.Subscriptions.WebSockets)](https://www.nuget.org/packages/GraphQL.Server.Transports.Subscriptions.WebSockets) |
3434
| GraphQL.Server.Ui.Altair | [![Nuget](https://img.shields.io/nuget/dt/GraphQL.Server.Ui.Altair)](https://www.nuget.org/packages/GraphQL.Server.Ui.Altair) | [![Nuget](https://img.shields.io/nuget/v/GraphQL.Server.Ui.Altair)](https://www.nuget.org/packages/GraphQL.Server.Ui.Altair) |
3535
| GraphQL.Server.Ui.Playground | [![Nuget](https://img.shields.io/nuget/dt/GraphQL.Server.Ui.Playground)](https://www.nuget.org/packages/GraphQL.Server.Ui.Playground) | [![Nuget](https://img.shields.io/nuget/v/GraphQL.Server.Ui.Playground)](https://www.nuget.org/packages/GraphQL.Server.Ui.Playground) |
3636
| GraphQL.Server.Ui.GraphiQL | [![Nuget](https://img.shields.io/nuget/dt/GraphQL.Server.Ui.GraphiQL)](https://www.nuget.org/packages/GraphQL.Server.Ui.GraphiQL) | [![Nuget](https://img.shields.io/nuget/v/GraphQL.Server.Ui.GraphiQL)](https://www.nuget.org/packages/GraphQL.Server.Ui.GraphiQL) |

src/Authorization.AspNetCore/AuthorizationValidationRule.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public async Task<INodeVisitor> ValidateAsync(ValidationContext context)
3838
// it would be better to implement a filter on the Schema so it
3939
// acts as if they just don't exist vs. an auth denied error
4040
// - filtering the Schema is not currently supported
41+
// TODO: apply ISchemaFilter - context.Schema.Filter.AllowXXX
4142

4243
return new NodeVisitors(
4344
new MatchingNodeVisitor<Operation>((astType, context) =>
@@ -58,10 +59,9 @@ public async Task<INodeVisitor> ValidateAsync(ValidationContext context)
5859
new MatchingNodeVisitor<Field>((fieldAst, context) =>
5960
{
6061
var fieldDef = context.TypeInfo.GetFieldDef();
62+
6163
if (fieldDef == null)
62-
{
6364
return;
64-
}
6565

6666
// check target field
6767
AuthorizeAsync(fieldAst, fieldDef, context, operationType).GetAwaiter().GetResult(); // TODO: need to think of something to avoid this
@@ -71,9 +71,9 @@ public async Task<INodeVisitor> ValidateAsync(ValidationContext context)
7171
);
7272
}
7373

74-
private async Task AuthorizeAsync(INode node, IProvideMetadata type, ValidationContext context, OperationType? operationType)
74+
private async Task AuthorizeAsync(INode node, IProvideMetadata provider, ValidationContext context, OperationType? operationType)
7575
{
76-
var policyNames = type?.GetPolicies();
76+
var policyNames = provider?.GetPolicies();
7777

7878
if (policyNames?.Count == 1)
7979
{

src/Authorization.AspNetCore/IClaimsPrincipalAccessor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
namespace GraphQL.Server.Authorization.AspNetCore
55
{
66
/// <summary>
7-
/// Provides access to the <see cref="ClaimsPrincipal"/> used for GraphQL operation authorization
7+
/// Provides access to the <see cref="ClaimsPrincipal"/> used for GraphQL operation authorization.
88
/// </summary>
99
public interface IClaimsPrincipalAccessor
1010
{

0 commit comments

Comments
 (0)