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
The generated OpenAPI spec is missing the securityDefinitions section that defines which security mechanisms the API supports (e.g. OAuth, HTTP Basic, etc).
This means clients generated from it using tools like Swagger Codegen lack security context and only work with endpoints that do not require auth.
@liggitt I think the cleanest change would be to update DefaultOpenAPIConfig to extract info from masterConfig to build the SecurityDefinitions. I believe we would want (assuming OpenAPI supports all of these):
Looking at existing securityDefitions examples in the code, it looks like Oauth is considered a Bearertoken and rthere is no differentiation between that ans ServiceAccount tokens ...
Also I could not find any example of x509 auth defintions ...
@simo5 does swagger differentiate between random noise tokens and JWTs? I believe they use the same header. I would assume you need to look at the swagger specification to determine how to represent tokens, certs, etc.
Swagger (and code in origin) does not differentiate between JWT and other Bearer tokens.
I couldn't find any example of swagger representing a x509 authentication, so I am kinda blocked on that one.
I will open a WIP PR in a moment to start reasoning on this with some code at hand.
Activity
enj commentedon May 30, 2017
@liggitt I think the cleanest change would be to update DefaultOpenAPIConfig to extract info from
masterConfigto build theSecurityDefinitions. I believe we would want (assuming OpenAPI supports all of these):WDYT?
simo5 commentedon Jun 16, 2017
Looking at existing securityDefitions examples in the code, it looks like Oauth is considered a Bearertoken and rthere is no differentiation between that ans ServiceAccount tokens ...
Also I could not find any example of x509 auth defintions ...
enj commentedon Jun 17, 2017
@simo5 does swagger differentiate between random noise tokens and JWTs? I believe they use the same header. I would assume you need to look at the swagger specification to determine how to represent tokens, certs, etc.
simo5 commentedon Jun 19, 2017
Swagger (and code in origin) does not differentiate between JWT and other Bearer tokens.
I couldn't find any example of swagger representing a x509 authentication, so I am kinda blocked on that one.
I will open a WIP PR in a moment to start reasoning on this with some code at hand.