You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Based off discussion in the spec in here and the Use Multiple Authentication Types section, I should be able to reuse authMethods in the security section of my path.
components:
securitySchemes:
myAuth:
type: oauth2flows:
authorizationCode:
scopes:
read: ability to readwrite: ability to writepet: ability on petpaths:
/petsget:
summary: get petssecurity:
- myAuth: [ read, pet ]
- myAuth: [ write, pet ] # if you can update we'll let you read too
Command line used for generation
The investigation has lead me to the generator, but I was reproducing this off of tests in SpringCodegenTest
Steps to reproduce
define oauth2 scopes in security schemes
use the same securityScheme on an api (with different scopes)
Eval the spring code generator
notice how we lose reference in the swagger annotations
the loops blindly put auth methods into the authMethods map by name even if the key exists. Maybe we need to consider accumulating collisions in the value and then iterate later in generation.
Would love feedback on this since I am not sure of all the consideration it takes to make a deep generator change like this. I doubt the List<CodegenSecurity> authMethods in CodegenOperation will be able to represent the ORs, and I would like to add a new field that houses the actual auth requirements on a method.
Activity
nhomble commentedon Jul 4, 2020
Would love feedback on this since I am not sure of all the consideration it takes to make a deep generator change like this. I doubt the
List<CodegenSecurity> authMethodsinCodegenOperationwill be able to represent the ORs, and I would like to add a new field that houses the actual auth requirements on a method.bilak commentedon Oct 16, 2020
Would you be able to work on this? I can see that you also prepared MR for spring security so I'd be glad to help you with this if possible.