Skip to content

Conversation

@sungam3r
Copy link
Member

@sungam3r sungam3r commented Sep 21, 2019

[UPDATE] See #87 first.

fixes #50
fixes #61
heap allocation optimizations
null argument checks
add comments
formatting
remove MVC from example

fixes graphql-dotnet#61
heap allocation optimizations
null argument checks
add comments
formatting
remove MVC from example
@sungam3r
Copy link
Member Author

I apologize for the big PR. I just wanted to look at this repository for a long time and finally I was able to do it. Also, I expect to support this project in the future, because my team uses it in the production.

@sungam3r sungam3r changed the title Code cleanup Code cleanup [WIP] Oct 21, 2019
@sgabler-solytic
Copy link

@sungam3r This looks really useful. If I understand the current state of this PR correctly, I should already be able to follow your improved Readme to setup authorization for my project without any breaking changes, right?

@sungam3r
Copy link
Member Author

Well, you may try. Basically, everything should work.

@iamkoch
Copy link

iamkoch commented Nov 27, 2019

First of all, thanks for raising this one. The broken README.md was starting to cause me nightmares.

One thing, though: In the README.md, the call to AddGraphQLAuth is wrong.

You have

 .AddGraphQLAuth(settings, =>

but it should be the following, including the IServiceProvider?

.AddGraphQLAuth((settings, provider) =>

@joemcbride
Copy link
Member

@iamkoch the README could say .AddTeddyBears() and it would not be wrong. That is just an example of what YOU are supposed to write in your own project. So it is whatever YOU decide it is.

@sungam3r
Copy link
Member Author

@iamkoch There are two overloads, I use overload with one parameter, but in the readme gave an example of overload with two parameters. Fixed. I updated GraphQL dependency, there were some changes in the api.

@sungam3r
Copy link
Member Author

I need to find time to get back to this PR and make sure that it is ready for merge.

Copy link
Member

@joemcbride joemcbride left a comment

Choose a reason for hiding this comment

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

As I’ve stated in other PRs, there are a ton of formatting changes that are not needed and not required. If you’re fixing bugs or adding features please do those as separate PRs so they can be independently reviewed.

@sungam3r
Copy link
Member Author

I will make small focused PRs.

@sungam3r
Copy link
Member Author

@joemcbride In general, the main thing that once stopped me from continuing to work on this PR is a similar package for authorization in the server project. I saw that they are very similar. I understand that second project uses a specific ASP.NET Core auth api. Nevertheless, there was a desire to understand both and, if possible, bring them to the same denominator. Ideally, I would like the solution when there would be no copied code at all between the two projects. Do you think it's worth the effort?

@joemcbride
Copy link
Member

@sungam3r maybe - though the intent of this project was so that it would not be ASP.NET
Core specific, so it could also be used in other non-ASP.NET projects and ASP.NET 4.5 projects. Others essentially copied what was here, made it ASP.NET specific, and added it to the server project.

@iamkoch
Copy link

iamkoch commented Nov 27, 2019 via email

@sungam3r
Copy link
Member Author

Sample code is valid and compiles. Talk about which version of the example would be better to show.

@sungam3r
Copy link
Member Author

This PR will be revised after #84

… cleanup

# Conflicts:
#	README.md
#	appveyor.yml
#	src/GraphQL.Authorization.Tests/AuthenticatedUserRequirementTests.cs
#	src/GraphQL.Authorization.Tests/AuthorizationEvaluatorTests.cs
#	src/GraphQL.Authorization.Tests/AuthorizationSchemaBuilderTests.cs
#	src/GraphQL.Authorization.Tests/AuthorizationSettingsTests.cs
#	src/GraphQL.Authorization.Tests/AuthorizationValidationRuleTests.cs
#	src/GraphQL.Authorization.Tests/ClaimAuthorizationRequirementTests.cs
#	src/GraphQL.Authorization.Tests/GraphQL.Authorization.Tests.csproj
#	src/GraphQL.Authorization.Tests/ValidationTestBase.cs
#	src/GraphQL.Authorization.sln
#	src/GraphQL.Authorization/AuthorizationEvaluator.cs
#	src/GraphQL.Authorization/AuthorizationMetadataExtensions.cs
#	src/GraphQL.Authorization/AuthorizationPolicyBuilder.cs
#	src/GraphQL.Authorization/AuthorizationValidationRule.cs
#	src/GraphQL.Authorization/GraphQL.Authorization.csproj
#	src/GraphQL.Authorization/Requirements/ClaimAuthorizationRequirement.cs
#	src/Harness/GraphQLAuthExtensions.cs
#	src/Harness/Harness.csproj
#	src/Harness/Program.cs
#	src/Harness/Properties/launchSettings.json
#	src/Harness/Startup.cs
@sungam3r sungam3r mentioned this pull request Nov 1, 2020
… cleanup

# Conflicts:
#	src/GraphQL.Authorization.Tests/AuthorizationEvaluatorTests.cs
#	src/GraphQL.Authorization/AuthorizationPolicy.cs
#	src/GraphQL.Authorization/AuthorizationPolicyBuilder.cs
#	src/GraphQL.Authorization/AuthorizationResult.cs
#	src/GraphQL.Authorization/AuthorizationSettings.cs
#	src/GraphQL.Authorization/IAuthorizationPolicy.cs
#	src/GraphQL.Authorization/IProvideClaimsPrincipal.cs
#	src/GraphQL.Authorization/Requirements/ClaimAuthorizationRequirement.cs
#	src/GraphQL.Authorization/Requirements/IAuthorizationRequirement.cs
… cleanup

# Conflicts:
#	src/GraphQL.Authorization.ApiTests/GraphQL.Authorization.approved.txt
#	src/GraphQL.Authorization.Tests/AuthenticatedUserRequirementTests.cs
#	src/GraphQL.Authorization.Tests/AuthorizationSchemaBuilderTests.cs
#	src/GraphQL.Authorization.Tests/AuthorizationValidationRuleTests.cs
#	src/GraphQL.Authorization/AuthorizationContext.cs
#	src/GraphQL.Authorization/AuthorizationEvaluator.cs
#	src/GraphQL.Authorization/AuthorizationMetadataExtensions.cs
#	src/GraphQL.Authorization/AuthorizationSettings.cs
… cleanup

# Conflicts:
#	README.md
#	src/GraphQL.Authorization.ApiTests/GraphQL.Authorization.approved.txt
#	src/GraphQL.Authorization/AuthorizationContext.cs
#	src/GraphQL.Authorization/AuthorizationEvaluator.cs
#	src/GraphQL.Authorization/AuthorizationSettings.cs
#	src/GraphQL.Authorization/IAuthorizationEvaluator.cs
#	src/Harness/GraphQL.cs
@sungam3r sungam3r requested a review from Shane32 March 22, 2021 08:41
@sungam3r sungam3r changed the title Code cleanup [WIP] Code cleanup Mar 22, 2021
@sungam3r
Copy link
Member Author

@Shane32 Meet our old friend here
изображение

@sungam3r sungam3r changed the title Code cleanup Small code/readme cleanup + CI fix Mar 22, 2021
@sungam3r sungam3r added this to the 4.0 milestone Mar 22, 2021
@sungam3r sungam3r self-assigned this Mar 22, 2021
@sungam3r
Copy link
Member Author

Regarding labeler: graphql-dotnet/graphql-dotnet#2439

@sungam3r sungam3r added documentation enhancement New feature or request labels Mar 22, 2021
@sungam3r sungam3r merged commit 46eaa4c into graphql-dotnet:master Mar 22, 2021
@sungam3r sungam3r deleted the cleanup branch March 22, 2021 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NullReferenceException in AuthorizationValidationRule when query/mutation/parameter name is invalid Code in ReadMe Doesn't Compile

5 participants