Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

OpenAPI 3.1 #1872

Closed
slinkydeveloper opened this issue Feb 17, 2021 · 11 comments
Closed

OpenAPI 3.1 #1872

slinkydeveloper opened this issue Feb 17, 2021 · 11 comments

Comments

@slinkydeveloper
Copy link
Member

OpenAPI 3.1 is out, we need to support it https://www.openapis.org/blog/2021/02/16/migrating-from-openapi-3-0-to-3-1-0

The vertx-json-schema package already supports the latest json schema Draft 2019-09, so we need to just wire it up with vertx-web-openapi

@pmlopes
Copy link
Member

pmlopes commented Apr 1, 2021

Security wise http security may use the scope list as roles required for execution. This means we need to be able to link both authentication with authorization.

While in oauth2/oidc scopes are more or less easy to handle as they are returned as part of the token exchange, for http and bearer token authentication the scope/role may be anywhere in the token which may require custom handlers.

Probably we should issue a warning during buildRouter() when http security schema is used with scopes. In that case we log as a WARNING that it's the user's responsibility to assert that the role/scope is present.

Assertion should be trivial as the user can use the authz framework and should have the knowledge which kind of authz is needed and which provider.

@pmlopes pmlopes added this to the 4.1.0 milestone Apr 1, 2021
@pmlopes
Copy link
Member

pmlopes commented Apr 16, 2021

This issue addresses the "scope" support for bearer authn: #1929
This issue ensures that chain will work with any combinations: #1930

@LouizFC
Copy link

LouizFC commented Apr 19, 2021

@pmlopes @slinkydeveloper

Greetings

Sorry about the double ping, but this is a blocking issue at one of my pet projects. Is there any issue I could help with?

@pmlopes
Copy link
Member

pmlopes commented Apr 19, 2021

@LouizFC the required changes on jwt/oauth2 are already merged to the main development branch. I'm planning to start implementing the oidc improvement discussed in: #1858

@pmlopes
Copy link
Member

pmlopes commented Apr 19, 2021

So this will implement the required changes regarding security. After this, we still need to work the remaining changes which are more now level, like the "everything is a jsonschema now".

@pmlopes
Copy link
Member

pmlopes commented Apr 22, 2021

All security related tasks have been merged. We shall now focus on the yaml/schema changes

@LouizFC
Copy link

LouizFC commented Apr 23, 2021

@pmlopes does this includes draft 2020-12 support? I think I could help with that.

Taking a brief look, vertx json schema implementation already uses a pseudo-vocabulary for OpenAPI (I took a brief look, I could be wrong), I will further investigate and see if I can help.

@pmlopes
Copy link
Member

pmlopes commented Apr 23, 2021

@LouizFC I don't think so. All json schema support is handled in another repo:

https://github.com/eclipse-vertx/vertx-json-schema

If you want to help, please checkout that code and implement a pull request for the latest spec.

@vietj vietj modified the milestones: 4.1.0, 4.1.1 Jun 1, 2021
@pmlopes
Copy link
Member

pmlopes commented Jun 25, 2021

Depends (maybe) on: eclipse-vertx/vertx-json-schema#43

@vietj vietj modified the milestones: 4.1.1, 4.2.0 Jul 2, 2021
@pmlopes pmlopes modified the milestones: 4.2.0, 4.3.0 Oct 8, 2021
@vietj vietj modified the milestones: 4.3.0, 4.3.1 May 12, 2022
@vietj vietj modified the milestones: 4.3.1, 4.3.2 May 25, 2022
@vietj vietj modified the milestones: 4.3.2, 4.3.3 Jul 6, 2022
@vietj vietj modified the milestones: 4.3.3, 4.3.4 Aug 9, 2022
@vietj vietj modified the milestones: 4.3.4, 4.3.5 Oct 1, 2022
@vietj vietj modified the milestones: 4.3.5, 4.4.0 Nov 18, 2022
@vietj vietj modified the milestones: 4.4.0, 4.4.1 Mar 2, 2023
@pmlopes
Copy link
Member

pmlopes commented Mar 29, 2023

We now have support for openapi 3.1 in the new module vertx-web-openapi-router

@pmlopes pmlopes closed this as completed Mar 29, 2023
@pmlopes pmlopes modified the milestones: 4.4.1, 5.0.0 Mar 29, 2023
@mohamnag
Copy link

mohamnag commented May 8, 2023

this is marked to be delivered in 4.4.1 and even docs say that OpenAPI 3.1 is supported, however the class io.vertx.ext.web.openapi.impl.OpenAPIHolderImpl from vertx-web-openapi still throws following exception while trying to parse a spec file with version 3.1:

ValidationException{message='provided string should respect pattern ^3\.0\.\d(-.+)?$', keyword='pattern', input=3.1.0, schema=io.vertx.json.schema.common.SchemaImpl@5aceec94, inputScope=#/openapi}
	at io.vertx.json.schema.ValidationException.create(ValidationException.java:85)
	at io.vertx.json.schema.common.PatternValidatorFactory$PatternValidator.validateSync(PatternValidatorFactory.java:55)
	at io.vertx.json.schema.common.SchemaImpl.runSyncValidator(SchemaImpl.java:193)
	at io.vertx.json.schema.common.SchemaImpl.validateSync(SchemaImpl.java:128)
	at io.vertx.json.schema.common.PropertiesValidatorFactory$PropertiesValidator.validateAsync(PropertiesValidatorFactory.java:166)
	at io.vertx.json.schema.common.SchemaImpl.runAsyncValidators(SchemaImpl.java:173)
	at io.vertx.json.schema.common.SchemaImpl.validateAsync(SchemaImpl.java:121)
	at io.vertx.json.schema.common.SchemaImpl.validateAsync(SchemaImpl.java:48)
	at io.vertx.ext.web.openapi.impl.OpenAPIHolderImpl.lambda$loadOpenAPI$2(OpenAPIHolderImpl.java:88)
	at io.vertx.core.impl.future.Composition.onSuccess(Composition.java:38)
	... 22 more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

5 participants