Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[ASP.Net Core] General support to add scopes for bearer authentication #1984

Merged
merged 11 commits into from
Jun 4, 2019

Conversation

MBcom
Copy link
Contributor

@MBcom MBcom commented Jan 25, 2019

implemented authorize workflow in aspnet core too

PR checklist

  • [x ] Read the contribution guidelines.
  • [ x] Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • [x ] Filed the PR against the correct branch: master, 3.4.x, 4.0.x. Default: master.
  • [x ] Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

this PR solves #1983 and adds role/scope based security support to each route

@MBcom MBcom force-pushed the aspnetcore_bearer_scopes branch from 0137e5d to f837cdc Compare January 27, 2019 14:36
@wing328
Copy link
Member

wing328 commented Feb 18, 2019

CI (appveyor) reports the following errors:

  Exception: null
	at org.openapitools.codegen.DefaultGenerator.processOperation(DefaultGenerator.java:1079)
	at org.openapitools.codegen.DefaultGenerator.processPaths(DefaultGenerator.java:941)
	at org.openapitools.codegen.DefaultGenerator.generateApis(DefaultGenerator.java:512)
	at org.openapitools.codegen.DefaultGenerator.generate(DefaultGenerator.java:896)
	at org.openapitools.codegen.cmd.Generate.run(Generate.java:354)
	at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:61)
Caused by: java.lang.NullPointerException
	at org.openapitools.codegen.DefaultGenerator.processOperation(DefaultGenerator.java:1033)
	... 5 more
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=2g; support was removed in 8.0

Looks like we need better null check to handle the NPE.

Let me know if you need help on that.

@wing328 wing328 added this to the 4.0.0 milestone Mar 12, 2019
@wing328 wing328 modified the milestones: 4.0.0, 4.0.1 May 13, 2019
@wing328 wing328 modified the milestones: 4.0.1, 4.0.2 May 31, 2019
@wing328
Copy link
Member

wing328 commented Jun 3, 2019

Please resolve the merge conflicts if you want this PR to get merged.

@MBcom
Copy link
Contributor Author

MBcom commented Jun 4, 2019

merge conflicts resolved

@wing328 wing328 merged commit dcf3f42 into OpenAPITools:master Jun 4, 2019
@wing328 wing328 changed the title general support to add scopes for bearer auth too General support to add scopes for bearer authentication Jun 4, 2019
jimschubert added a commit to jimschubert/openapi-generator that referenced this pull request Jun 6, 2019
* master:
  [Java][okhttp-gson] Update dependencies (OpenAPITools#3103)
  Link query parameter to model object (OpenAPITools#2710)
  scala-play-server: fix enum names for reserved words (OpenAPITools#3080)
  Add @Sunn to openapi generator core team (OpenAPITools#3105)
  fix NPE in go generator (OpenAPITools#3104)
  scala-play-server: fix API doc url (OpenAPITools#3096)
  [maven-plugin] fix strictSpec parameter without alias (OpenAPITools#3095)
  Ruby: Avoid double escaping path items (OpenAPITools#3093)
  [Golang][client] Allow generating go client code as a submodule. (OpenAPITools#3012)
  [CI] Test maven plugin in Travis, move jobs from Shippable to Circle CI (OpenAPITools#3087)
  general support to add scopes for bearer auth too (OpenAPITools#1984)
  feat(java-jersey2): Making response headers case-insensitive (OpenAPITools#3072)
  [KOTLIN Spring] fix generation with modelNamePrefix/Suffix (OpenAPITools#3038)
  Mark nodejs-server as deprecated (OpenAPITools#3083)
  Use 4.0.2-SNAPSHOT version in gradle samples (OpenAPITools#3085)
@wing328 wing328 changed the title General support to add scopes for bearer authentication [ASP.Net Core] General support to add scopes for bearer authentication Jun 20, 2019
@wing328
Copy link
Member

wing328 commented Jun 20, 2019

Thanks again for the PR, which has been included in the v4.0.2 release: https://twitter.com/oas_generator/status/1141610197766426626

richardwhiuk added a commit that referenced this pull request Nov 8, 2019
…ency (#3495)

Fix Codegen Operation Scope Consistency

- Filter scopes based on operation

- Partially revert #1984 to not rely on custom attributes as to whether scopes exist

- Fix filtering global authentication schemes
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants