Skip to content

[Ada] Operation security scopes are ignored when generating the server#1044

Merged
wing328 merged 2 commits intoOpenAPITools:masterfrom
stcarrez:fix-1043
Sep 20, 2018
Merged

[Ada] Operation security scopes are ignored when generating the server#1044
wing328 merged 2 commits intoOpenAPITools:masterfrom
stcarrez:fix-1043

Conversation

@stcarrez
Copy link
Copy Markdown
Contributor

@stcarrez stcarrez commented Sep 16, 2018

This fixes #1043

PR checklist

  • Read the contribution guidelines.
  • 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\.
  • Filed the PR against the correct branch: master, 3.3.x, 4.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

  • Update fromOperation() to keep the operation required scopes for each auth
    method and store that information in the x-scopes vendor extensions attribute
  • Update postProcessOperationsWithModels() to process the operation required
    scopes and build a list of authMethods which only contain the required scopes
    for the operation and store these authMethods in the x-auth-scopes attribute.
  • Update postProcessAuthMethod() to handle the logic of filtering and building
    the operation authMethod (new instances are created because we must not
    modify the global authMethod definitions)
  • Update the Ada server templates to use the x-auth-scopes instead of authMethods
    Add a URL prefix parameter for the Ada server instantiation

Linked to #1043

OpenAPITools#1043)

- Update fromOperation() to keep the operation required scopes for each auth
  method and store that information in the x-scopes vendor extensions attribute
- Update postProcessOperationsWithModels() to process the operation required
  scopes and build a list of authMethods which only contain the required scopes
  for the operation and store these authMethods in the x-auth-scopes attribute.
- Update postProcessAuthMethod() to handle the logic of filtering and building
  the operation authMethod (new instances are created because we must not
  modify the global authMethod definitions)
- Update the Ada server templates to use the x-auth-scopes instead of authMethods
  Add a URL prefix parameter for the Ada server instantiation
@wing328 wing328 added this to the 3.3.0 milestone Sep 20, 2018
@wing328 wing328 merged commit 3cacbcb into OpenAPITools:master Sep 20, 2018
jaumard pushed a commit to jaumard/openapi-generator that referenced this pull request Sep 21, 2018
…generating the server (OpenAPITools#1044)

* [Ada] Operation security scopes are ignored when generating the server (OpenAPITools#1043)
- Update fromOperation() to keep the operation required scopes for each auth
  method and store that information in the x-scopes vendor extensions attribute
- Update postProcessOperationsWithModels() to process the operation required
  scopes and build a list of authMethods which only contain the required scopes
  for the operation and store these authMethods in the x-auth-scopes attribute.
- Update postProcessAuthMethod() to handle the logic of filtering and building
  the operation authMethod (new instances are created because we must not
  modify the global authMethod definitions)
- Update the Ada server templates to use the x-auth-scopes instead of authMethods
  Add a URL prefix parameter for the Ada server instantiation

* Fix the Ada server template to use the x-auth-scopes for operation scopes
@wing328 wing328 changed the title #1043 - [Ada] Operation security scopes are ignored when generating the server [Ada] Operation security scopes are ignored when generating the server Oct 1, 2018
@wing328
Copy link
Copy Markdown
Member

wing328 commented Oct 2, 2018

@stcarrez thanks again for the fix, which is included in the v3.3.0 minor release: https://twitter.com/oas_generator/status/1046941449609068544

@ghost ghost mentioned this pull request Dec 4, 2018
A-Joshi pushed a commit to ihsmarkitoss/openapi-generator that referenced this pull request Feb 27, 2019
…generating the server (OpenAPITools#1044)

* [Ada] Operation security scopes are ignored when generating the server (OpenAPITools#1043)
- Update fromOperation() to keep the operation required scopes for each auth
  method and store that information in the x-scopes vendor extensions attribute
- Update postProcessOperationsWithModels() to process the operation required
  scopes and build a list of authMethods which only contain the required scopes
  for the operation and store these authMethods in the x-auth-scopes attribute.
- Update postProcessAuthMethod() to handle the logic of filtering and building
  the operation authMethod (new instances are created because we must not
  modify the global authMethod definitions)
- Update the Ada server templates to use the x-auth-scopes instead of authMethods
  Add a URL prefix parameter for the Ada server instantiation

* Fix the Ada server template to use the x-auth-scopes for operation scopes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Ada] Operation security scopes are ignored when generating the server

2 participants