├── vertx-web ├── tests │ ├── .gitignore │ └── sockjs │ │ ├── .babelrc │ │ └── package.json ├── src │ ├── test │ │ ├── resources │ │ │ ├── webroot │ │ │ │ ├── a │ │ │ │ │ └── b │ │ │ │ │ │ └── test.txt │ │ │ │ ├── foo.json │ │ │ │ ├── index.html │ │ │ │ ├── somedir2 │ │ │ │ │ ├── foo2.json │ │ │ │ │ ├── somepage.html │ │ │ │ │ └── somepage2.html │ │ │ │ ├── .hidden.html │ │ │ │ ├── otherpage.html │ │ │ │ ├── somedir │ │ │ │ │ ├── .hidden.html │ │ │ │ │ ├── something.html │ │ │ │ │ ├── index.html │ │ │ │ │ ├── otherpage.html │ │ │ │ │ ├── range.bin │ │ │ │ │ ├── range.jpeg │ │ │ │ │ └── range.jpg │ │ │ │ ├── somedir3 │ │ │ │ │ ├── style.css │ │ │ │ │ ├── coin.png │ │ │ │ │ └── testLinkPreload.html │ │ │ │ ├── file with spaces.html │ │ │ │ ├── swaggerui │ │ │ │ │ └── index.html │ │ │ │ └── testCompressionSuffix.html │ │ │ ├── nasty │ │ │ │ └── index.html │ │ │ │ │ └── index.html │ │ │ ├── .htdigest │ │ │ ├── test-error-template.html │ │ │ ├── templates │ │ │ │ ├── index.ftl │ │ │ │ └── sub │ │ │ │ │ └── index.ftl │ │ │ ├── favicon.ico │ │ │ ├── keystore.jceks │ │ │ ├── somedir │ │ │ │ └── test-template.html │ │ │ ├── custom_dir_template.html │ │ │ ├── login │ │ │ │ ├── loginusers.properties │ │ │ │ └── login.html │ │ │ └── vertx-default-jul-logging.properties │ │ ├── sockjs-protocol │ │ │ ├── unittest2 │ │ │ │ ├── test │ │ │ │ │ ├── dummy.py │ │ │ │ │ ├── __init__.py │ │ │ │ │ └── test_unittest2_with.py │ │ │ │ ├── collector.py │ │ │ │ └── __main__.py │ │ │ ├── linecache2 │ │ │ │ └── tests │ │ │ │ │ ├── __init__.py │ │ │ │ │ └── inspect_fodder.py │ │ │ ├── traceback2 │ │ │ │ └── tests │ │ │ │ │ └── __init__.py │ │ │ ├── websocket │ │ │ │ ├── tests │ │ │ │ │ ├── __init__.py │ │ │ │ │ └── data │ │ │ │ │ │ ├── header02.txt │ │ │ │ │ │ └── header01.txt │ │ │ │ └── __init__.py │ │ │ └── ws4py │ │ │ │ ├── server │ │ │ │ └── __init__.py │ │ │ │ ├── exc.py │ │ │ │ └── compat.py │ │ ├── filesystemwebroot │ │ │ ├── fspage.html │ │ │ └── file with spaces2.html │ │ ├── pythonversion.py │ │ └── java │ │ │ └── io │ │ │ └── vertx │ │ │ └── ext │ │ │ └── web │ │ │ ├── handler │ │ │ └── AuthWithSessionsTest.java │ │ │ ├── impl │ │ │ └── ParsableHeaderValueTest.java │ │ │ └── LRUCacheTest.java │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ ├── MANIFEST.MF │ │ │ └── vertx │ │ │ └── web │ │ │ └── favicon.ico │ │ ├── java │ │ ├── examples │ │ │ └── package-info.java │ │ └── io │ │ │ └── vertx │ │ │ └── ext │ │ │ └── web │ │ │ ├── package-info.java │ │ │ ├── impl │ │ │ └── UserContextInternal.java │ │ │ ├── handler │ │ │ ├── impl │ │ │ │ └── NOOPAuthenticationProvider.java │ │ │ ├── PlatformHandler.java │ │ │ ├── SecurityPolicyHandler.java │ │ │ ├── ProtocolUpgradeHandler.java │ │ │ ├── AuthenticationHandler.java │ │ │ └── ResponseTimeHandler.java │ │ │ ├── MIMEHeader.java │ │ │ └── sstore │ │ │ └── impl │ │ │ └── SessionInternal.java │ │ └── assembly │ │ └── docs.xml ├── stop-sockjs-write-handler-tests-server.sh └── start-sockjs-write-handler-tests-server.sh ├── vertx-web-graphql ├── tests │ ├── .gitignore │ ├── apollo │ │ ├── .babelrc │ │ └── package.json │ └── graphql-ws │ │ ├── .babelrc │ │ └── package.json ├── vertx-web-graphiql │ ├── .env │ ├── src │ │ ├── index.css │ │ └── index.js │ ├── build.sh │ ├── build.bat │ ├── README.adoc │ ├── .gitignore │ ├── public │ │ └── index.html │ ├── package.json │ └── copy-to-resources.js ├── src │ ├── test │ │ ├── resources │ │ │ ├── locale.graphqls │ │ │ ├── emptyQuery.graphqls │ │ │ ├── hello.graphqls │ │ │ ├── upload.graphqls │ │ │ ├── counter.graphqls │ │ │ ├── links.graphqls │ │ │ ├── borders.graphqls │ │ │ ├── types.graphqls │ │ │ ├── singleUpload.txt │ │ │ ├── multipleUpload.txt │ │ │ └── batchUpload.txt │ │ └── java │ │ │ └── io │ │ │ └── vertx │ │ │ └── ext │ │ │ └── web │ │ │ └── handler │ │ │ └── graphql │ │ │ ├── User.java │ │ │ └── UnsupportedMethodTest.java │ └── main │ │ ├── resources │ │ ├── META-INF │ │ │ └── MANIFEST.MF │ │ └── io │ │ │ └── vertx │ │ │ └── ext │ │ │ └── web │ │ │ └── handler │ │ │ └── graphiql │ │ │ ├── index.html │ │ │ └── static │ │ │ └── js │ │ │ └── 842.e96bbe62.chunk.js │ │ ├── asciidoc │ │ └── enums.adoc │ │ └── java │ │ ├── io │ │ └── vertx │ │ │ └── ext │ │ │ └── web │ │ │ └── handler │ │ │ └── graphql │ │ │ ├── ApolloWSConnectionInitEvent.java │ │ │ ├── package-info.java │ │ │ ├── TriConsumer.java │ │ │ └── ws │ │ │ └── ConnectionInitEvent.java │ │ └── examples │ │ └── package-info.java ├── stop-apollo-tests-server.sh ├── stop-graphql-ws-tests-server.sh ├── start-apollo-tests-server.sh └── start-graphql-ws-tests-server.sh ├── vertx-web-client └── src │ ├── main │ ├── asciidoc │ │ ├── override │ │ │ └── rxjava2.adoc │ │ └── enums.adoc │ ├── resources │ │ └── META-INF │ │ │ └── MANIFEST.MF │ └── java │ │ ├── examples │ │ ├── package-info.java │ │ └── WebClientSessionExamples.java │ │ └── io │ │ └── vertx │ │ └── ext │ │ └── web │ │ └── client │ │ └── package-info.java │ └── test │ └── java │ └── io │ └── vertx │ └── ext │ └── web │ └── client │ ├── SharedWebClientTest.java │ └── jackson │ └── WineAndCheese.java ├── vertx-web-openapi └── src │ ├── test │ ├── resources │ │ ├── random.txt │ │ ├── random.csv │ │ ├── specs │ │ │ ├── test_json │ │ │ │ └── schemas_test │ │ │ │ │ ├── test14_fail.json │ │ │ │ │ ├── test14_ok.json │ │ │ │ │ ├── test13_ok_request.json │ │ │ │ │ ├── test15_ok_1.json │ │ │ │ │ ├── test15_ok_2.json │ │ │ │ │ ├── test15_fail.json │ │ │ │ │ ├── test13_ok_response.json │ │ │ │ │ ├── test1_fail_1.json │ │ │ │ │ ├── test2_fail_2.json │ │ │ │ │ ├── test5_ok_2.json │ │ │ │ │ ├── test1_fail_2.json │ │ │ │ │ ├── test1_ok.json │ │ │ │ │ ├── test2_fail_3.json │ │ │ │ │ ├── test2_fail_1.json │ │ │ │ │ ├── test5_fail.json │ │ │ │ │ ├── test5_ok_1.json │ │ │ │ │ ├── test2_ok.json │ │ │ │ │ ├── test8_fail_1.json │ │ │ │ │ ├── test8_fail_2.json │ │ │ │ │ ├── test7_fail_1.json │ │ │ │ │ ├── test16_fail.json │ │ │ │ │ ├── test16_ok.json │ │ │ │ │ ├── testLocalRelativeRef_ok.json │ │ │ │ │ ├── testLocalRelativeRef_fail.json │ │ │ │ │ ├── test12_ok.json │ │ │ │ │ ├── test12_fail.json │ │ │ │ │ ├── test7_ok_1.json │ │ │ │ │ ├── test7_fail_2.json │ │ │ │ │ ├── test10_fail.json │ │ │ │ │ ├── test10_ok.json │ │ │ │ │ ├── test7_ok_2.json │ │ │ │ │ ├── test8_ok.json │ │ │ │ │ ├── test6_fail.json │ │ │ │ │ ├── test6_ok.json │ │ │ │ │ └── test9_fail.json │ │ │ ├── schemas │ │ │ │ ├── Card_id.yaml │ │ │ │ ├── Person.yaml │ │ │ │ ├── tree.yaml │ │ │ │ ├── geo.json │ │ │ │ └── address.json │ │ │ ├── security_optional_test.yaml │ │ │ ├── test_order_spec.yaml │ │ │ ├── upload_test.yaml │ │ │ ├── security_scopes_test.yaml │ │ │ └── shared_request_body.yaml │ │ ├── yaml │ │ │ ├── invalid │ │ │ │ ├── refs │ │ │ │ │ ├── fileName.json │ │ │ │ │ └── Simple.yaml │ │ │ │ ├── local_refs.yaml │ │ │ │ ├── simple_spec.yaml │ │ │ │ └── inner_refs.yaml │ │ │ └── valid │ │ │ │ ├── refs │ │ │ │ ├── fileName.json │ │ │ │ ├── Simple.yaml │ │ │ │ └── Circular.yaml │ │ │ │ ├── local_circular_refs.yaml │ │ │ │ ├── local_refs.yaml │ │ │ │ ├── simple_spec.yaml │ │ │ │ └── inner_refs.yaml │ │ ├── random-file │ │ ├── jars │ │ │ ├── refs.jar │ │ │ └── specs.jar │ │ └── local_refs_in_jar.yaml │ └── java │ │ └── io │ │ └── vertx │ │ └── ext │ │ └── web │ │ └── openapi │ │ ├── it │ │ ├── models │ │ │ └── package-info.java │ │ ├── services │ │ │ └── package-info.java │ │ └── persistence │ │ │ └── TransactionPersistence.java │ │ ├── service │ │ ├── package-info.java │ │ ├── PathExtensionTestService.java │ │ ├── TestService.java │ │ ├── PathExtensionTestServiceImpl.java │ │ └── AnotherTestService.java │ │ ├── asserts │ │ ├── MyAssertions.java │ │ └── JsonAssert.java │ │ ├── RouteBuilderTest.java │ │ └── impl │ │ └── OpenAPI3UtilsTest.java │ └── main │ ├── resources │ └── META-INF │ │ └── MANIFEST.MF │ └── java │ └── io │ └── vertx │ └── ext │ └── web │ └── openapi │ ├── package-info.java │ ├── impl │ ├── BodyProcessorGenerator.java │ ├── SchemaHolder.java │ ├── ParameterProcessorGenerator.java │ ├── OpenAPIYamlConstructor.java │ ├── JsonBodyProcessorGenerator.java │ └── JsonPointerIteratorWithLoader.java │ ├── RouteNamingStrategy.java │ └── OpenAPIHolder.java ├── vertx-web-validation └── src │ ├── test │ └── resources │ │ ├── myfile.txt │ │ ├── int_schema.json │ │ └── tree_schema.json │ └── main │ ├── resources │ └── META-INF │ │ └── MANIFEST.MF │ ├── java │ └── io │ │ └── vertx │ │ └── ext │ │ └── web │ │ └── validation │ │ ├── package-info.java │ │ ├── RequestPredicateException.java │ │ ├── impl │ │ ├── body │ │ │ ├── BodyProcessor.java │ │ │ └── FormValueParser.java │ │ ├── parser │ │ │ ├── ArrayParser.java │ │ │ ├── SplitterCharArrayParser.java │ │ │ ├── SplitterCharTupleParser.java │ │ │ └── TupleParser.java │ │ ├── ParameterLocation.java │ │ ├── parameter │ │ │ ├── ParameterParser.java │ │ │ └── ParameterProcessor.java │ │ ├── validator │ │ │ └── ValueValidator.java │ │ └── RequestPredicateResultImpl.java │ │ ├── MalformedValueException.java │ │ ├── builder │ │ ├── BodyProcessorFactory.java │ │ ├── ArrayParserFactory.java │ │ ├── TupleParserFactory.java │ │ ├── StyledParameterProcessorFactory.java │ │ ├── ObjectParserFactory.java │ │ ├── ParameterProcessorFactory.java │ │ └── Parsers.java │ │ └── RequestPredicateResult.java │ └── asciidoc │ └── enums.adoc ├── vertx-template-engines ├── vertx-web-templ-pebble │ ├── .gitignore │ └── src │ │ ├── test │ │ ├── resources │ │ │ ├── messages_en_US.properties │ │ │ ├── messages_de_DE.properties │ │ │ └── somedir │ │ │ │ ├── test-pebble-template2.foo │ │ │ │ ├── test-pebble-template2.beb │ │ │ │ └── test-pebble-template2.peb │ │ ├── filesystemtemplates │ │ │ ├── parts │ │ │ │ ├── include.peb │ │ │ │ └── parent.peb │ │ │ ├── test-pebble-template-i18n.peb │ │ │ ├── test-pebble-template3.peb │ │ │ ├── test-pebble-template5.peb │ │ │ ├── test-pebble-complex.peb │ │ │ └── test-pebble-template6.peb │ │ └── java │ │ │ └── io │ │ │ └── vertx │ │ │ └── ext │ │ │ └── web │ │ │ └── templ │ │ │ └── extension │ │ │ └── TestExtension.java │ │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── MANIFEST.MF │ │ └── java │ │ └── io │ │ └── vertx │ │ └── ext │ │ └── web │ │ └── templ │ │ └── pebble │ │ └── package-info.java ├── vertx-web-templ-freemarker │ └── src │ │ ├── test │ │ ├── resources │ │ │ └── somedir │ │ │ │ ├── inc.ftl │ │ │ │ ├── lang.ftl │ │ │ │ ├── lang_el.ftl │ │ │ │ ├── base.ftl │ │ │ │ ├── test-freemarker-template2.ftl │ │ │ │ ├── test-freemarker-template2.mvl │ │ │ │ └── altlang.ftl │ │ └── filesystemtemplates │ │ │ └── test-freemarker-template3.ftl │ │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── MANIFEST.MF │ │ └── java │ │ └── io │ │ └── vertx │ │ └── ext │ │ └── web │ │ └── templ │ │ └── freemarker │ │ └── package-info.java ├── vertx-web-templ-handlebars │ └── src │ │ ├── test │ │ ├── resources │ │ │ ├── templates │ │ │ │ ├── common │ │ │ │ │ └── head.hbs │ │ │ │ └── index.hbs │ │ │ └── somedir │ │ │ │ ├── test-handlebars-template2.foo │ │ │ │ ├── test-handlebars-template2.hbs │ │ │ │ └── test-handlebars-template2.zbs │ │ └── filesystemtemplates │ │ │ ├── test-handlebars-template3.hbs │ │ │ ├── test-handlebars-template6.hbs │ │ │ ├── test-handlebars-template4.hbs │ │ │ ├── test-handlebars-template8.hbs │ │ │ ├── test-handlebars-template7.hbs │ │ │ ├── sub │ │ │ └── test-handlebars-template9.hbs │ │ │ ├── test-handlebars-template7A.hbs │ │ │ └── test-handlebars-template5.hbs │ │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── MANIFEST.MF │ │ └── java │ │ └── io │ │ └── vertx │ │ └── ext │ │ └── web │ │ └── templ │ │ └── handlebars │ │ ├── package-info.java │ │ └── impl │ │ └── JsonFormatter.java ├── vertx-web-templ-jte │ └── src │ │ ├── test │ │ ├── jte │ │ │ ├── base.jte │ │ │ ├── tag │ │ │ │ └── inc.jte │ │ │ └── testTemplate2.jte │ │ ├── templates │ │ │ └── compiled.jte │ │ └── java │ │ │ └── Migration.java │ │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── MANIFEST.MF │ │ └── java │ │ └── io │ │ └── vertx │ │ └── ext │ │ └── web │ │ └── templ │ │ └── jte │ │ ├── package-info.java │ │ └── impl │ │ └── JteBufferUtil.java ├── vertx-web-templ-mvel │ └── src │ │ ├── test │ │ ├── resources │ │ │ └── somedir │ │ │ │ ├── test-mvel-template2.foo │ │ │ │ ├── test-mvel-template2.templ │ │ │ │ └── test-mvel-template2.bempl │ │ └── filesystemtemplates │ │ │ ├── subfolder │ │ │ └── include-test2.txt │ │ │ ├── include-test1.txt │ │ │ ├── test-mvel-template4.templ │ │ │ └── test-mvel-template3.templ │ │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── MANIFEST.MF │ │ └── java │ │ └── io │ │ └── vertx │ │ └── ext │ │ └── web │ │ └── templ │ │ └── mvel │ │ └── package-info.java ├── vertx-web-templ-rocker │ └── src │ │ ├── test │ │ └── resources │ │ │ └── somedir │ │ │ ├── Inc.rocker.html │ │ │ ├── Base.rocker.html │ │ │ ├── TestRockerTemplate2.rocker.html │ │ │ └── TestRockerTemplate3.rocker.raw │ │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── MANIFEST.MF │ │ └── java │ │ └── io │ │ └── vertx │ │ └── ext │ │ └── web │ │ └── templ │ │ └── rocker │ │ ├── package-info.java │ │ └── impl │ │ └── VertxBufferOutputFactory.java ├── vertx-web-templ-httl │ └── src │ │ ├── main │ │ ├── resources │ │ │ └── META-INF │ │ │ │ └── MANIFEST.MF │ │ └── java │ │ │ └── io │ │ │ └── vertx │ │ │ └── ext │ │ │ └── web │ │ │ └── templ │ │ │ └── httl │ │ │ └── package-info.java │ │ └── test │ │ └── resources │ │ └── somedir │ │ ├── test-httl-template1.httl │ │ └── test-httl-template1.mvl ├── vertx-web-templ-pug │ └── src │ │ ├── main │ │ ├── resources │ │ │ └── META-INF │ │ │ │ └── MANIFEST.MF │ │ └── java │ │ │ └── io │ │ │ └── vertx │ │ │ └── ext │ │ │ └── web │ │ │ └── templ │ │ │ └── pug │ │ │ └── package-info.java │ │ └── test │ │ ├── resources │ │ └── somedir │ │ │ ├── test-pug-template2.foo │ │ │ ├── test-pug-template-umlaut.pug │ │ │ ├── test-pug-template2.pug │ │ │ └── test-pug-template2.made │ │ └── filesystemtemplates │ │ └── test-pug-template3.pug ├── vertx-web-templ-rythm │ └── src │ │ ├── main │ │ ├── resources │ │ │ └── META-INF │ │ │ │ └── MANIFEST.MF │ │ └── java │ │ │ └── io │ │ │ └── vertx │ │ │ └── ext │ │ │ └── web │ │ │ └── templ │ │ │ └── rythm │ │ │ ├── package-info.java │ │ │ └── RythmTemplateEngine.java │ │ └── test │ │ ├── filesystemtemplates │ │ └── test-rythm-template.html │ │ └── resources │ │ └── somedir │ │ └── test-rythm-template2.html └── vertx-web-templ-thymeleaf │ └── src │ ├── main │ ├── resources │ │ └── META-INF │ │ │ └── MANIFEST.MF │ └── java │ │ └── io │ │ └── vertx │ │ └── ext │ │ └── web │ │ └── templ │ │ └── thymeleaf │ │ └── package-info.java │ └── test │ ├── resources │ └── somedir │ │ ├── test-thymeleaf-include.html │ │ ├── test-thymeleaf-template2.html │ │ └── test-thymeleaf-fragmented.html │ └── filesystemtemplates │ └── test-thymeleaf-template3.html ├── vertx-web-proxy └── src │ └── main │ ├── resources │ └── META-INF │ │ └── MANIFEST.MF │ └── java │ ├── examples │ └── package-info.java │ └── io │ └── vertx │ └── ext │ └── web │ └── proxy │ ├── package-info.java │ └── handler │ ├── impl │ └── ProxyHandlerImpl.java │ └── ProxyHandler.java ├── vertx-web-common ├── src │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── MANIFEST.MF │ │ ├── java │ │ └── io │ │ │ └── vertx │ │ │ └── ext │ │ │ └── web │ │ │ ├── codec │ │ │ ├── package-info.java │ │ │ └── spi │ │ │ │ └── BodyStream.java │ │ │ ├── common │ │ │ ├── package-info.java │ │ │ └── template │ │ │ │ └── impl │ │ │ │ └── TemplateHolder.java │ │ │ └── multipart │ │ │ └── package-info.java │ │ └── asciidoc │ │ └── enums.adoc └── pom.xml ├── vertx-web-api-service └── src │ ├── main │ ├── resources │ │ └── META-INF │ │ │ ├── MANIFEST.MF │ │ │ ├── services │ │ │ ├── io.vertx.codegen.GeneratorLoader │ │ │ └── io.vertx.codegen.ModelProvider │ │ │ └── vertx │ │ │ └── vertx-web-api-service-codegen │ │ │ └── service_call_handler.txt │ └── java │ │ ├── io │ │ └── vertx │ │ │ └── ext │ │ │ └── web │ │ │ └── api │ │ │ └── service │ │ │ ├── package-info.java │ │ │ ├── WebApiServiceGen.java │ │ │ └── generator │ │ │ ├── WebApiProxyGenLoader.java │ │ │ └── model │ │ │ └── WebApiProxyModelProvider.java │ │ └── examples │ │ ├── package-info.java │ │ ├── TransactionService.java │ │ └── TransactionServiceImpl.java │ └── test │ ├── java │ └── io │ │ └── vertx │ │ └── ext │ │ └── web │ │ └── api │ │ └── service │ │ ├── SomeEnum.java │ │ ├── package-info.java │ │ ├── futures │ │ ├── package-info.java │ │ ├── FuturesService.java │ │ └── FuturesServiceImpl.java │ │ ├── generator │ │ └── models │ │ │ ├── package-info.java │ │ │ ├── futures │ │ │ ├── package-info.java │ │ │ └── ValidWebApiProxyWithFutures.java │ │ │ ├── InvalidMissingHandler.java │ │ │ ├── InvalidMissingContext.java │ │ │ ├── InvalidWrongHandler.java │ │ │ └── ValidWebApiProxy.java │ │ ├── BinaryTestService.java │ │ ├── FailureTestService.java │ │ ├── BinaryTestServiceImpl.java │ │ ├── FailureTestServiceImpl.java │ │ ├── TestService.java │ │ └── AnotherTestService.java │ └── resources │ └── filter.json ├── vertx-web-openapi-router └── src │ ├── main │ ├── resources │ │ └── META-INF │ │ │ └── MANIFEST.MF │ └── java │ │ └── examples │ │ └── package-info.java │ └── test │ ├── resources │ ├── keystore.jceks │ └── security │ │ ├── security_optional_test.yaml │ │ ├── security_optional_callbackaware.yaml │ │ └── security_scopes_test.yaml │ └── java │ └── io │ └── vertx │ └── router │ └── ResourceHelper.java ├── vertx-web-session-stores ├── vertx-web-sstore-cookie │ └── src │ │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ ├── MANIFEST.MF │ │ │ └── services │ │ │ └── io.vertx.ext.web.sstore.SessionStore │ │ └── java │ │ └── io │ │ └── vertx │ │ └── ext │ │ └── web │ │ └── sstore │ │ └── cookie │ │ └── package-info.java ├── vertx-web-sstore-redis │ └── src │ │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ ├── MANIFEST.MF │ │ │ └── services │ │ │ └── io.vertx.ext.web.sstore.SessionStore │ │ └── java │ │ └── io │ │ └── vertx │ │ └── ext │ │ └── web │ │ └── sstore │ │ └── redis │ │ └── package-info.java └── pom.xml ├── .github ├── dependabot.yml └── workflows │ ├── ci.yml │ ├── ci-4.x.yml │ ├── deploy.yml │ └── ci-5.x.yml ├── .editorconfig ├── .gitignore └── README.adoc /vertx-web/tests/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /vertx-web-graphql/tests/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /vertx-web/src/test/resources/webroot/a/b/test.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vertx-web-client/src/main/asciidoc/override/rxjava2.adoc: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/random.txt: -------------------------------------------------------------------------------- 1 | abc 2 | -------------------------------------------------------------------------------- /vertx-web-validation/src/test/resources/myfile.txt: -------------------------------------------------------------------------------- 1 | bla 2 | -------------------------------------------------------------------------------- /vertx-web/src/test/sockjs-protocol/unittest2/test/dummy.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vertx-web/src/test/sockjs-protocol/linecache2/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vertx-web/src/test/sockjs-protocol/traceback2/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vertx-web/src/test/sockjs-protocol/unittest2/test/__init__.py: -------------------------------------------------------------------------------- 1 | # -------------------------------------------------------------------------------- /vertx-web/src/test/sockjs-protocol/websocket/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vertx-web/src/test/sockjs-protocol/ws4py/server/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-pebble/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /vertx-web-graphql/vertx-web-graphiql/.env: -------------------------------------------------------------------------------- 1 | GENERATE_SOURCEMAP=false 2 | -------------------------------------------------------------------------------- /vertx-web/src/test/resources/webroot/foo.json: -------------------------------------------------------------------------------- 1 | { 2 | "foo": "bar" 3 | } -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/random.csv: -------------------------------------------------------------------------------- 1 | a,b,c,d,e,f 2 | g,h,i,j,k,l 3 | -------------------------------------------------------------------------------- /vertx-web/src/test/resources/webroot/index.html: -------------------------------------------------------------------------------- 1 | Index page -------------------------------------------------------------------------------- /vertx-web/src/test/resources/webroot/somedir2/foo2.json: -------------------------------------------------------------------------------- 1 | { 2 | "foo": "bar" 3 | } -------------------------------------------------------------------------------- /vertx-web/src/test/resources/webroot/.hidden.html: -------------------------------------------------------------------------------- 1 | Hidden page -------------------------------------------------------------------------------- /vertx-web/src/test/resources/webroot/otherpage.html: -------------------------------------------------------------------------------- 1 | Other page -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/test_json/schemas_test/test14_fail.json: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/test_json/schemas_test/test14_ok.json: -------------------------------------------------------------------------------- 1 | ["bla"] 2 | -------------------------------------------------------------------------------- /vertx-web/src/test/filesystemwebroot/fspage.html: -------------------------------------------------------------------------------- 1 | File system page -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-freemarker/src/test/resources/somedir/inc.ftl: -------------------------------------------------------------------------------- 1 | Vert.x ${what} -------------------------------------------------------------------------------- /vertx-web-graphql/src/test/resources/locale.graphqls: -------------------------------------------------------------------------------- 1 | type Query { 2 | locale: String 3 | } 4 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/test_json/schemas_test/test13_ok_request.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /vertx-web/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Automatic-Module-Name: io.vertx.web 2 | 3 | -------------------------------------------------------------------------------- /vertx-web/src/test/resources/nasty/index.html/index.html: -------------------------------------------------------------------------------- 1 | Nasty index page -------------------------------------------------------------------------------- /vertx-web/src/test/resources/webroot/somedir/.hidden.html: -------------------------------------------------------------------------------- 1 | Hidden page -------------------------------------------------------------------------------- /vertx-web/src/test/resources/webroot/somedir/something.html: -------------------------------------------------------------------------------- 1 | Blah page -------------------------------------------------------------------------------- /vertx-web/src/test/resources/webroot/somedir2/somepage.html: -------------------------------------------------------------------------------- 1 | Other page -------------------------------------------------------------------------------- /vertx-web/src/test/resources/webroot/somedir2/somepage2.html: -------------------------------------------------------------------------------- 1 | Index page -------------------------------------------------------------------------------- /vertx-web/src/test/resources/webroot/somedir3/style.css: -------------------------------------------------------------------------------- 1 | h1 { 2 | font-size: small; 3 | } 4 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-freemarker/src/test/resources/somedir/lang.ftl: -------------------------------------------------------------------------------- 1 | Hello world 2 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-handlebars/src/test/resources/templates/common/head.hbs: -------------------------------------------------------------------------------- 1 | HEAD 2 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-jte/src/test/jte/base.jte: -------------------------------------------------------------------------------- 1 | @template.tag.inc(what = "rules") 2 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-pebble/src/test/resources/messages_en_US.properties: -------------------------------------------------------------------------------- 1 | greeting=Hi -------------------------------------------------------------------------------- /vertx-web-proxy/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Automatic-Module-Name: io.vertx.web.proxy 2 | -------------------------------------------------------------------------------- /vertx-web/src/test/filesystemwebroot/file with spaces2.html: -------------------------------------------------------------------------------- 1 | File with spaces -------------------------------------------------------------------------------- /vertx-web/src/test/resources/.htdigest: -------------------------------------------------------------------------------- 1 | Mufasa:testrealm@host.com:939e7578ed9e3c518a452acee763bce9 2 | -------------------------------------------------------------------------------- /vertx-web/src/test/resources/webroot/file with spaces.html: -------------------------------------------------------------------------------- 1 | File with spaces -------------------------------------------------------------------------------- /vertx-web/src/test/resources/webroot/swaggerui/index.html: -------------------------------------------------------------------------------- 1 | Fake swagger UI 2 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-freemarker/src/test/resources/somedir/lang_el.ftl: -------------------------------------------------------------------------------- 1 | Γειά σου Κόσμε 2 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-pebble/src/test/resources/messages_de_DE.properties: -------------------------------------------------------------------------------- 1 | greeting=Hallo -------------------------------------------------------------------------------- /vertx-web-client/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Automatic-Module-Name: io.vertx.web.client 2 | 3 | -------------------------------------------------------------------------------- /vertx-web-common/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Automatic-Module-Name: io.vertx.web.common 2 | 3 | -------------------------------------------------------------------------------- /vertx-web-graphql/src/test/resources/emptyQuery.graphqls: -------------------------------------------------------------------------------- 1 | type Query { 2 | dummy: String 3 | } 4 | 5 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/test_json/schemas_test/test15_ok_1.json: -------------------------------------------------------------------------------- 1 | [null, null, null] 2 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/test_json/schemas_test/test15_ok_2.json: -------------------------------------------------------------------------------- 1 | [null, "hello", null] 2 | -------------------------------------------------------------------------------- /vertx-web/src/test/resources/webroot/somedir/index.html: -------------------------------------------------------------------------------- 1 | Subdirectory index page -------------------------------------------------------------------------------- /vertx-web/src/test/resources/webroot/somedir/otherpage.html: -------------------------------------------------------------------------------- 1 | Subdirectory other page -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-jte/src/test/jte/tag/inc.jte: -------------------------------------------------------------------------------- 1 | @param String what 2 | Vert.x ${what} 3 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-pebble/src/test/filesystemtemplates/parts/include.peb: -------------------------------------------------------------------------------- 1 | Hi {{ foo }}! 2 | -------------------------------------------------------------------------------- /vertx-web-graphql/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Automatic-Module-Name: io.vertx.web.graphql 2 | 3 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Automatic-Module-Name: io.vertx.web.openapi 2 | 3 | -------------------------------------------------------------------------------- /vertx-web/src/test/resources/test-error-template.html: -------------------------------------------------------------------------------- 1 | {title}.{errorCode}.{errorMessage} -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-mvel/src/test/resources/somedir/test-mvel-template2.foo: -------------------------------------------------------------------------------- 1 | Hello @{foo} and @{bar} -------------------------------------------------------------------------------- /vertx-web-api-service/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Automatic-Module-Name: io.vertx.web.apiservice 2 | 3 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/test_json/schemas_test/test15_fail.json: -------------------------------------------------------------------------------- 1 | [1231564, 45615261, 456456] 2 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/yaml/invalid/refs/fileName.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": 1, 3 | "format": "binary" 4 | } -------------------------------------------------------------------------------- /vertx-web-validation/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Automatic-Module-Name: io.vertx.web.validation 2 | 3 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-pebble/src/test/resources/somedir/test-pebble-template2.foo: -------------------------------------------------------------------------------- 1 | Hello {{foo}} and {{bar}} -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/test_json/schemas_test/test13_ok_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "a": "Hello" 3 | } 4 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/test_json/schemas_test/test1_fail_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Francesco" 3 | } 4 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/test_json/schemas_test/test2_fail_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "id_card": "FG01" 3 | } 4 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/test_json/schemas_test/test5_ok_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "longitude": 70477044 3 | } 4 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/yaml/valid/refs/fileName.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "string", 3 | "format": "binary" 4 | } -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-mvel/src/test/filesystemtemplates/subfolder/include-test2.txt: -------------------------------------------------------------------------------- 1 | Hello @{foo} and @{bar} 2 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-rocker/src/test/resources/somedir/Inc.rocker.html: -------------------------------------------------------------------------------- 1 | @args (String what) 2 | Vert.x @what -------------------------------------------------------------------------------- /vertx-web-openapi-router/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Automatic-Module-Name: io.vertx.web.openapi.router 2 | 3 | -------------------------------------------------------------------------------- /vertx-web/src/test/resources/templates/index.ftl: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Top index!

4 | 5 | 6 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-handlebars/src/test/resources/somedir/test-handlebars-template2.foo: -------------------------------------------------------------------------------- 1 | Hello {{foo}} and {{bar}} -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-handlebars/src/test/resources/somedir/test-handlebars-template2.hbs: -------------------------------------------------------------------------------- 1 | Hello {{foo}} and {{bar}} -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-handlebars/src/test/resources/somedir/test-handlebars-template2.zbs: -------------------------------------------------------------------------------- 1 | Cheerio {{foo}} and {{bar}} -------------------------------------------------------------------------------- /vertx-web-client/src/main/java/examples/package-info.java: -------------------------------------------------------------------------------- 1 | @Source 2 | package examples; 3 | 4 | import io.vertx.docgen.Source; 5 | -------------------------------------------------------------------------------- /vertx-web-validation/src/test/resources/int_schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "integer", 3 | "maximum": 10, 4 | "minimum": 0 5 | } 6 | -------------------------------------------------------------------------------- /vertx-web/src/test/resources/templates/sub/index.ftl: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Sub index!

4 | 5 | 6 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-freemarker/src/test/resources/somedir/base.ftl: -------------------------------------------------------------------------------- 1 | <#assign what = "rules"> 2 | <#include "inc.ftl"> -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-handlebars/src/test/filesystemtemplates/test-handlebars-template3.hbs: -------------------------------------------------------------------------------- 1 | Goodbye {{foo}} and {{bar}} -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/yaml/invalid/refs/Simple.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | properties: 3 | fileName: 4 | $ref: fileName.json -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/yaml/valid/refs/Simple.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | properties: 3 | fileName: 4 | $ref: fileName.json -------------------------------------------------------------------------------- /vertx-web/src/test/resources/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wjw465150/vertx-web/master/vertx-web/src/test/resources/favicon.ico -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-handlebars/src/test/filesystemtemplates/test-handlebars-template6.hbs: -------------------------------------------------------------------------------- 1 | No number index: {{foo.[bar].name}} -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-httl/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Automatic-Module-Name: io.vertx.web.template.httl 2 | 3 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-jte/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Automatic-Module-Name: io.vertx.web.template.jte 2 | 3 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-mvel/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Automatic-Module-Name: io.vertx.web.template.mvel 2 | 3 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-mvel/src/test/filesystemtemplates/include-test1.txt: -------------------------------------------------------------------------------- 1 | Request path is @{context.getString("path")} 2 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-pebble/src/test/filesystemtemplates/test-pebble-template-i18n.peb: -------------------------------------------------------------------------------- 1 | {{ i18n("messages","greeting") }} 2 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-pug/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Automatic-Module-Name: io.vertx.web.template.pug 2 | 3 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/test_json/schemas_test/test1_fail_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Francesco", 3 | "surname": 10 4 | } 5 | -------------------------------------------------------------------------------- /vertx-web/src/test/resources/keystore.jceks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wjw465150/vertx-web/master/vertx-web/src/test/resources/keystore.jceks -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-pebble/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Automatic-Module-Name: io.vertx.web.template.pebble 2 | 3 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-pug/src/test/resources/somedir/test-pug-template2.foo: -------------------------------------------------------------------------------- 1 | !!! 5 2 | html 3 | head 4 | title= foo 5 | body -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-rocker/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Automatic-Module-Name: io.vertx.web.template.rocker 2 | 3 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-rythm/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Automatic-Module-Name: io.vertx.web.template.rythm 2 | 3 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/test_json/schemas_test/test1_ok.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Francesco", 3 | "surname": "Guardiani" 4 | } 5 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/test_json/schemas_test/test2_fail_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Francesco", 3 | "id_card": "FG01" 4 | } 5 | -------------------------------------------------------------------------------- /vertx-web-session-stores/vertx-web-sstore-cookie/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Automatic-Module-Name: io.vertx.web.sstore.cookie 2 | 3 | -------------------------------------------------------------------------------- /vertx-web-session-stores/vertx-web-sstore-redis/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Automatic-Module-Name: io.vertx.web.sstore.redis 2 | 3 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-handlebars/src/test/filesystemtemplates/test-handlebars-template4.hbs: -------------------------------------------------------------------------------- 1 | Goodbye {{foo.bar.one}} and {{foo.bar.two}} -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-handlebars/src/test/resources/templates/index.hbs: -------------------------------------------------------------------------------- 1 | {{#block "head" }} 2 | {{> common/head}} 3 | {{/block}} 4 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-thymeleaf/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Automatic-Module-Name: io.vertx.web.template.thymeleaf 2 | 3 | -------------------------------------------------------------------------------- /vertx-web-graphql/src/test/resources/hello.graphqls: -------------------------------------------------------------------------------- 1 | type Query { 2 | hello: String 3 | } 4 | 5 | type Subscription { 6 | greetings: String 7 | } 8 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/random-file: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wjw465150/vertx-web/master/vertx-web-openapi/src/test/resources/random-file -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/test_json/schemas_test/test2_fail_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Francesco", 3 | "surname": "Guardiani" 4 | } 5 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/test_json/schemas_test/test5_fail.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Francesco", 3 | "surname": "Guardiani" 4 | } 5 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/test_json/schemas_test/test5_ok_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "latitude": -49652697, 3 | "longitude": 55311124 4 | } 5 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "maven" 4 | directory: "/" 5 | schedule: 6 | interval: "daily" 7 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-freemarker/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Automatic-Module-Name: io.vertx.web.template.freemarker 2 | 3 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-handlebars/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Automatic-Module-Name: io.vertx.web.template.handlebars 2 | 3 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-pug/src/test/resources/somedir/test-pug-template-umlaut.pug: -------------------------------------------------------------------------------- 1 | doctype html 2 | html 3 | head 4 | title= 'ä' 5 | -------------------------------------------------------------------------------- /vertx-web-api-service/src/main/resources/META-INF/services/io.vertx.codegen.GeneratorLoader: -------------------------------------------------------------------------------- 1 | io.vertx.ext.web.api.service.generator.WebApiProxyGenLoader 2 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/jars/refs.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wjw465150/vertx-web/master/vertx-web-openapi/src/test/resources/jars/refs.jar -------------------------------------------------------------------------------- /vertx-web/src/test/resources/somedir/test-template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Test template

4 | foo is {foo} bar is {bar}
5 | 6 | -------------------------------------------------------------------------------- /vertx-web-api-service/src/main/resources/META-INF/services/io.vertx.codegen.ModelProvider: -------------------------------------------------------------------------------- 1 | io.vertx.ext.web.api.service.generator.model.WebApiProxyModelProvider 2 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/jars/specs.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wjw465150/vertx-web/master/vertx-web-openapi/src/test/resources/jars/specs.jar -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/schemas/Card_id.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | properties: 3 | id_card: 4 | type: string 5 | required: 6 | - id_card 7 | -------------------------------------------------------------------------------- /vertx-web/src/test/resources/custom_dir_template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Custom Index of {directory}

4 | {parent} 5 | {files} 6 | 7 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-httl/src/test/resources/somedir/test-httl-template1.httl: -------------------------------------------------------------------------------- 1 | 2 | Hello ${foo} and ${bar} 3 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-httl/src/test/resources/somedir/test-httl-template1.mvl: -------------------------------------------------------------------------------- 1 | 2 | Cheerio ${foo} and ${bar} 3 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-pebble/src/test/filesystemtemplates/test-pebble-template3.peb: -------------------------------------------------------------------------------- 1 | Hello {{foo}} and {{bar}} 2 | Request path is {{context.path}} 3 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-pebble/src/test/resources/somedir/test-pebble-template2.beb: -------------------------------------------------------------------------------- 1 | Cheerio {{foo}} and {{bar}} 2 | Request path is {{context.path}} 3 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-pebble/src/test/resources/somedir/test-pebble-template2.peb: -------------------------------------------------------------------------------- 1 | Hello {{foo}} and {{ bar }} 2 | Request path is {{context.path}} 3 | -------------------------------------------------------------------------------- /vertx-web-graphql/vertx-web-graphiql/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding: 0; 3 | margin: 0; 4 | min-height: 100vh; 5 | } 6 | #root { 7 | height: 100vh; 8 | } 9 | -------------------------------------------------------------------------------- /vertx-web/src/test/resources/webroot/somedir/range.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wjw465150/vertx-web/master/vertx-web/src/test/resources/webroot/somedir/range.bin -------------------------------------------------------------------------------- /vertx-web/src/test/resources/webroot/somedir/range.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wjw465150/vertx-web/master/vertx-web/src/test/resources/webroot/somedir/range.jpeg -------------------------------------------------------------------------------- /vertx-web/src/test/resources/webroot/somedir/range.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wjw465150/vertx-web/master/vertx-web/src/test/resources/webroot/somedir/range.jpg -------------------------------------------------------------------------------- /vertx-web/src/test/resources/webroot/somedir3/coin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wjw465150/vertx-web/master/vertx-web/src/test/resources/webroot/somedir3/coin.png -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-freemarker/src/test/filesystemtemplates/test-freemarker-template3.ftl: -------------------------------------------------------------------------------- 1 | Hello ${foo} and ${bar} 2 | Request path is ${context.path} 3 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-freemarker/src/test/resources/somedir/test-freemarker-template2.ftl: -------------------------------------------------------------------------------- 1 | Hello ${foo} and ${bar} 2 | Request path is ${context.path} 3 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-freemarker/src/test/resources/somedir/test-freemarker-template2.mvl: -------------------------------------------------------------------------------- 1 | Cheerio ${foo} and ${bar} 2 | Request path is ${context.path} 3 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-handlebars/src/test/filesystemtemplates/test-handlebars-template8.hbs: -------------------------------------------------------------------------------- 1 | text from template8 2 | {{#block "partialtext"}}{{/block}} 3 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-mvel/src/test/filesystemtemplates/test-mvel-template4.templ: -------------------------------------------------------------------------------- 1 | @include{'subfolder/include-test2.txt'} 2 | @include{'include-test1.txt'} -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-mvel/src/test/resources/somedir/test-mvel-template2.templ: -------------------------------------------------------------------------------- 1 | Hello @{foo} and @{bar} 2 | Request path is @{context.getString('path')} 3 | -------------------------------------------------------------------------------- /vertx-web-openapi-router/src/test/resources/keystore.jceks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wjw465150/vertx-web/master/vertx-web-openapi-router/src/test/resources/keystore.jceks -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/test_json/schemas_test/test2_ok.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Francesco", 3 | "surname": "Guardiani", 4 | "id_card": "FG01" 5 | } 6 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/test_json/schemas_test/test8_fail_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "value": "Root", 3 | "children": { 4 | "value": "Leaf1" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-mvel/src/test/filesystemtemplates/test-mvel-template3.templ: -------------------------------------------------------------------------------- 1 | Hello @{foo} and @{bar} 2 | Request path is @{context.getString('path')} 3 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-mvel/src/test/resources/somedir/test-mvel-template2.bempl: -------------------------------------------------------------------------------- 1 | Cheerio @{foo} and @{bar} 2 | Request path is @{context.getString("path")} 3 | -------------------------------------------------------------------------------- /vertx-web/src/main/resources/META-INF/vertx/web/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wjw465150/vertx-web/master/vertx-web/src/main/resources/META-INF/vertx/web/favicon.ico -------------------------------------------------------------------------------- /vertx-web-session-stores/vertx-web-sstore-redis/src/main/resources/META-INF/services/io.vertx.ext.web.sstore.SessionStore: -------------------------------------------------------------------------------- 1 | io.vertx.ext.web.sstore.redis.impl.RedisSessionStoreImpl 2 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-pug/src/test/resources/somedir/test-pug-template2.pug: -------------------------------------------------------------------------------- 1 | doctype html 2 | html 3 | head 4 | title= foo + context.getString('path') 5 | body 6 | -------------------------------------------------------------------------------- /vertx-web-session-stores/vertx-web-sstore-cookie/src/main/resources/META-INF/services/io.vertx.ext.web.sstore.SessionStore: -------------------------------------------------------------------------------- 1 | io.vertx.ext.web.sstore.cookie.impl.CookieSessionStoreImpl 2 | -------------------------------------------------------------------------------- /vertx-web/src/test/resources/webroot/testCompressionSuffix.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

Hi

7 | 8 | 9 | -------------------------------------------------------------------------------- /vertx-web/tests/sockjs/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "test": { 4 | "plugins": [ 5 | "transform-es2015-modules-commonjs" 6 | ] 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-pug/src/test/filesystemtemplates/test-pug-template3.pug: -------------------------------------------------------------------------------- 1 | doctype html 2 | html 3 | head 4 | title= foo + context.getString('path') 5 | body 6 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/test_json/schemas_test/test8_fail_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "value": "Root", 3 | "parent": { 4 | "value": "Leaf1", 5 | "parent": 1 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-pug/src/test/resources/somedir/test-pug-template2.made: -------------------------------------------------------------------------------- 1 | doctype html 2 | html 3 | head 4 | title= 'aardvark' + context.getString('path') 5 | body 6 | -------------------------------------------------------------------------------- /vertx-web-graphql/tests/apollo/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "test": { 4 | "plugins": [ 5 | "transform-es2015-modules-commonjs" 6 | ] 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /vertx-web-api-service/src/test/java/io/vertx/ext/web/api/service/SomeEnum.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.api.service; 2 | 3 | public enum SomeEnum { 4 | FIRST, 5 | SECOND, 6 | THIRD 7 | 8 | } 9 | -------------------------------------------------------------------------------- /vertx-web-graphql/tests/graphql-ws/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "test": { 4 | "plugins": [ 5 | "transform-es2015-modules-commonjs" 6 | ] 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /vertx-web/src/test/pythonversion.py: -------------------------------------------------------------------------------- 1 | # fail for python 3 since sockjs requires python 2.7 2 | import sys 3 | 4 | if (sys.version_info > (3, 0)): 5 | raise RuntimeError('you are running python 3.x') 6 | -------------------------------------------------------------------------------- /vertx-web/src/main/java/examples/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Julien Viet 3 | */ 4 | @Source 5 | package examples; 6 | 7 | import io.vertx.docgen.Source; -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/test_json/schemas_test/test7_fail_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Francesco", 3 | "surname": "Guardiani", 4 | "id_card": "FG01", 5 | "father": "I'm your father!" 6 | } 7 | -------------------------------------------------------------------------------- /vertx-web-proxy/src/main/java/examples/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Julien Viet 3 | */ 4 | @Source 5 | package examples; 6 | import io.vertx.docgen.Source; 7 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-handlebars/src/test/filesystemtemplates/test-handlebars-template7.hbs: -------------------------------------------------------------------------------- 1 | {{#partial "partialtext"}} 2 | text from template7 3 | {{/partial}} 4 | {{> test-handlebars-template8 }} 5 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-pebble/src/test/filesystemtemplates/test-pebble-template5.peb: -------------------------------------------------------------------------------- 1 | Hello {{foo}} and {{bar}} 2 | String is {{ createString() }} 3 | Request path is {{context.getString("path")}} 4 | -------------------------------------------------------------------------------- /vertx-web-graphql/stop-apollo-tests-server.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | pkill -9 -F "${HOME}"/ApolloTestsServer.pid 2>/dev/null 4 | rm -f "${HOME}"/ApolloTestsServer.pid 5 | rm -f "${HOME}"/ApolloTestsServer.log 6 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/schemas/Person.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | properties: 3 | name: 4 | type: string 5 | surname: 6 | type: string 7 | required: 8 | - name 9 | - surname 10 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/test_json/schemas_test/test16_fail.json: -------------------------------------------------------------------------------- 1 | { 2 | "mymap" : { 3 | "key1":{ "a" : "val1" }, 4 | "key2":{ "b" : "val2" }, 5 | "key3":{ "c" : "val3" } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-rocker/src/test/resources/somedir/Base.rocker.html: -------------------------------------------------------------------------------- 1 | @import io.vertx.core.json.JsonObject 2 | @args (JsonObject context, String foo, String bar) 3 | @somedir.Inc.template("rules") 4 | -------------------------------------------------------------------------------- /vertx-web-openapi-router/src/main/java/examples/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Julien Viet 3 | */ 4 | @Source 5 | package examples; 6 | import io.vertx.docgen.Source; 7 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-handlebars/src/test/filesystemtemplates/sub/test-handlebars-template9.hbs: -------------------------------------------------------------------------------- 1 | {{#partial "partialtext"}} 2 | text from template9 3 | {{/partial}} 4 | {{> ../test-handlebars-template8 }} 5 | -------------------------------------------------------------------------------- /vertx-web/src/main/java/io/vertx/ext/web/package-info.java: -------------------------------------------------------------------------------- 1 | @ModuleGen(name = "vertx-web", groupPackage = "io.vertx", useFutures = true) 2 | package io.vertx.ext.web; 3 | 4 | import io.vertx.codegen.annotations.ModuleGen; 5 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-pebble/src/test/filesystemtemplates/parts/parent.peb: -------------------------------------------------------------------------------- 1 | {% block title %}Title{% endblock %} 2 | {% block content %}Content{% endblock %} 3 | {% block footer %}Footer - {{ foo }}{% endblock %} 4 | -------------------------------------------------------------------------------- /vertx-web-graphql/stop-graphql-ws-tests-server.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | pkill -9 -F "${HOME}"/GraphQLWSTestsServer.pid 2>/dev/null 4 | rm -f "${HOME}"/GraphQLWSTestsServer.pid 5 | rm -f "${HOME}"/GraphQLWSTestsServer.log 6 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/test_json/schemas_test/test16_ok.json: -------------------------------------------------------------------------------- 1 | { 2 | "mymap" : { 3 | "key1":{ "a" : "val1" }, 4 | "key2":{ "a" : "val2" }, 5 | "key3":{ "a" : "val3" } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-handlebars/src/test/filesystemtemplates/test-handlebars-template7A.hbs: -------------------------------------------------------------------------------- 1 | {{#partial "partialtext"}} 2 | text from template7 3 | {{/partial}} 4 | {{> test/filesystemtemplates/test-handlebars-template8 }} 5 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/test_json/schemas_test/testLocalRelativeRef_ok.json: -------------------------------------------------------------------------------- 1 | { 2 | "familyName": "Francesco", 3 | "givenName": "Fra", 4 | "geo": { 5 | "latitude": 50.5, 6 | "longitude": -50.5 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/yaml/valid/refs/Circular.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | properties: 3 | value: 4 | type: string 5 | parent: 6 | $ref: "#" 7 | childs: 8 | type: array 9 | items: 10 | $ref: "#" -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/test_json/schemas_test/testLocalRelativeRef_fail.json: -------------------------------------------------------------------------------- 1 | { 2 | "familyName": "Francesco", 3 | "givenName": "Fra", 4 | "geo": { 5 | "latitude": 50.5, 6 | "longitude": "wrong" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /vertx-web-client/src/main/java/io/vertx/ext/web/client/package-info.java: -------------------------------------------------------------------------------- 1 | @ModuleGen(name = "vertx-web-client", groupPackage = "io.vertx", useFutures = true) 2 | package io.vertx.ext.web.client; 3 | 4 | import io.vertx.codegen.annotations.ModuleGen; 5 | -------------------------------------------------------------------------------- /vertx-web-common/src/main/java/io/vertx/ext/web/codec/package-info.java: -------------------------------------------------------------------------------- 1 | @ModuleGen(name = "vertx-web-common", groupPackage = "io.vertx", useFutures = true) 2 | package io.vertx.ext.web.codec; 3 | 4 | import io.vertx.codegen.annotations.ModuleGen; 5 | -------------------------------------------------------------------------------- /vertx-web-common/src/main/java/io/vertx/ext/web/common/package-info.java: -------------------------------------------------------------------------------- 1 | @ModuleGen(name = "vertx-web-common", groupPackage = "io.vertx", useFutures = true) 2 | package io.vertx.ext.web.common; 3 | 4 | import io.vertx.codegen.annotations.ModuleGen; 5 | -------------------------------------------------------------------------------- /vertx-web-graphql/src/test/resources/upload.graphqls: -------------------------------------------------------------------------------- 1 | scalar Upload 2 | 3 | type Return { 4 | id: String! 5 | } 6 | 7 | type Mutation { 8 | singleUpload(file: Upload!): Return 9 | multipleUpload(files: [Upload!]!): Return 10 | } 11 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/main/java/io/vertx/ext/web/openapi/package-info.java: -------------------------------------------------------------------------------- 1 | @ModuleGen(name = "vertx-openapi", groupPackage = "io.vertx", useFutures = true) 2 | package io.vertx.ext.web.openapi; 3 | 4 | import io.vertx.codegen.annotations.ModuleGen; 5 | -------------------------------------------------------------------------------- /vertx-web-proxy/src/main/java/io/vertx/ext/web/proxy/package-info.java: -------------------------------------------------------------------------------- 1 | @ModuleGen(name = "vertx-web-proxy", groupPackage = "io.vertx", useFutures = true) 2 | package io.vertx.ext.web.proxy; 3 | 4 | import io.vertx.codegen.annotations.ModuleGen; 5 | -------------------------------------------------------------------------------- /vertx-web/src/test/sockjs-protocol/websocket/tests/data/header02.txt: -------------------------------------------------------------------------------- 1 | HTTP/1.1 101 WebSocket Protocol Handshake 2 | Connection: Upgrade 3 | Upgrade WebSocket 4 | Sec-WebSocket-Accept: Kxep+hNu9n51529fGidYu7a3wO0= 5 | some_header: something 6 | 7 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-handlebars/src/test/filesystemtemplates/test-handlebars-template5.hbs: -------------------------------------------------------------------------------- 1 | Iterator: {{#each foo}}{{this}},{{/each}} Element by index:{{foo.[1]}} - {{foo.[2].name}} - Out of bounds: {{foo.[42].name}} - Size:{{foo.length}} -------------------------------------------------------------------------------- /vertx-web/src/test/sockjs-protocol/websocket/tests/data/header01.txt: -------------------------------------------------------------------------------- 1 | HTTP/1.1 101 WebSocket Protocol Handshake 2 | Connection: Upgrade 3 | Upgrade: WebSocket 4 | Sec-WebSocket-Accept: Kxep+hNu9n51529fGidYu7a3wO0= 5 | some_header: something 6 | 7 | -------------------------------------------------------------------------------- /vertx-web/stop-sockjs-write-handler-tests-server.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | pkill -9 -F "${HOME}"/SockJSWriteHandlerTestServer.pid 2>/dev/null 4 | rm -f "${HOME}"/SockJSWriteHandlerTestServer.pid 5 | rm -f "${HOME}"/SockJSWriteHandlerTestServer.log 6 | -------------------------------------------------------------------------------- /vertx-web-common/src/main/java/io/vertx/ext/web/multipart/package-info.java: -------------------------------------------------------------------------------- 1 | @ModuleGen(name = "vertx-web-common", groupPackage = "io.vertx", useFutures = true) 2 | package io.vertx.ext.web.multipart; 3 | 4 | import io.vertx.codegen.annotations.ModuleGen; 5 | -------------------------------------------------------------------------------- /vertx-web-graphql/src/test/resources/counter.graphqls: -------------------------------------------------------------------------------- 1 | type Counter { 2 | count: Int 3 | } 4 | 5 | type Query { 6 | staticCounter(num: Int = 5): Counter 7 | } 8 | 9 | type Subscription { 10 | counter(finite: Boolean = true): Counter 11 | } 12 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-jte/src/test/jte/testTemplate2.jte: -------------------------------------------------------------------------------- 1 | @import io.vertx.core.json.JsonObject 2 | @param JsonObject context 3 | @param String foo 4 | @param String bar 5 | 6 | Hello ${foo} and ${bar} 7 | Request path is ${context.getString("path")} 8 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-rocker/src/test/resources/somedir/TestRockerTemplate2.rocker.html: -------------------------------------------------------------------------------- 1 | @import io.vertx.core.json.JsonObject 2 | @args (JsonObject context, String foo, String bar) 3 | Hello @foo and @bar 4 | Request path is @context.getString("path") 5 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-rocker/src/test/resources/somedir/TestRockerTemplate3.rocker.raw: -------------------------------------------------------------------------------- 1 | @import io.vertx.core.json.JsonObject 2 | @args (JsonObject context, String foo, String bar) 3 | Cheerio @foo and @bar 4 | Request path is @context.getString("path") 5 | -------------------------------------------------------------------------------- /vertx-web-api-service/src/main/java/io/vertx/ext/web/api/service/package-info.java: -------------------------------------------------------------------------------- 1 | @ModuleGen(name = "vertx-web-api-service", groupPackage = "io.vertx", useFutures = true) 2 | package io.vertx.ext.web.api.service; 3 | 4 | import io.vertx.codegen.annotations.ModuleGen; 5 | -------------------------------------------------------------------------------- /vertx-web-api-service/src/test/java/io/vertx/ext/web/api/service/package-info.java: -------------------------------------------------------------------------------- 1 | @ModuleGen(name = "vertx-web-api-service", groupPackage = "io.vertx", useFutures = true) 2 | package io.vertx.ext.web.api.service; 3 | 4 | import io.vertx.codegen.annotations.ModuleGen; 5 | -------------------------------------------------------------------------------- /vertx-web-validation/src/main/java/io/vertx/ext/web/validation/package-info.java: -------------------------------------------------------------------------------- 1 | @ModuleGen(name = "vertx-web-validation", groupPackage = "io.vertx", useFutures = true) 2 | package io.vertx.ext.web.validation; 3 | 4 | import io.vertx.codegen.annotations.ModuleGen; 5 | -------------------------------------------------------------------------------- /vertx-web-client/src/main/asciidoc/enums.adoc: -------------------------------------------------------------------------------- 1 | = Enums 2 | 3 | [[StatusExpectations]] 4 | == StatusExpectations 5 | 6 | 7 | [cols=">25%,75%"] 8 | [frame="topbot"] 9 | |=== 10 | ^|Name | Description 11 | |[[SUCCESS]]`SUCCESS`|- 12 | |[[OK]]`OK`|- 13 | |=== 14 | 15 | -------------------------------------------------------------------------------- /vertx-web-graphql/vertx-web-graphiql/src/index.js: -------------------------------------------------------------------------------- 1 | import {createRoot} from 'react-dom/client'; 2 | import App from './App'; 3 | import './index.css'; 4 | 5 | const container = document.getElementById('root'); 6 | const root = createRoot(container); 7 | root.render(); 8 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/test_json/schemas_test/test12_ok.json: -------------------------------------------------------------------------------- 1 | { 2 | "a": { 3 | "a": [ 4 | { 5 | "b": "b" 6 | }, 7 | { 8 | "c": 10 9 | } 10 | ] 11 | }, 12 | "b": "b", 13 | "c": 10 14 | } 15 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-jte/src/test/templates/compiled.jte: -------------------------------------------------------------------------------- 1 | @import io.vertx.core.json.JsonObject 2 | @param JsonObject context 3 | @param String foo 4 | @param String bar 5 | 6 | Hello compiled ${foo} and ${bar} 7 | Request path is ${context.getString("path")} 8 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/java/io/vertx/ext/web/openapi/it/models/package-info.java: -------------------------------------------------------------------------------- 1 | @ModuleGen(name="web-api-service", groupPackage = "io.vertx.ext.web.openapi.it.models") 2 | package io.vertx.ext.web.openapi.it.models; 3 | 4 | import io.vertx.codegen.annotations.ModuleGen; 5 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/test_json/schemas_test/test12_fail.json: -------------------------------------------------------------------------------- 1 | { 2 | "a": { 3 | "a": [ 4 | { 5 | "b": "b" 6 | }, 7 | { 8 | "c": "wrong!" 9 | } 10 | ] 11 | }, 12 | "b": "b", 13 | "c": 10 14 | } 15 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-jte/src/main/java/io/vertx/ext/web/templ/jte/package-info.java: -------------------------------------------------------------------------------- 1 | @ModuleGen(name = "vertx-web-templ-jte", groupPackage = "io.vertx", useFutures = true) 2 | package io.vertx.ext.web.templ.jte; 3 | 4 | import io.vertx.codegen.annotations.ModuleGen; 5 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-pug/src/main/java/io/vertx/ext/web/templ/pug/package-info.java: -------------------------------------------------------------------------------- 1 | @ModuleGen(name = "vertx-web-templ-pug", groupPackage = "io.vertx", useFutures = true) 2 | package io.vertx.ext.web.templ.pug; 3 | 4 | import io.vertx.codegen.annotations.ModuleGen; 5 | -------------------------------------------------------------------------------- /vertx-web-api-service/src/main/java/examples/package-info.java: -------------------------------------------------------------------------------- 1 | @Source(translate = false) 2 | @ModuleGen(name = "examples", groupPackage = "examples", useFutures = true) 3 | package examples; 4 | 5 | import io.vertx.codegen.annotations.ModuleGen; 6 | import io.vertx.docgen.Source; 7 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/java/io/vertx/ext/web/openapi/service/package-info.java: -------------------------------------------------------------------------------- 1 | @ModuleGen(name = "dummy", groupPackage = "io.vertx.ext.web.openapi.service", useFutures = true) 2 | package io.vertx.ext.web.openapi.service; 3 | 4 | import io.vertx.codegen.annotations.ModuleGen; 5 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-httl/src/main/java/io/vertx/ext/web/templ/httl/package-info.java: -------------------------------------------------------------------------------- 1 | @ModuleGen(name = "vertx-web-templ-httl", groupPackage = "io.vertx", useFutures = true) 2 | package io.vertx.ext.web.templ.httl; 3 | 4 | import io.vertx.codegen.annotations.ModuleGen; 5 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-mvel/src/main/java/io/vertx/ext/web/templ/mvel/package-info.java: -------------------------------------------------------------------------------- 1 | @ModuleGen(name = "vertx-web-templ-mvel", groupPackage = "io.vertx", useFutures = true) 2 | package io.vertx.ext.web.templ.mvel; 3 | 4 | import io.vertx.codegen.annotations.ModuleGen; 5 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-pebble/src/test/filesystemtemplates/test-pebble-complex.peb: -------------------------------------------------------------------------------- 1 | {% extends "./parts/parent.peb" %} 2 | 3 | {% block title %}Hello.{% endblock %} 4 | 5 | {% block content %} 6 | Hi {{ bar }}. 7 | {% include "./parts/include.peb" %} 8 | {% endblock %} 9 | -------------------------------------------------------------------------------- /vertx-web/src/test/resources/webroot/somedir3/testLinkPreload.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Hi

8 | 9 | 10 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-rythm/src/main/java/io/vertx/ext/web/templ/rythm/package-info.java: -------------------------------------------------------------------------------- 1 | @ModuleGen(name="vertx-web-templ-rythm", groupPackage = "io.vertx", useFutures = true) 2 | package io.vertx.ext.web.templ.rythm; 3 | 4 | import io.vertx.codegen.annotations.ModuleGen; 5 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-rythm/src/test/filesystemtemplates/test-rythm-template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | FS 6 | 7 | 8 |

@foo

9 |

@bar

10 | 11 | 12 | -------------------------------------------------------------------------------- /vertx-web-graphql/vertx-web-graphiql/build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | rm -rf build 4 | rm -rf ../src/main/resources/io/vertx/ext/web/handler/graphiql 5 | mkdir --parents ../src/main/resources/io/vertx/ext/web/handler/graphiql 6 | npm install 7 | npm run build 8 | node copy-to-resources.js 9 | -------------------------------------------------------------------------------- /vertx-web-validation/src/test/resources/tree_schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "object", 3 | "properties": { 4 | "childs": { 5 | "type": "array", 6 | "items": { 7 | "$ref": "#" 8 | } 9 | } 10 | }, 11 | "required": [ 12 | "value" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-pebble/src/main/java/io/vertx/ext/web/templ/pebble/package-info.java: -------------------------------------------------------------------------------- 1 | @ModuleGen(name = "vertx-web-templ-pebble", groupPackage = "io.vertx", useFutures = true) 2 | package io.vertx.ext.web.templ.pebble; 3 | 4 | import io.vertx.codegen.annotations.ModuleGen; 5 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-rocker/src/main/java/io/vertx/ext/web/templ/rocker/package-info.java: -------------------------------------------------------------------------------- 1 | @ModuleGen(name = "vertx-web-templ-rocker", groupPackage = "io.vertx", useFutures = true) 2 | package io.vertx.ext.web.templ.rocker; 3 | 4 | import io.vertx.codegen.annotations.ModuleGen; 5 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-rythm/src/test/resources/somedir/test-rythm-template2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 |

@foo

9 |

@bar

10 | 11 | 12 | -------------------------------------------------------------------------------- /vertx-web-api-service/src/test/java/io/vertx/ext/web/api/service/futures/package-info.java: -------------------------------------------------------------------------------- 1 | @ModuleGen(name = "dummy", groupPackage = "io.vertx.ext.web.api.service.futures", useFutures = true) 2 | package io.vertx.ext.web.api.service.futures; 3 | 4 | import io.vertx.codegen.annotations.ModuleGen; 5 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/test_json/schemas_test/test7_ok_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Francesco", 3 | "surname": "Guardiani", 4 | "id_card": "FG01", 5 | "father": { 6 | "name": "Francesco", 7 | "surname": "Guardiani", 8 | "id_card": "FG02" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /vertx-web-session-stores/vertx-web-sstore-redis/src/main/java/io/vertx/ext/web/sstore/redis/package-info.java: -------------------------------------------------------------------------------- 1 | @ModuleGen(name = "vertx-web-sstore-redis", groupPackage = "io.vertx", useFutures = true) 2 | package io.vertx.ext.web.sstore.redis; 3 | 4 | import io.vertx.codegen.annotations.ModuleGen; 5 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/java/io/vertx/ext/web/openapi/it/services/package-info.java: -------------------------------------------------------------------------------- 1 | @ModuleGen(name="web-api-service", groupPackage = "io.vertx.ext.web.openapi.it.services", useFutures = true) 2 | package io.vertx.ext.web.openapi.it.services; 3 | 4 | import io.vertx.codegen.annotations.ModuleGen; 5 | -------------------------------------------------------------------------------- /vertx-web-session-stores/vertx-web-sstore-cookie/src/main/java/io/vertx/ext/web/sstore/cookie/package-info.java: -------------------------------------------------------------------------------- 1 | @ModuleGen(name = "vertx-web-sstore-cookie", groupPackage = "io.vertx", useFutures = true) 2 | package io.vertx.ext.web.sstore.cookie; 3 | 4 | import io.vertx.codegen.annotations.ModuleGen; 5 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-thymeleaf/src/main/java/io/vertx/ext/web/templ/thymeleaf/package-info.java: -------------------------------------------------------------------------------- 1 | @ModuleGen(name = "vertx-web-templ-thymeleaf", groupPackage = "io.vertx", useFutures = true) 2 | package io.vertx.ext.web.templ.thymeleaf; 3 | 4 | import io.vertx.codegen.annotations.ModuleGen; 5 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-freemarker/src/main/java/io/vertx/ext/web/templ/freemarker/package-info.java: -------------------------------------------------------------------------------- 1 | @ModuleGen(name = "vertx-web-templ-freemarker", groupPackage = "io.vertx", useFutures = true) 2 | package io.vertx.ext.web.templ.freemarker; 3 | 4 | import io.vertx.codegen.annotations.ModuleGen; 5 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-handlebars/src/main/java/io/vertx/ext/web/templ/handlebars/package-info.java: -------------------------------------------------------------------------------- 1 | @ModuleGen(name = "vertx-web-templ-handlebars", groupPackage = "io.vertx", useFutures = true) 2 | package io.vertx.ext.web.templ.handlebars; 3 | 4 | import io.vertx.codegen.annotations.ModuleGen; 5 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/schemas/tree.yaml: -------------------------------------------------------------------------------- 1 | tree: 2 | type: object 3 | properties: 4 | value: 5 | type: string 6 | childs: 7 | type: array 8 | items: 9 | "$ref": "#/tree" 10 | parent: 11 | "$ref": "#/tree" 12 | required: 13 | - value 14 | -------------------------------------------------------------------------------- /vertx-web-api-service/src/test/java/io/vertx/ext/web/api/service/generator/models/package-info.java: -------------------------------------------------------------------------------- 1 | @ModuleGen(name = "dummy", groupPackage = "io.vertx.ext.web.api.service.generator.models", useFutures = true) 2 | package io.vertx.ext.web.api.service.generator.models; 3 | 4 | import io.vertx.codegen.annotations.ModuleGen; 5 | -------------------------------------------------------------------------------- /vertx-web-graphql/src/test/resources/links.graphqls: -------------------------------------------------------------------------------- 1 | type Link { 2 | url: String 3 | description: String 4 | postedBy: User 5 | } 6 | 7 | type User { 8 | name: String 9 | } 10 | 11 | type Query { 12 | allLinks(secureOnly: Boolean = false): [Link] 13 | } 14 | 15 | type Subscription { 16 | links: Link 17 | } 18 | -------------------------------------------------------------------------------- /vertx-web-graphql/tests/graphql-ws/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "test": "jest" 4 | }, 5 | "devDependencies": { 6 | "babel-plugin-transform-es2015-modules-commonjs": "6.26.2", 7 | "graphql": "16.6.0", 8 | "ws": "8.12.0", 9 | "graphql-ws": "5.11.2", 10 | "jest": "29.4.0" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/schemas/geo.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "A geographical coordinate", 3 | "type": "object", 4 | "properties": { 5 | "latitude": { "type": "number" }, 6 | "longitude": { "type": "number" } 7 | }, 8 | "additionalProperties": { 9 | "type": "number" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /vertx-web/src/test/resources/login/loginusers.properties: -------------------------------------------------------------------------------- 1 | user.tim = delicious:sausages,morris_dancer,developer 2 | user.bob = socks,developer 3 | role.morris_dancer=dance,bang_sticks 4 | role.developer=do_actual_work 5 | user.regular=regular,read 6 | user.admin=admin,read,write 7 | role.read=read_files 8 | role.write=write_files 9 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/test_json/schemas_test/test7_fail_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Francesco", 3 | "surname": "Guardiani", 4 | "id_card": "FG01", 5 | "father": { 6 | "name": "Francesco", 7 | "surname": "Guardiani", 8 | "id_card": "FG02" 9 | }, 10 | "mother": "I'm not your mother!" 11 | } 12 | -------------------------------------------------------------------------------- /vertx-web-api-service/src/test/java/io/vertx/ext/web/api/service/generator/models/futures/package-info.java: -------------------------------------------------------------------------------- 1 | @ModuleGen(name = "dummy", groupPackage = "io.vertx.ext.web.api.service.generator.models.futures", useFutures = true) 2 | package io.vertx.ext.web.api.service.generator.models.futures; 3 | 4 | import io.vertx.codegen.annotations.ModuleGen; 5 | -------------------------------------------------------------------------------- /vertx-web-graphql/vertx-web-graphiql/build.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | setlocal enableextensions 4 | 5 | rd /s /q build 6 | rd /s /q ..\src\main\resources\io\vertx\ext\web\handler\graphiql 7 | md ..\src\main\resources\io\vertx\ext\web\handler\graphiql 8 | call npm install 9 | call npm run build 10 | node copy-to-resources.js 11 | 12 | endlocal 13 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-jte/src/test/java/Migration.java: -------------------------------------------------------------------------------- 1 | import java.io.File; 2 | 3 | public class Migration { 4 | public static void main(String[] args) { 5 | gg.jte.migrate.MigrateV1To2.migrateTemplates( 6 | new File("/home/paulo/Projects/vert-x3/vertx-web/vertx-template-engines/vertx-web-templ-jte/src/test/jte").toPath() 7 | ); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /vertx-web/src/test/sockjs-protocol/unittest2/collector.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | from unittest2.loader import defaultTestLoader 4 | 5 | def collector(): 6 | # import __main__ triggers code re-execution 7 | __main__ = sys.modules['__main__'] 8 | setupDir = os.path.abspath(os.path.dirname(__main__.__file__)) 9 | return defaultTestLoader.discover(setupDir) 10 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-pebble/src/test/filesystemtemplates/test-pebble-template6.peb: -------------------------------------------------------------------------------- 1 | Hello {{foo}} and {{bar}} 2 | Request path is {{context.path}} 3 | Java HashMap foo {{hashmap.foo}} 4 | JsonArray size {{array.size}} 5 | {%for el in array%} 6 | {{el.bar}} 7 | {%endfor%} 8 | ArrayList size {{arraylist.size}} 9 | {%for el in arraylist%} 10 | {{el}} 11 | {%endfor%} 12 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-thymeleaf/src/test/resources/somedir/test-thymeleaf-include.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

8 |

9 | 10 | 11 | -------------------------------------------------------------------------------- /vertx-web-graphql/src/test/resources/borders.graphqls: -------------------------------------------------------------------------------- 1 | type Query{ 2 | text(type: String = "valid"): String! 3 | number(type: String = "positive"): Int! 4 | floating(type: String = "valid"): Float! 5 | bool(type: String = "yes"): Boolean! 6 | list(type: String = "valid"): [String]! 7 | array(type: String = "valid"): [String!] 8 | id(type: String = "valid"): ID! 9 | } 10 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/test_json/schemas_test/test10_fail.json: -------------------------------------------------------------------------------- 1 | { 2 | "value": "A", 3 | "childs": [ 4 | { 5 | "value": "B" 6 | }, 7 | { 8 | "value": 6, 9 | "childs": [ 10 | { 11 | "value": "D" 12 | } 13 | ], 14 | "parent": { 15 | "value": "A" 16 | } 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/test_json/schemas_test/test10_ok.json: -------------------------------------------------------------------------------- 1 | { 2 | "value": "A", 3 | "childs": [ 4 | { 5 | "value": "B" 6 | }, 7 | { 8 | "value": "C", 9 | "childs": [ 10 | { 11 | "value": "D" 12 | } 13 | ], 14 | "parent": { 15 | "value": "A" 16 | } 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-freemarker/src/test/resources/somedir/altlang.ftl: -------------------------------------------------------------------------------- 1 | Hello ${context.foo} 2 | <#list context.bar as thing> 3 | There is a ${thing} 4 | 5 | <#list context.baz?keys as k> 6 | ${k} 7 | 8 | <#list context.baz?values as v> 9 | ${v} 10 | 11 | <#list context.team.marseille as peep> 12 | ${peep} loves Olympique de Marseille 13 | 14 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-thymeleaf/src/test/resources/somedir/test-thymeleaf-template2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

8 |

9 |

10 | 11 | 12 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-thymeleaf/src/test/filesystemtemplates/test-thymeleaf-template3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

8 |

9 |

10 | 11 | 12 | -------------------------------------------------------------------------------- /vertx-web-common/src/main/asciidoc/enums.adoc: -------------------------------------------------------------------------------- 1 | = Enums 2 | 3 | [[AuthenticationType]] 4 | == AuthenticationType 5 | 6 | ++++ 7 | 8 | https://www.iana.org/assignments/http-authschemes/http-authschemes.xhtml 9 | ++++ 10 | ''' 11 | 12 | [cols=">25%,75%"] 13 | [frame="topbot"] 14 | |=== 15 | ^|Name | Description 16 | |[[BEARER]]`BEARER`|- 17 | |[[BASIC]]`BASIC`|- 18 | |[[DIGEST]]`DIGEST`|- 19 | |=== 20 | 21 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | trim_trailing_whitespace = true 8 | end_of_line = lf 9 | insert_final_newline = true 10 | 11 | [Makefile] 12 | indent_style = tab 13 | 14 | [**/examples/**.java] 15 | # 84 looks like a odd number, however 16 | # it accounts for 4 spaces (class and example method indentation) 17 | max_line_length = 84 18 | -------------------------------------------------------------------------------- /vertx-web-api-service/src/test/java/io/vertx/ext/web/api/service/BinaryTestService.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.api.service; 2 | 3 | import io.vertx.core.AsyncResult; 4 | import io.vertx.core.Future; 5 | import io.vertx.core.Handler; 6 | 7 | @WebApiServiceGen 8 | public interface BinaryTestService { 9 | 10 | @Deprecated 11 | Future binaryTest(final ServiceRequest request); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /vertx-web-graphql/vertx-web-graphiql/README.adoc: -------------------------------------------------------------------------------- 1 | = Vert.x Web GraphiQL 2 | 3 | This subproject creates a GraphiQL app for Vert.x Web GraphQL. 4 | 5 | [IMPORTANT] 6 | ==== 7 | If you modify `package.json` or source files, don't forget to build before saving changes to source control. 8 | 9 | [source,shell] 10 | ---- 11 | npm install 12 | npm run build 13 | node copy-to-resources.js 14 | ---- 15 | ==== 16 | 17 | -------------------------------------------------------------------------------- /vertx-web/tests/sockjs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "test": "jest" 4 | }, 5 | "jest": { 6 | "verbose": true, 7 | "preset": "jest-puppeteer" 8 | }, 9 | "devDependencies": { 10 | "babel-plugin-transform-es2015-modules-commonjs": "6.26.2", 11 | "jest": "24.8.0", 12 | "jest-puppeteer": "4.4.0", 13 | "puppeteer": "latest", 14 | "node-fetch": "2.6.7" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/test_json/schemas_test/test7_ok_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Francesco", 3 | "surname": "Guardiani", 4 | "id_card": "FG01", 5 | "father": { 6 | "name": "Francesco", 7 | "surname": "Guardiani", 8 | "id_card": "FG02", 9 | "father": { 10 | "name": "Francesco", 11 | "surname": "Guardiani", 12 | "id_card": "FG03" 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/test_json/schemas_test/test8_ok.json: -------------------------------------------------------------------------------- 1 | { 2 | "value": "Root", 3 | "children": [ 4 | { 5 | "value": "Leaf1", 6 | "children": [ 7 | { 8 | "value": "Leaf11", 9 | "parent": { 10 | "value": "Leaf1" 11 | } 12 | } 13 | ] 14 | }, 15 | { 16 | "value": "Leaf2" 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /vertx-web-validation/src/main/asciidoc/enums.adoc: -------------------------------------------------------------------------------- 1 | = Enums 2 | 3 | [[ParameterLocation]] 4 | == ParameterLocation 5 | 6 | ++++ 7 | ParameterLocation describe the location of parameter inside HTTP Request 8 | ++++ 9 | ''' 10 | 11 | [cols=">25%,75%"] 12 | [frame="topbot"] 13 | |=== 14 | ^|Name | Description 15 | |[[HEADER]]`HEADER`|- 16 | |[[QUERY]]`QUERY`|- 17 | |[[PATH]]`PATH`|- 18 | |[[COOKIE]]`COOKIE`|- 19 | |=== 20 | 21 | -------------------------------------------------------------------------------- /vertx-web-graphql/vertx-web-graphiql/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /vertx-web/src/main/java/io/vertx/ext/web/impl/UserContextInternal.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.impl; 2 | 3 | import io.vertx.ext.auth.User; 4 | import io.vertx.ext.web.UserContext; 5 | 6 | public interface UserContextInternal extends UserContext { 7 | 8 | /** 9 | * Set the user. Usually used by auth handlers to inject a User. You will not normally call this method. 10 | * 11 | * @param user the user 12 | */ 13 | void setUser(User user); 14 | } 15 | -------------------------------------------------------------------------------- /vertx-web/src/test/resources/login/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Please login {{foo}}


4 |
5 |
6 | 7 | 8 |
9 |
10 | 11 | 12 |
13 |
14 | 15 |
16 |
17 | 18 | 19 | -------------------------------------------------------------------------------- /vertx-web-graphql/start-apollo-tests-server.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | MSG="Apollo tests server started" 4 | 5 | mvn -am -pl vertx-web-graphql install -DskipTests 6 | mvn -pl vertx-web-graphql exec:java -Dexec.mainClass=io.vertx.ext.web.handler.graphql.ApolloTestsServer -Dexec.classpathScope=test > "${HOME}"/ApolloTestsServer.log 2>&1 & 7 | echo $! > "${HOME}"/ApolloTestsServer.pid 8 | ( tail -f "${HOME}"/ApolloTestsServer.log & ) | grep -q "${MSG}" 9 | echo "${MSG}" 10 | -------------------------------------------------------------------------------- /vertx-web/src/test/sockjs-protocol/unittest2/test/test_unittest2_with.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | import unittest2 4 | 5 | if sys.version_info[:2] >= (2, 5): 6 | from unittest2.test._test_unittest2_with import * 7 | else: 8 | 9 | class TestWith(unittest2.TestCase): 10 | 11 | @unittest2.skip('tests using with statement skipped on Python 2.4') 12 | def testWith(self): 13 | pass 14 | 15 | 16 | if __name__ == '__main__': 17 | unittest2.main() -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/yaml/valid/local_circular_refs.yaml: -------------------------------------------------------------------------------- 1 | openapi: 3.0.0 2 | info: 3 | version: 1.0.0 4 | title: Local circular relative refs 5 | paths: 6 | /simple: 7 | post: 8 | summary: Simple 9 | operationId: simple 10 | requestBody: 11 | content: 12 | application/json: 13 | schema: 14 | $ref: "refs/Circular.yaml" 15 | responses: 16 | 201: 17 | description: Created 18 | -------------------------------------------------------------------------------- /vertx-web-graphql/start-graphql-ws-tests-server.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | MSG="GraphQLWS tests server started" 4 | 5 | mvn -am -pl vertx-web-graphql install -DskipTests 6 | mvn -pl vertx-web-graphql exec:java -Dexec.mainClass=io.vertx.ext.web.handler.graphql.GraphQLWSTestsServer -Dexec.classpathScope=test > "${HOME}"/GraphQLWSTestsServer.log 2>&1 & 7 | echo $! > "${HOME}"/GraphQLWSTestsServer.pid 8 | ( tail -f "${HOME}"/GraphQLWSTestsServer.log & ) | grep -q "${MSG}" 9 | echo "${MSG}" 10 | -------------------------------------------------------------------------------- /vertx-web-validation/src/main/java/io/vertx/ext/web/validation/RequestPredicateException.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.validation; 2 | 3 | /** 4 | * Represents an error while trying to validate 5 | */ 6 | public class RequestPredicateException extends BadRequestException { 7 | 8 | public RequestPredicateException(String message) { 9 | super(message, null); 10 | } 11 | 12 | public RequestPredicateException(String message, Throwable cause) { 13 | super(message, cause); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .gradle 3 | .idea 4 | .classpath 5 | .project 6 | .settings 7 | .yardoc 8 | .yardopts 9 | build 10 | target 11 | out 12 | *.iml 13 | *.ipr 14 | *.iws 15 | test-output 16 | Scratch.java 17 | ScratchTest.java 18 | test-results 19 | test-tmp 20 | *.class 21 | src/gen 22 | src/main/resources/vertx-js/*.js 23 | src/test/resources/vertx-js/*.js 24 | .vertx 25 | file-uploads 26 | *.pyc 27 | .metadata/* 28 | .recommenders/* 29 | .vscode 30 | vertx-template-engines/vertx-web-templ-jte/jte-classes 31 | -------------------------------------------------------------------------------- /vertx-web/start-sockjs-write-handler-tests-server.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | MSG="SockJS writeHandler tests server started" 4 | 5 | mvn -am -pl vertx-web install -DskipTests 6 | mvn -pl vertx-web exec:java -Dexec.mainClass=io.vertx.ext.web.handler.sockjs.SockJSWriteHandlerTestServer -Dexec.classpathScope=test > "${HOME}"/SockJSWriteHandlerTestServer.log 2>&1 & 7 | echo $! > "${HOME}"/SockJSWriteHandlerTestServer.pid 8 | ( tail -f "${HOME}"/SockJSWriteHandlerTestServer.log & ) | grep -q "${MSG}" 9 | echo "${MSG}" 10 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-thymeleaf/src/test/resources/somedir/test-thymeleaf-fragmented.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |

10 | 11 | 12 | -------------------------------------------------------------------------------- /vertx-web-api-service/src/test/java/io/vertx/ext/web/api/service/generator/models/InvalidMissingHandler.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.api.service.generator.models; 2 | 3 | import io.vertx.ext.web.api.service.ServiceRequest; 4 | import io.vertx.ext.web.api.service.WebApiServiceGen; 5 | 6 | /** 7 | * @author Francesco Guardiani 8 | */ 9 | @WebApiServiceGen 10 | public interface InvalidMissingHandler { 11 | 12 | void someMethod(Integer id, ServiceRequest context); 13 | } 14 | -------------------------------------------------------------------------------- /vertx-web-validation/src/main/java/io/vertx/ext/web/validation/impl/body/BodyProcessor.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.validation.impl.body; 2 | 3 | import io.vertx.core.Future; 4 | import io.vertx.ext.web.RoutingContext; 5 | import io.vertx.ext.web.validation.RequestParameter; 6 | 7 | /** 8 | * Entry point for managing request bodies 9 | */ 10 | public interface BodyProcessor { 11 | 12 | boolean canProcess(String contentType); 13 | 14 | Future process(RoutingContext requestContext); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /vertx-web-graphql/src/test/resources/types.graphqls: -------------------------------------------------------------------------------- 1 | enum Musketeer { 2 | ATHOS 3 | PORTHOS 4 | ARAMIS 5 | } 6 | 7 | scalar Datetime 8 | 9 | type Person { 10 | name: String 11 | friend: Person 12 | } 13 | 14 | type Query { 15 | hello: String! 16 | number: Int! 17 | floating: Float! 18 | bool: Boolean! 19 | id: ID! 20 | enum: Musketeer! 21 | list: [String] 22 | array: [String] 23 | answer(name: String = "someone"): String 24 | when: Datetime 25 | changing: Int! 26 | persons: [Person] 27 | } 28 | -------------------------------------------------------------------------------- /vertx-web-graphql/tests/apollo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "test": "jest" 4 | }, 5 | "devDependencies": { 6 | "graphql": "16.6.0", 7 | "graphql-tag": "2.12.6", 8 | "@apollo/client": "3.7.4", 9 | "ws": "8.12.0", 10 | "subscriptions-transport-ws": "0.11.0", 11 | "apollo-upload-client": "17.0.0", 12 | "babel-plugin-transform-es2015-modules-commonjs": "6.26.2", 13 | "jest": "29.4.0" 14 | }, 15 | "dependencies": { 16 | "run": "1.4.0", 17 | "test": "3.2.1" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /vertx-web-validation/src/main/java/io/vertx/ext/web/validation/MalformedValueException.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.validation; 2 | 3 | import io.vertx.core.VertxException; 4 | 5 | /** 6 | * Represents a malformed value that parser is unable to manage 7 | */ 8 | public class MalformedValueException extends VertxException { 9 | 10 | public MalformedValueException(String message) { 11 | super(message); 12 | } 13 | 14 | public MalformedValueException(Throwable cause) { 15 | super(cause); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /vertx-web-api-service/src/test/resources/filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "object", 3 | "properties": { 4 | "from": { 5 | "type": "array", 6 | "items": { 7 | "type": "string", 8 | "format": "email" 9 | } 10 | }, 11 | "to": { 12 | "type": "array", 13 | "items": { 14 | "type": "string", 15 | "format": "email" 16 | } 17 | }, 18 | "message": { 19 | "type": "array", 20 | "items": { 21 | "type": "string" 22 | } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vertx-web-api-service/src/main/resources/META-INF/vertx/vertx-web-api-service-codegen/service_call_handler.txt: -------------------------------------------------------------------------------- 1 | res -> { 2 | if (res.failed()) { 3 | if (res.cause() instanceof ServiceException) { 4 | msg.reply(res.cause()); 5 | } else { 6 | msg.reply(new ServiceException(-1, res.cause().getMessage())); 7 | } 8 | } else { 9 | msg.reply(res.result() == null ? null : res.result().toJson()); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /vertx-web-graphql/vertx-web-graphiql/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | GraphiQL 8 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | -------------------------------------------------------------------------------- /vertx-web-validation/src/main/java/io/vertx/ext/web/validation/impl/parser/ArrayParser.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.validation.impl.parser; 2 | 3 | public abstract class ArrayParser { 4 | 5 | protected final ValueParser itemsParser; 6 | 7 | public ArrayParser(ValueParser itemsParser) { 8 | this.itemsParser = itemsParser; 9 | } 10 | 11 | protected Object parseValue(String v) { 12 | return mustNullateValue(v) ? null : itemsParser.parse(v); 13 | } 14 | 15 | protected abstract boolean mustNullateValue(String serialized); 16 | } 17 | -------------------------------------------------------------------------------- /vertx-web/src/main/java/io/vertx/ext/web/handler/impl/NOOPAuthenticationProvider.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.handler.impl; 2 | 3 | import io.vertx.core.Future; 4 | import io.vertx.ext.auth.User; 5 | import io.vertx.ext.auth.authentication.AuthenticationProvider; 6 | import io.vertx.ext.auth.authentication.Credentials; 7 | 8 | final class NOOPAuthenticationProvider implements AuthenticationProvider { 9 | @Override 10 | public Future authenticate(Credentials credentials) { 11 | return Future.failedFuture("NOOP Provider does not authenticate"); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /vertx-web-common/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | io.vertx 8 | vertx-web-parent 9 | 5.0.0-SNAPSHOT 10 | 11 | 12 | 4.0.0 13 | 14 | vertx-web-common 15 | 16 | 17 | -------------------------------------------------------------------------------- /vertx-web-graphql/src/main/resources/io/vertx/ext/web/handler/graphiql/index.html: -------------------------------------------------------------------------------- 1 | GraphiQL
-------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/schemas/address.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "An Address following the convention of http://microformats.org/wiki/hcard", 3 | "type": "object", 4 | "properties": { 5 | "post-office-box": { "type": "string" }, 6 | "extended-address": { "type": "string" }, 7 | "street-address": { "type": "string" }, 8 | "locality":{ "type": "string" }, 9 | "region": { "type": "string" }, 10 | "postal-code": { "type": "string" }, 11 | "country-name": { "type": "string"} 12 | }, 13 | "required": ["locality", "region", "country-name"] 14 | } 15 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/security_optional_test.yaml: -------------------------------------------------------------------------------- 1 | openapi: 3.0.0 2 | info: 3 | version: 1.0.0 4 | title: Test spec for RouterBuilderSecurityTest 5 | license: 6 | name: Apache 2.0 License 7 | paths: 8 | /pets: 9 | get: 10 | operationId: pets 11 | tags: 12 | - pets 13 | security: 14 | - api_key: [] 15 | - {} 16 | responses: 17 | 200: 18 | description: Something 19 | 20 | components: 21 | securitySchemes: 22 | api_key: 23 | type: apiKey 24 | name: api_key 25 | in: header 26 | -------------------------------------------------------------------------------- /vertx-web-openapi-router/src/test/resources/security/security_optional_test.yaml: -------------------------------------------------------------------------------- 1 | openapi: 3.0.0 2 | info: 3 | version: 1.0.0 4 | title: Test spec for RouterBuilderSecurityTest 5 | license: 6 | name: Apache 2.0 License 7 | paths: 8 | /pets: 9 | get: 10 | operationId: pets 11 | tags: 12 | - pets 13 | security: 14 | - api_key: [] 15 | - {} 16 | responses: 17 | 200: 18 | description: Something 19 | 20 | components: 21 | securitySchemes: 22 | api_key: 23 | type: apiKey 24 | name: api_key 25 | in: header 26 | -------------------------------------------------------------------------------- /vertx-web-validation/src/main/java/io/vertx/ext/web/validation/impl/ParameterLocation.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.validation.impl; 2 | 3 | import io.vertx.codegen.annotations.VertxGen; 4 | 5 | /** 6 | * ParameterLocation describe the location of parameter inside HTTP Request 7 | * 8 | * @author Francesco Guardiani @slinkydeveloper 9 | */ 10 | @VertxGen 11 | public enum ParameterLocation { 12 | HEADER, 13 | QUERY, 14 | PATH, 15 | COOKIE; 16 | 17 | public String lowerCaseIfNeeded(String parameterName) { 18 | return this == HEADER ? parameterName.toLowerCase() : parameterName; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /vertx-web-api-service/src/test/java/io/vertx/ext/web/api/service/generator/models/InvalidMissingContext.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.api.service.generator.models; 2 | 3 | import io.vertx.core.AsyncResult; 4 | import io.vertx.core.Handler; 5 | import io.vertx.ext.web.api.service.ServiceResponse; 6 | import io.vertx.ext.web.api.service.WebApiServiceGen; 7 | 8 | /** 9 | * @author Francesco Guardiani 10 | */ 11 | @WebApiServiceGen 12 | public interface InvalidMissingContext { 13 | 14 | void someMethod(Integer id, Handler> resultHandler); 15 | } 16 | -------------------------------------------------------------------------------- /vertx-web-api-service/src/test/java/io/vertx/ext/web/api/service/generator/models/InvalidWrongHandler.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.api.service.generator.models; 2 | 3 | import io.vertx.core.AsyncResult; 4 | import io.vertx.core.Handler; 5 | import io.vertx.ext.web.api.service.ServiceRequest; 6 | import io.vertx.ext.web.api.service.WebApiServiceGen; 7 | 8 | /** 9 | * @author Francesco Guardiani 10 | */ 11 | @WebApiServiceGen 12 | public interface InvalidWrongHandler { 13 | 14 | void someMethod(ServiceRequest context, Handler> resultHandler); 15 | } 16 | -------------------------------------------------------------------------------- /vertx-web-graphql/src/main/asciidoc/enums.adoc: -------------------------------------------------------------------------------- 1 | = Enums 2 | 3 | [[ApolloWSMessageType]] 4 | == ApolloWSMessageType 5 | 6 | ++++ 7 | The link types. 8 | ++++ 9 | ''' 10 | 11 | [cols=">25%,75%"] 12 | [frame="topbot"] 13 | |=== 14 | ^|Name | Description 15 | |[[CONNECTION_INIT]]`CONNECTION_INIT`|- 16 | |[[CONNECTION_TERMINATE]]`CONNECTION_TERMINATE`|- 17 | |[[START]]`START`|- 18 | |[[STOP]]`STOP`|- 19 | |[[CONNECTION_ACK]]`CONNECTION_ACK`|- 20 | |[[CONNECTION_ERROR]]`CONNECTION_ERROR`|- 21 | |[[CONNECTION_KEEP_ALIVE]]`CONNECTION_KEEP_ALIVE`|- 22 | |[[DATA]]`DATA`|- 23 | |[[ERROR]]`ERROR`|- 24 | |[[COMPLETE]]`COMPLETE`|- 25 | |=== 26 | 27 | -------------------------------------------------------------------------------- /vertx-web-validation/src/main/java/io/vertx/ext/web/validation/impl/parameter/ParameterParser.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.validation.impl.parameter; 2 | 3 | import io.vertx.codegen.annotations.Nullable; 4 | import io.vertx.ext.web.validation.MalformedValueException; 5 | 6 | import java.util.List; 7 | import java.util.Map; 8 | 9 | /** 10 | * This class extracts from parameter map the parameter and converts it to a json representation 11 | */ 12 | public interface ParameterParser extends Comparable { 13 | 14 | @Nullable Object parseParameter(Map> parameterValue) throws MalformedValueException; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /vertx-web-api-service/src/test/java/io/vertx/ext/web/api/service/FailureTestService.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.api.service; 2 | 3 | import io.vertx.core.AsyncResult; 4 | import io.vertx.core.Future; 5 | import io.vertx.core.Handler; 6 | import io.vertx.core.Vertx; 7 | 8 | @WebApiServiceGen 9 | public 10 | interface FailureTestService { 11 | 12 | @Deprecated 13 | Future testFailure(ServiceRequest context); 14 | 15 | @Deprecated 16 | Future testException(ServiceRequest context); 17 | 18 | static FailureTestService create(Vertx vertx) { 19 | return new FailureTestServiceImpl(vertx); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /vertx-web-client/src/main/java/examples/WebClientSessionExamples.java: -------------------------------------------------------------------------------- 1 | package examples; 2 | 3 | import io.vertx.core.Vertx; 4 | import io.vertx.ext.web.client.WebClient; 5 | import io.vertx.ext.web.client.WebClientSession; 6 | 7 | public class WebClientSessionExamples { 8 | 9 | public void create(Vertx vertx) { 10 | WebClient client = WebClient.create(vertx); 11 | WebClientSession session = WebClientSession.create(client); 12 | } 13 | 14 | public void setHeaders(WebClient client, String jwtToken) { 15 | WebClientSession session = WebClientSession.create(client); 16 | session.addHeader("my-jwt-token", jwtToken); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /vertx-web-validation/src/main/java/io/vertx/ext/web/validation/impl/validator/ValueValidator.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.validation.impl.validator; 2 | 3 | import io.vertx.core.Future; 4 | import io.vertx.ext.web.validation.RequestParameter; 5 | 6 | /** 7 | * A value validator asynchronously validates a Json value 8 | */ 9 | public interface ValueValidator { 10 | 11 | /** 12 | * Validate the provided {@code json} 13 | * 14 | * @param json 15 | * @return 16 | */ 17 | Future validate(Object json); 18 | 19 | /** 20 | * Get default value 21 | * 22 | * @return 23 | */ 24 | Future getDefault(); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /vertx-web-graphql/src/test/resources/singleUpload.txt: -------------------------------------------------------------------------------- 1 | ------WebKitFormBoundaryBpwmk50wSJmsTPAH 2 | Content-Disposition: form-data; name="operations" 3 | 4 | {"operationName":null,"variables":{"file":null},"query":"mutation ($file: Upload!) {\n singleUpload(file: $file) {\n id\n __typename\n }\n}\n"} 5 | ------WebKitFormBoundaryBpwmk50wSJmsTPAH 6 | Content-Disposition: form-data; name="map" 7 | 8 | {"1":["variables.file"]} 9 | ------WebKitFormBoundaryBpwmk50wSJmsTPAH 10 | Content-Disposition: form-data; name="1"; filename="a.txt" 11 | Content-Type: text/plain 12 | 13 | Alpha file content. 14 | 15 | ------WebKitFormBoundaryBpwmk50wSJmsTPAH-- 16 | 17 | -------------------------------------------------------------------------------- /vertx-web-validation/src/main/java/io/vertx/ext/web/validation/builder/BodyProcessorFactory.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.validation.builder; 2 | 3 | import io.vertx.codegen.annotations.GenIgnore; 4 | import io.vertx.codegen.annotations.VertxGen; 5 | import io.vertx.ext.web.validation.impl.body.BodyProcessor; 6 | import io.vertx.json.schema.SchemaParser; 7 | 8 | /** 9 | * This interface is used to build body processors.
10 | * 11 | * Look at {@link Bodies} for all available factories. 12 | */ 13 | @VertxGen 14 | public interface BodyProcessorFactory { 15 | 16 | @GenIgnore(GenIgnore.PERMITTED_TYPE) 17 | BodyProcessor create(SchemaParser parser); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/main/java/io/vertx/ext/web/openapi/impl/BodyProcessorGenerator.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.openapi.impl; 2 | 3 | import io.vertx.codegen.annotations.GenIgnore; 4 | import io.vertx.core.json.JsonObject; 5 | import io.vertx.core.json.pointer.JsonPointer; 6 | import io.vertx.ext.web.validation.impl.body.BodyProcessor; 7 | 8 | public interface BodyProcessorGenerator { 9 | 10 | boolean canGenerate(String mediaTypeName, JsonObject mediaTypeObject); 11 | 12 | @GenIgnore 13 | BodyProcessor generate( 14 | String mediaTypeName, 15 | JsonObject mediaTypeObject, 16 | JsonPointer mediaTypePointer, 17 | GeneratorContext context 18 | ); 19 | } 20 | -------------------------------------------------------------------------------- /vertx-web-graphql/src/main/java/io/vertx/ext/web/handler/graphql/ApolloWSConnectionInitEvent.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.handler.graphql; 2 | 3 | import io.vertx.codegen.annotations.CacheReturn; 4 | import io.vertx.codegen.annotations.VertxGen; 5 | import io.vertx.core.Promise; 6 | 7 | /** 8 | * @deprecated the subscriptions-transport-ws protocol is no longer maintained 9 | */ 10 | @VertxGen 11 | @Deprecated 12 | public interface ApolloWSConnectionInitEvent extends Promise { 13 | /** 14 | * Provides {@link ApolloWSMessageType#CONNECTION_INIT} message content. 15 | * 16 | * @return message 17 | */ 18 | @CacheReturn 19 | ApolloWSMessage message(); 20 | } 21 | -------------------------------------------------------------------------------- /vertx-web/src/test/sockjs-protocol/unittest2/__main__.py: -------------------------------------------------------------------------------- 1 | """Main entry point""" 2 | 3 | import sys 4 | if sys.argv[0].endswith("__main__.py"): 5 | import os.path 6 | # We change sys.argv[0] to make help message more useful 7 | # use executable without path, unquoted 8 | # (it's just a hint anyway) 9 | # (if you have spaces in your executable you get what you deserve!) 10 | executable = os.path.basename(sys.executable) 11 | sys.argv[0] = executable + " -m unittest2" 12 | del os 13 | 14 | __unittest = True 15 | 16 | from unittest2.main import main, TestProgram 17 | def main_(): 18 | main(module=None) 19 | 20 | if __name__=="__main__": 21 | main_() 22 | -------------------------------------------------------------------------------- /vertx-web-api-service/src/main/java/io/vertx/ext/web/api/service/WebApiServiceGen.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.api.service; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * Declares a Java interface type to be processed for generating a Java web api service that can be connected to the 10 | * original API via Vert.x event bus. 11 | * 12 | * @author Francesco Guardiani 13 | */ 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Target(ElementType.TYPE) 16 | public @interface WebApiServiceGen { } 17 | -------------------------------------------------------------------------------- /vertx-web-validation/src/main/java/io/vertx/ext/web/validation/builder/ArrayParserFactory.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.validation.builder; 2 | 3 | import io.vertx.codegen.annotations.GenIgnore; 4 | import io.vertx.codegen.annotations.VertxGen; 5 | import io.vertx.ext.web.validation.impl.parser.ValueParser; 6 | 7 | /** 8 | * This interface is used to create {@link ValueParser} able to parse serialized array structures.
9 | * 10 | * Look at {@link Parsers} for all available factories 11 | */ 12 | @VertxGen 13 | @FunctionalInterface 14 | public interface ArrayParserFactory { 15 | 16 | @GenIgnore(GenIgnore.PERMITTED_TYPE) 17 | ValueParser newArrayParser(ValueParser itemsParser); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/java/io/vertx/ext/web/openapi/asserts/MyAssertions.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.openapi.asserts; 2 | 3 | import io.vertx.core.json.JsonArray; 4 | import io.vertx.core.json.JsonObject; 5 | import io.vertx.ext.web.openapi.OpenAPIHolder; 6 | 7 | public class MyAssertions { 8 | 9 | public static JsonAssert assertThat(JsonObject actual) { return new JsonAssert(actual); } 10 | 11 | public static JsonAssert assertThat(JsonArray actual) { return new JsonAssert(actual); } 12 | 13 | public static OpenAPIHolderAssert assertThat(OpenAPIHolder actual) { 14 | return new OpenAPIHolderAssert(actual); 15 | } 16 | 17 | public static JsonAssert assertThatJson(Object actual) { return new JsonAssert(actual); } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /vertx-web/src/main/java/io/vertx/ext/web/MIMEHeader.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web; 2 | 3 | import io.vertx.codegen.annotations.VertxGen; 4 | 5 | @VertxGen 6 | public interface MIMEHeader extends ParsedHeaderValue{ 7 | 8 | /** 9 | * Gets the parsed component part of the MIME. This is the string between the beginning and the first {@code '/'} 10 | * of the MIME 11 | * @return The component of the MIME this represents 12 | */ 13 | String component(); 14 | 15 | /** 16 | * Gets the parsed subcomponent part of the MIME. This is the string between the first {@code '/'} and the 17 | * {@code ';'} or the end of the MIME 18 | * @return The subcomponent of the MIME this represents 19 | */ 20 | String subComponent(); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /vertx-web-api-service/src/test/java/io/vertx/ext/web/api/service/futures/FuturesService.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.api.service.futures; 2 | 3 | import io.vertx.core.Future; 4 | import io.vertx.ext.web.api.service.ServiceRequest; 5 | import io.vertx.ext.web.api.service.ServiceResponse; 6 | import io.vertx.ext.web.api.service.WebApiServiceGen; 7 | import io.vertx.ext.web.validation.RequestParameter; 8 | 9 | @WebApiServiceGen 10 | public interface FuturesService { 11 | 12 | Future testFutureWithRequestParameter(RequestParameter param, ServiceRequest context); 13 | 14 | Future testFutureWithIntParameter(int param, ServiceRequest context); 15 | 16 | Future testFuture(ServiceRequest context); 17 | } 18 | -------------------------------------------------------------------------------- /vertx-web-api-service/src/main/java/examples/TransactionService.java: -------------------------------------------------------------------------------- 1 | package examples; 2 | 3 | import io.vertx.core.AsyncResult; 4 | import io.vertx.core.Future; 5 | import io.vertx.core.Handler; 6 | import io.vertx.core.json.JsonObject; 7 | import io.vertx.ext.web.api.service.ServiceRequest; 8 | import io.vertx.ext.web.api.service.ServiceResponse; 9 | import io.vertx.ext.web.api.service.WebApiServiceGen; 10 | 11 | /** 12 | * @author Francesco Guardiani 13 | */ 14 | @WebApiServiceGen 15 | interface TransactionService { 16 | Future getTransactionsList(String from, String to, ServiceRequest context); 17 | Future putTransaction(JsonObject body, ServiceRequest context); 18 | } 19 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: 3 | workflow_call: 4 | inputs: 5 | branch: 6 | required: true 7 | type: string 8 | jdk: 9 | default: 8 10 | type: string 11 | os: 12 | default: ubuntu-latest 13 | type: string 14 | jobs: 15 | Test: 16 | name: Run tests 17 | runs-on: ${{ inputs.os }} 18 | steps: 19 | - name: Checkout 20 | uses: actions/checkout@v2 21 | with: 22 | ref: ${{ inputs.branch }} 23 | - name: Install JDK 24 | uses: actions/setup-java@v2 25 | with: 26 | java-version: ${{ inputs.jdk }} 27 | distribution: temurin 28 | - name: Run tests 29 | run: mvn -s .github/maven-ci-settings.xml clean verify -B 30 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/main/java/io/vertx/ext/web/openapi/RouteNamingStrategy.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.openapi; 2 | 3 | import io.vertx.codegen.annotations.VertxGen; 4 | 5 | import java.util.function.Function; 6 | 7 | /** 8 | * The way an OpenAPI operation is transformed into a route name. 9 | */ 10 | @VertxGen 11 | public enum RouteNamingStrategy implements Function { 12 | OPERATION_ID(Operation::getOperationId), 13 | OPERATION_OPENAPI_PATH(Operation::getOpenAPIPath); 14 | 15 | private final Function impl; 16 | 17 | RouteNamingStrategy(Function impl) { 18 | this.impl = impl; 19 | } 20 | 21 | @Override 22 | public String apply(Operation operation) { 23 | return impl.apply(operation); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vertx-web-validation/src/main/java/io/vertx/ext/web/validation/builder/TupleParserFactory.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.validation.builder; 2 | 3 | import io.vertx.codegen.annotations.GenIgnore; 4 | import io.vertx.codegen.annotations.VertxGen; 5 | import io.vertx.ext.web.validation.impl.parser.ValueParser; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * This interface is used to create {@link ValueParser} able to parse serialized object structures.
11 | * 12 | * Look at {@link Parsers} for all available factories 13 | */ 14 | @VertxGen 15 | @FunctionalInterface 16 | public interface TupleParserFactory { 17 | 18 | @GenIgnore(GenIgnore.PERMITTED_TYPE) 19 | ValueParser newTupleParser(List> itemsParser, ValueParser additionalItemsParser); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /vertx-web-api-service/src/test/java/io/vertx/ext/web/api/service/generator/models/futures/ValidWebApiProxyWithFutures.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.api.service.generator.models.futures; 2 | 3 | import io.vertx.core.Future; 4 | import io.vertx.ext.web.api.service.ServiceRequest; 5 | import io.vertx.ext.web.api.service.ServiceResponse; 6 | import io.vertx.ext.web.api.service.WebApiServiceGen; 7 | import io.vertx.ext.web.validation.RequestParameter; 8 | 9 | @WebApiServiceGen 10 | public interface ValidWebApiProxyWithFutures { 11 | 12 | Future testFutureWithRequestParameter(RequestParameter param, ServiceRequest context); 13 | 14 | Future testFutureWithParam(String param, ServiceRequest context); 15 | 16 | Future testFuture(ServiceRequest context); 17 | } 18 | -------------------------------------------------------------------------------- /vertx-web-validation/src/main/java/io/vertx/ext/web/validation/impl/RequestPredicateResultImpl.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.validation.impl; 2 | 3 | import io.vertx.codegen.annotations.VertxGen; 4 | import io.vertx.ext.web.validation.RequestPredicateResult; 5 | 6 | /** 7 | * Data object representing a Request predicate result 8 | */ 9 | @VertxGen 10 | public class RequestPredicateResultImpl implements RequestPredicateResult { 11 | 12 | private String errorMessage; 13 | 14 | public RequestPredicateResultImpl(String errorMessage) { 15 | this.errorMessage = errorMessage; 16 | } 17 | 18 | @Override 19 | public boolean succeeded() { 20 | return errorMessage == null; 21 | } 22 | 23 | @Override 24 | public String getErrorMessage() { 25 | return errorMessage; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/test_order_spec.yaml: -------------------------------------------------------------------------------- 1 | openapi: 3.0.0 2 | info: 3 | version: 1.0.0 4 | title: Test spec for OpenAPI3RouterBuilderTest.mountHandlersOrderTest() 5 | paths: 6 | /product/special: 7 | get: 8 | summary: Get special product 9 | operationId: showSpecialProduct 10 | responses: 11 | default: 12 | description: ok 13 | /product/{id}: 14 | get: 15 | summary: Product detail 16 | operationId: showProductById 17 | parameters: 18 | - name: id 19 | in: path 20 | required: true 21 | description: The id of the product to retrieve 22 | schema: 23 | type: integer 24 | format: int32 25 | responses: 26 | default: 27 | description: ok 28 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/yaml/valid/local_refs.yaml: -------------------------------------------------------------------------------- 1 | openapi: 3.0.0 2 | info: 3 | version: 1.0.0 4 | title: Local relative refs 5 | paths: 6 | /simple: 7 | post: 8 | summary: Simple 9 | operationId: simple 10 | requestBody: 11 | content: 12 | multipart/form-data: 13 | schema: 14 | $ref: "#/components/schemas/Simple" 15 | responses: 16 | 201: 17 | description: Created 18 | default: 19 | $ref: "#/components/responses/DefaultError" 20 | 21 | components: 22 | schemas: 23 | Simple: 24 | $ref: "refs/Simple.yaml" 25 | responses: 26 | DefaultError: 27 | description: unexpected error 28 | content: 29 | text/plain: 30 | schema: 31 | type: string 32 | -------------------------------------------------------------------------------- /vertx-web-api-service/src/main/java/io/vertx/ext/web/api/service/generator/WebApiProxyGenLoader.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.api.service.generator; 2 | 3 | import io.vertx.codegen.Generator; 4 | import io.vertx.codegen.GeneratorLoader; 5 | import io.vertx.serviceproxy.generator.GeneratorUtils; 6 | 7 | import javax.annotation.processing.ProcessingEnvironment; 8 | import java.util.stream.Stream; 9 | 10 | /** 11 | * @author Francesco Guardiani @slinkydeveloper 12 | */ 13 | public class WebApiProxyGenLoader implements GeneratorLoader { 14 | 15 | @Override 16 | public Stream> loadGenerators(ProcessingEnvironment processingEnv) { 17 | GeneratorUtils utils = new GeneratorUtils(); 18 | return Stream.of(new WebApiProxyHandlerGen(utils)); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/main/java/io/vertx/ext/web/openapi/impl/SchemaHolder.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.openapi.impl; 2 | 3 | import io.vertx.codegen.annotations.GenIgnore; 4 | import io.vertx.core.json.JsonObject; 5 | import io.vertx.core.json.pointer.JsonPointer; 6 | import io.vertx.ext.web.validation.impl.validator.SchemaValidator; 7 | 8 | public interface SchemaHolder { 9 | 10 | JsonObject getOriginalSchema(); 11 | 12 | JsonObject getNormalizedSchema(); 13 | 14 | /** 15 | * The result of this function creates a schema with different semantics, so don't use it! 16 | * It's useful for ValueParser inference only 17 | * 18 | * @return 19 | */ 20 | JsonObject getFakeSchema(); 21 | 22 | JsonPointer getSchemaPointer(); 23 | 24 | @GenIgnore 25 | SchemaValidator getValidator(); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/yaml/invalid/local_refs.yaml: -------------------------------------------------------------------------------- 1 | openapi: 3.0.0 2 | info: 3 | version: 1.0.0 4 | title: Local relative refs 5 | paths: 6 | /simple: 7 | post: 8 | summary: Simple 9 | operationId: simple 10 | requestBody: 11 | content: 12 | multipart/form-data: 13 | schema: 14 | $ref: "#/components/schemas/Simple" 15 | responses: 16 | 201: 17 | description: Created 18 | default: 19 | $ref: "#/components/responses/DefaultError" 20 | 21 | components: 22 | schemas: 23 | Simple: 24 | $ref: "refs/Simple.yaml" 25 | responses: 26 | DefaultError: 27 | description: unexpected error 28 | content: 29 | text/plain: 30 | schema: 31 | type: string 32 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/main/java/io/vertx/ext/web/openapi/impl/ParameterProcessorGenerator.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.openapi.impl; 2 | 3 | import io.vertx.core.json.JsonObject; 4 | import io.vertx.core.json.pointer.JsonPointer; 5 | import io.vertx.ext.web.validation.impl.ParameterLocation; 6 | import io.vertx.ext.web.validation.impl.parameter.ParameterProcessor; 7 | 8 | public interface ParameterProcessorGenerator { 9 | 10 | boolean canGenerate(JsonObject parameter, JsonObject fakeParameterSchema, ParameterLocation parsedLocation, String parsedStyle); 11 | 12 | ParameterProcessor generate( 13 | JsonObject parameter, 14 | JsonObject fakeParameterSchema, 15 | JsonPointer parameterPointer, 16 | ParameterLocation parsedLocation, 17 | String parsedStyle, 18 | GeneratorContext context 19 | ); 20 | } 21 | -------------------------------------------------------------------------------- /vertx-web-session-stores/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | 8 | io.vertx 9 | vertx-web-parent 10 | 5.0.0-SNAPSHOT 11 | 12 | 13 | vertx-web-session-stores 14 | pom 15 | 16 | 17 | true 18 | 19 | 20 | 21 | vertx-web-sstore-cookie 22 | vertx-web-sstore-redis 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/java/io/vertx/ext/web/openapi/service/PathExtensionTestService.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.openapi.service; 2 | 3 | import io.vertx.codegen.annotations.VertxGen; 4 | import io.vertx.core.AsyncResult; 5 | import io.vertx.core.Future; 6 | import io.vertx.core.Handler; 7 | import io.vertx.ext.web.api.service.ServiceRequest; 8 | import io.vertx.ext.web.api.service.ServiceResponse; 9 | import io.vertx.ext.web.api.service.WebApiServiceGen; 10 | 11 | @WebApiServiceGen 12 | @VertxGen 13 | public interface PathExtensionTestService { 14 | Future pathLevelGet(ServiceRequest context); 15 | 16 | Future getPathLevel(ServiceRequest context); 17 | 18 | Future pathLevelPost(ServiceRequest context); 19 | 20 | Future postPathLevel(ServiceRequest context); 21 | } 22 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/test_json/schemas_test/test6_fail.json: -------------------------------------------------------------------------------- 1 | { 2 | "familyName": "sit qui", 3 | "givenName": "sit exercitation Duis", 4 | "fn": "voluptate Ut exercitation ut enim", 5 | "additionalName": [ 6 | "elit ulla", 7 | "officia quis sint consequat", 8 | "mollit ipsum" 9 | ], 10 | "honorificPrefix": [ 11 | "ut Excepteur" 12 | ], 13 | "honorificSuffix": [ 14 | "voluptate do consectetur" 15 | ], 16 | "nickname": "aliquip magna adipisicing irure", 17 | "url": "Gi3E", 18 | "email": { 19 | "type": "dolor dolor", 20 | "value": "kEBULxiNAbfUSqj@P.qe" 21 | }, 22 | "org": {}, 23 | "geo": { 24 | "longitude": 63766244.90001288 25 | }, 26 | "adr": { 27 | "locality": "sunt consequat", 28 | "region": "tempor ipsum eu", 29 | "country-name": "amet" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/yaml/valid/simple_spec.yaml: -------------------------------------------------------------------------------- 1 | openapi: 3.0.0 2 | info: 3 | version: 1.0.0 4 | title: Simple spec no $refs 5 | paths: 6 | /simple: 7 | post: 8 | summary: Simple 9 | operationId: simple 10 | requestBody: 11 | content: 12 | multipart/form-data: 13 | schema: 14 | type: object 15 | properties: 16 | fileName: 17 | type: string 18 | format: binary 19 | encoding: 20 | fileName: 21 | contentType: text/plain 22 | responses: 23 | 201: 24 | description: Created 25 | default: 26 | description: unexpected error 27 | content: 28 | text/plain: 29 | schema: 30 | type: string 31 | -------------------------------------------------------------------------------- /vertx-web-proxy/src/main/java/io/vertx/ext/web/proxy/handler/impl/ProxyHandlerImpl.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.proxy.handler.impl; 2 | 3 | import io.vertx.ext.web.RoutingContext; 4 | import io.vertx.ext.web.proxy.handler.ProxyHandler; 5 | import io.vertx.httpproxy.HttpProxy; 6 | 7 | /** 8 | * @author Emad Alblueshi 9 | */ 10 | 11 | public class ProxyHandlerImpl implements ProxyHandler { 12 | 13 | private final HttpProxy httpProxy; 14 | 15 | public ProxyHandlerImpl(HttpProxy httpProxy) { 16 | this.httpProxy = httpProxy; 17 | } 18 | 19 | public ProxyHandlerImpl(HttpProxy httpProxy, int port, String host) { 20 | this.httpProxy = httpProxy.origin(port, host); 21 | } 22 | 23 | @Override 24 | public void handle(RoutingContext ctx) { 25 | httpProxy.handle(ctx.request()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vertx-web-validation/src/main/java/io/vertx/ext/web/validation/RequestPredicateResult.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.validation; 2 | 3 | import io.vertx.codegen.annotations.VertxGen; 4 | import io.vertx.ext.web.validation.impl.RequestPredicateResultImpl; 5 | 6 | /** 7 | * Result of a {@link RequestPredicate} 8 | */ 9 | @VertxGen 10 | public interface RequestPredicateResult { 11 | 12 | /** 13 | * Predicate succeeded 14 | * 15 | * @return 16 | */ 17 | boolean succeeded(); 18 | 19 | /** 20 | * Get error of failure 21 | * 22 | * @return 23 | */ 24 | String getErrorMessage(); 25 | 26 | static RequestPredicateResult success() { 27 | return new RequestPredicateResultImpl(null); 28 | } 29 | 30 | static RequestPredicateResult failed(String message) { 31 | return new RequestPredicateResultImpl(message); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vertx-web-graphql/src/main/java/examples/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Red Hat, Inc. 3 | * 4 | * Red Hat licenses this file to you under the Apache License, version 2.0 5 | * (the "License"); you may not use this file except in compliance with the 6 | * License. You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | /** 18 | * @author Thomas Segismont 19 | */ 20 | @Source 21 | package examples; 22 | 23 | import io.vertx.docgen.Source; 24 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/main/java/io/vertx/ext/web/openapi/OpenAPIHolder.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.openapi; 2 | 3 | import io.vertx.codegen.annotations.VertxGen; 4 | import io.vertx.core.json.JsonObject; 5 | import io.vertx.core.json.pointer.JsonPointer; 6 | 7 | @VertxGen 8 | public interface OpenAPIHolder { 9 | 10 | /** 11 | * Get cached object using {@code pointer} 12 | * 13 | * @param pointer 14 | * @return 15 | */ 16 | JsonObject getCached(JsonPointer pointer); 17 | 18 | /** 19 | * if {@code obj} contains {@code $ref}, it tries to solve it and return the resolved object, otherwise it returns {@code obj} 20 | * 21 | * @param obj 22 | * @return 23 | */ 24 | JsonObject solveIfNeeded(JsonObject obj); 25 | 26 | /** 27 | * @return the root of the OpenAPI document 28 | */ 29 | JsonObject getOpenAPI(); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/yaml/invalid/simple_spec.yaml: -------------------------------------------------------------------------------- 1 | openapi: 3.0.0 2 | info: 3 | version: 1.0.0 4 | title: Simple invalid spec no $refs 5 | paths: 6 | /simple: 7 | post: 8 | summary: Simple 9 | operationId: simple 10 | requestBody: 11 | content: 12 | multipart/form-data: 13 | schema: 14 | type: object 15 | properties: 16 | fileName: 17 | type: 1 18 | format: binary 19 | encoding: 20 | fileName: 21 | contentType: text/plain 22 | responses: 23 | 201: 24 | description: Created 25 | default: 26 | description: unexpected error 27 | content: 28 | text/plain: 29 | schema: 30 | type: string 31 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/local_refs_in_jar.yaml: -------------------------------------------------------------------------------- 1 | openapi: 3.0.0 2 | info: 3 | version: 1.0.0 4 | title: Local relative refs 5 | paths: 6 | /simple: 7 | post: 8 | summary: Simple 9 | operationId: simple 10 | requestBody: 11 | content: 12 | multipart/form-data: 13 | schema: 14 | $ref: "#/components/schemas/Simple" 15 | responses: 16 | 201: 17 | description: Created 18 | default: 19 | $ref: "#/components/responses/DefaultError" 20 | 21 | components: 22 | schemas: 23 | Simple: 24 | # this is inside a loaded jar 25 | $ref: "my_fancy_resources/refs/Simple.yaml" 26 | responses: 27 | DefaultError: 28 | description: unexpected error 29 | content: 30 | text/plain: 31 | schema: 32 | type: string 33 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/test_json/schemas_test/test6_ok.json: -------------------------------------------------------------------------------- 1 | { 2 | "familyName": "sit qui", 3 | "givenName": "sit exercitation Duis", 4 | "fn": "voluptate Ut exercitation ut enim", 5 | "additionalName": [ 6 | "elit ulla", 7 | "officia quis sint consequat", 8 | "mollit ipsum" 9 | ], 10 | "honorificPrefix": [ 11 | "ut Excepteur" 12 | ], 13 | "honorificSuffix": [ 14 | "voluptate do consectetur" 15 | ], 16 | "nickname": "aliquip magna adipisicing irure", 17 | "url": "http://hello.com", 18 | "email": { 19 | "type": "dolor dolor", 20 | "value": "fake@vertx.com" 21 | }, 22 | "org": {}, 23 | "geo": { 24 | "longitude": 63766244.900 25 | }, 26 | "adr": { 27 | "locality": "sunt consequat", 28 | "region": "tempor ipsum eu", 29 | "country-name": "amet" 30 | }, 31 | "id_card": "000" 32 | } 33 | -------------------------------------------------------------------------------- /vertx-web-validation/src/main/java/io/vertx/ext/web/validation/builder/StyledParameterProcessorFactory.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.validation.builder; 2 | 3 | import io.vertx.codegen.annotations.GenIgnore; 4 | import io.vertx.codegen.annotations.VertxGen; 5 | import io.vertx.ext.web.validation.impl.ParameterLocation; 6 | import io.vertx.ext.web.validation.impl.parameter.ParameterProcessor; 7 | import io.vertx.json.schema.SchemaParser; 8 | 9 | /** 10 | * This interface is used to build complex parameter processors supported only in cookie & query.
11 | * 12 | * Look at {@link Parameters} for all available factories 13 | */ 14 | @VertxGen 15 | @FunctionalInterface 16 | public interface StyledParameterProcessorFactory { 17 | 18 | @GenIgnore(GenIgnore.PERMITTED_TYPE) 19 | ParameterProcessor create(ParameterLocation location, SchemaParser parser); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /vertx-web-openapi-router/src/test/resources/security/security_optional_callbackaware.yaml: -------------------------------------------------------------------------------- 1 | openapi: 3.0.0 2 | info: 3 | version: 1.0.0 4 | title: Test spec for RouterBuilderSecurityTest 5 | license: 6 | name: Apache 2.0 License 7 | paths: 8 | /a: 9 | get: 10 | operationId: opA 11 | tags: 12 | - pets 13 | security: 14 | - oidc: ['read'] 15 | - {} 16 | responses: 17 | 200: 18 | description: Something 19 | /b: 20 | get: 21 | operationId: opB 22 | tags: 23 | - pets 24 | security: 25 | - {} 26 | - oidc: ['read'] 27 | responses: 28 | 200: 29 | description: Something 30 | 31 | components: 32 | securitySchemes: 33 | oidc: 34 | type: openIdConnect 35 | openIdConnectUrl: https://example.com/.well-known/openid-configuration 36 | -------------------------------------------------------------------------------- /vertx-web-api-service/src/test/java/io/vertx/ext/web/api/service/BinaryTestServiceImpl.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.api.service; 2 | 3 | import io.vertx.core.AsyncResult; 4 | import io.vertx.core.Future; 5 | import io.vertx.core.Handler; 6 | import io.vertx.core.MultiMap; 7 | import io.vertx.core.buffer.Buffer; 8 | 9 | public class BinaryTestServiceImpl implements BinaryTestService { 10 | 11 | @Override 12 | public Future binaryTest(ServiceRequest request) { 13 | final Buffer buffer = Buffer.buffer(new byte[] {(byte) 0xb0}); 14 | return 15 | Future.succeededFuture( 16 | new ServiceResponse( 17 | 200, 18 | "OK", 19 | buffer, 20 | MultiMap 21 | .caseInsensitiveMultiMap() 22 | .add("content-type", "application/octet-stream") 23 | ) 24 | ) 25 | ; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /vertx-web-validation/src/main/java/io/vertx/ext/web/validation/builder/ObjectParserFactory.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.validation.builder; 2 | 3 | import io.vertx.codegen.annotations.GenIgnore; 4 | import io.vertx.codegen.annotations.VertxGen; 5 | import io.vertx.ext.web.validation.impl.parser.ValueParser; 6 | 7 | import java.util.Map; 8 | import java.util.regex.Pattern; 9 | 10 | /** 11 | * This interface is used to create {@link ValueParser} able to parse serialized object structures.
12 | * 13 | * Look at {@link Parsers} for all available factories 14 | */ 15 | @VertxGen 16 | @FunctionalInterface 17 | public interface ObjectParserFactory { 18 | 19 | @GenIgnore 20 | ValueParser newObjectParser(Map> propertiesParser, Map> patternPropertiesParser, ValueParser additionalPropertiesParser); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /vertx-web-graphql/src/test/resources/multipleUpload.txt: -------------------------------------------------------------------------------- 1 | ------WebKitFormBoundaryhvb6BzAACEqQKt0Z 2 | Content-Disposition: form-data; name="operations" 3 | 4 | {"operationName":null,"variables":{"files":[null,null]},"query":"mutation ($files: [Upload!]!) {\n multipleUpload(files: $files) {\n id\n __typename\n }\n}\n"} 5 | ------WebKitFormBoundaryhvb6BzAACEqQKt0Z 6 | Content-Disposition: form-data; name="map" 7 | 8 | {"1":["variables.files.0"],"2":["variables.files.1"]} 9 | ------WebKitFormBoundaryhvb6BzAACEqQKt0Z 10 | Content-Disposition: form-data; name="1"; filename="b.txt" 11 | Content-Type: text/plain 12 | 13 | Bravo file content. 14 | 15 | ------WebKitFormBoundaryhvb6BzAACEqQKt0Z 16 | Content-Disposition: form-data; name="2"; filename="c.txt" 17 | Content-Type: text/plain 18 | 19 | Charlie file content. 20 | 21 | ------WebKitFormBoundaryhvb6BzAACEqQKt0Z-- 22 | 23 | -------------------------------------------------------------------------------- /vertx-web-api-service/src/main/java/examples/TransactionServiceImpl.java: -------------------------------------------------------------------------------- 1 | package examples; 2 | 3 | import io.vertx.core.AsyncResult; 4 | import io.vertx.core.Future; 5 | import io.vertx.core.Handler; 6 | import io.vertx.core.json.JsonObject; 7 | import io.vertx.ext.web.api.service.ServiceRequest; 8 | import io.vertx.ext.web.api.service.ServiceResponse; 9 | 10 | /** 11 | * @author Francesco Guardiani 12 | */ 13 | public class TransactionServiceImpl implements TransactionService { 14 | 15 | @Override 16 | public Future getTransactionsList(String from, String to, ServiceRequest context) { 17 | throw new UnsupportedOperationException(); 18 | } 19 | 20 | @Override 21 | public Future putTransaction(JsonObject body, ServiceRequest context) { 22 | throw new UnsupportedOperationException(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/upload_test.yaml: -------------------------------------------------------------------------------- 1 | openapi: 3.0.0 2 | info: 3 | version: 1.0.0 4 | title: Test spec for OpenAPI3RouterBuilderTest.customBodyHandlerTest() 5 | paths: 6 | /upload: 7 | post: 8 | summary: Uploads a file 9 | operationId: upload 10 | requestBody: 11 | content: 12 | multipart/form-data: 13 | schema: 14 | type: object 15 | properties: 16 | fileName: 17 | type: string 18 | format: binary 19 | encoding: 20 | fileName: 21 | contentType: text/plain 22 | responses: 23 | 201: 24 | description: Created 25 | default: 26 | description: unexpected error 27 | content: 28 | text/plain: 29 | schema: 30 | type: string 31 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/yaml/invalid/inner_refs.yaml: -------------------------------------------------------------------------------- 1 | openapi: 3.0.0 2 | info: 3 | version: 1.0.0 4 | title: Simple spec with $refs 5 | paths: 6 | /simple: 7 | post: 8 | summary: Simple 9 | operationId: simple 10 | requestBody: 11 | content: 12 | multipart/form-data: 13 | schema: 14 | $ref: "#/components/schemas/Simple" 15 | responses: 16 | 201: 17 | description: Created 18 | default: 19 | $ref: "#/components/responses/DefaultError" 20 | 21 | components: 22 | schemas: 23 | Simple: 24 | type: object 25 | properties: 26 | fileName: 27 | type: 1 28 | format: binary 29 | responses: 30 | DefaultError: 31 | description: unexpected error 32 | content: 33 | text/plain: 34 | schema: 35 | type: string 36 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/yaml/valid/inner_refs.yaml: -------------------------------------------------------------------------------- 1 | openapi: 3.0.0 2 | info: 3 | version: 1.0.0 4 | title: Local inner ref spec 5 | paths: 6 | /simple: 7 | post: 8 | summary: Simple 9 | operationId: simple 10 | requestBody: 11 | content: 12 | multipart/form-data: 13 | schema: 14 | $ref: "#/components/schemas/Simple" 15 | responses: 16 | 201: 17 | description: Created 18 | default: 19 | $ref: "#/components/responses/DefaultError" 20 | 21 | components: 22 | schemas: 23 | Simple: 24 | type: object 25 | properties: 26 | fileName: 27 | type: string 28 | format: binary 29 | responses: 30 | DefaultError: 31 | description: unexpected error 32 | content: 33 | text/plain: 34 | schema: 35 | type: string 36 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/test_json/schemas_test/test9_fail.json: -------------------------------------------------------------------------------- 1 | { 2 | "familyName": "sit qui", 3 | "givenName": "sit exercitation Duis", 4 | "fn": "voluptate Ut exercitation ut enim", 5 | "additionalName": [ 6 | "elit ulla", 7 | "officia quis sint consequat", 8 | "mollit ipsum" 9 | ], 10 | "honorificPrefix": [ 11 | "ut Excepteur" 12 | ], 13 | "honorificSuffix": [ 14 | "voluptate do consectetur" 15 | ], 16 | "nickname": "aliquip magna adipisicing irure", 17 | "url": "http://Gi3E.com", 18 | "email": { 19 | "type": "dolor dolor", 20 | "value": "kEBULxiNAbfUSqj@P.qe" 21 | }, 22 | "org": {}, 23 | "geo": { 24 | "longitude": 63766244.90001288 25 | }, 26 | "adr": { 27 | "locality": "sunt consequat", 28 | "region": "tempor ipsum eu", 29 | "country-name": "amet" 30 | }, 31 | "id_card": "000", 32 | "parent_card": "aaa" 33 | } 34 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/java/io/vertx/ext/web/openapi/it/persistence/TransactionPersistence.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.openapi.it.persistence; 2 | 3 | import java.util.List; 4 | import java.util.Optional; 5 | import java.util.function.Predicate; 6 | 7 | import io.vertx.ext.web.openapi.it.models.Transaction; 8 | import io.vertx.ext.web.openapi.it.persistence.impl.TransactionPersistenceImpl; 9 | 10 | public interface TransactionPersistence { 11 | 12 | static TransactionPersistence create(){return new TransactionPersistenceImpl(); 13 | } 14 | 15 | List getFilteredTransactions(Predicate predicate); 16 | 17 | Optional getTransaction (String transactionId); 18 | 19 | Transaction addTransaction(Transaction transaction); 20 | 21 | boolean updateTransaction(String transactionId, Transaction transaction); 22 | 23 | boolean removeTransaction(String transactionId); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /.github/workflows/ci-4.x.yml: -------------------------------------------------------------------------------- 1 | name: vertx-web (4.x) 2 | on: 3 | schedule: 4 | - cron: '0 4 * * *' 5 | jobs: 6 | CI: 7 | strategy: 8 | matrix: 9 | include: 10 | - os: ubuntu-latest 11 | jdk: 8 12 | - os: ubuntu-latest 13 | jdk: 17 14 | - os: windows-latest 15 | jdk: 8 16 | uses: ./.github/workflows/ci.yml 17 | with: 18 | branch: 4.x 19 | jdk: ${{ matrix.jdk }} 20 | os: ${{ matrix.os }} 21 | secrets: inherit 22 | IT: 23 | uses: ./.github/workflows/it.yml 24 | with: 25 | branch: 4.x 26 | jdk: 8 27 | secrets: inherit 28 | Deploy: 29 | if: ${{ github.repository_owner == 'vert-x3' && (github.event_name == 'push' || github.event_name == 'schedule') }} 30 | needs: [CI, IT] 31 | uses: ./.github/workflows/deploy.yml 32 | with: 33 | branch: 4.x 34 | jdk: 8 35 | secrets: inherit 36 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/main/java/io/vertx/ext/web/openapi/impl/OpenAPIYamlConstructor.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.openapi.impl; 2 | 3 | import org.yaml.snakeyaml.LoaderOptions; 4 | import org.yaml.snakeyaml.constructor.SafeConstructor; 5 | import org.yaml.snakeyaml.nodes.Node; 6 | import org.yaml.snakeyaml.nodes.Tag; 7 | 8 | import java.util.Date; 9 | 10 | public class OpenAPIYamlConstructor extends SafeConstructor { 11 | 12 | private static final LoaderOptions DEFAULT_OPTIONS = new LoaderOptions(); 13 | 14 | public OpenAPIYamlConstructor() { 15 | super(DEFAULT_OPTIONS); 16 | this.yamlConstructors.put(Tag.TIMESTAMP, new ConstructInstantTimestamp()); 17 | } 18 | 19 | private static class ConstructInstantTimestamp extends SafeConstructor.ConstructYamlTimestamp { 20 | public Object construct(Node node) { 21 | Date date = (Date) super.construct(node); 22 | return date.toInstant(); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vertx-web-validation/src/main/java/io/vertx/ext/web/validation/impl/body/FormValueParser.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.validation.impl.body; 2 | 3 | import io.vertx.core.json.JsonArray; 4 | import io.vertx.ext.web.validation.impl.parser.ValueParser; 5 | 6 | import java.util.List; 7 | 8 | public class FormValueParser implements ValueParser> { 9 | 10 | private boolean expectedArray; 11 | private ValueParser innerValueParser; 12 | 13 | public FormValueParser(boolean expectedArray, ValueParser innerValueParser) { 14 | this.expectedArray = expectedArray; 15 | this.innerValueParser = innerValueParser; 16 | } 17 | 18 | public Object parse(List values) { 19 | if (expectedArray) 20 | return values.stream().map(innerValueParser::parse).collect(JsonArray::new, JsonArray::add, JsonArray::addAll); 21 | else 22 | return innerValueParser.parse(values.get(0)); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /vertx-web-graphql/src/main/java/io/vertx/ext/web/handler/graphql/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Red Hat, Inc. 3 | * 4 | * Red Hat licenses this file to you under the Apache License, version 2.0 5 | * (the "License"); you may not use this file except in compliance with the 6 | * License. You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | @ModuleGen(name = "vertx-web-graphql", groupPackage = "io.vertx", useFutures = true) 18 | package io.vertx.ext.web.handler.graphql; 19 | 20 | import io.vertx.codegen.annotations.ModuleGen; 21 | -------------------------------------------------------------------------------- /vertx-web-graphql/src/main/resources/io/vertx/ext/web/handler/graphiql/static/js/842.e96bbe62.chunk.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkvertx_web_graphiql=self.webpackChunkvertx_web_graphiql||[]).push([[842],{2842:function(e,t,n){n.r(t);var i=n(1003),r=n(2369),a=(n(4507),n(7313),n(1168),Object.defineProperty),l=function(e,t){return a(e,"name",{value:t,configurable:!0})};function o(e,t){var n,i,r=e.levels;return((r&&0!==r.length?r[r.length-1]-((null===(n=this.electricInput)||void 0===n?void 0:n.test(t))?1:0):e.indentLevel)||0)*((null===(i=this.config)||void 0===i?void 0:i.indentUnit)||0)}l(o,"indent");var c=l((function(e){var t=(0,r.o)({eatWhitespace:function(e){return e.eatWhile(r.i)},lexRules:r.L,parseRules:r.P,editorConfig:{tabSize:e.tabSize}});return{config:e,startState:t.startState,token:t.token,indent:o,electricInput:/^\s*[})\]]/,fold:"brace",lineComment:"#",closeBrackets:{pairs:'()[]{}""',explode:"()[]{}"}}}),"graphqlModeFactory");i.C.defineMode("graphql",c)}}]); -------------------------------------------------------------------------------- /vertx-web/src/test/sockjs-protocol/ws4py/exc.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | __all__ = ['WebSocketException', 'FrameTooLargeException', 'ProtocolException', 4 | 'UnsupportedFrameTypeException', 'TextFrameEncodingException', 5 | 'UnsupportedFrameTypeException', 'TextFrameEncodingException', 6 | 'StreamClosed', 'HandshakeError', 'InvalidBytesError'] 7 | 8 | class WebSocketException(Exception): pass 9 | 10 | class ProtocolException(WebSocketException): pass 11 | 12 | class FrameTooLargeException(WebSocketException): pass 13 | 14 | class UnsupportedFrameTypeException(WebSocketException): pass 15 | 16 | class TextFrameEncodingException(WebSocketException): pass 17 | 18 | class InvalidBytesError(WebSocketException): pass 19 | 20 | class StreamClosed(Exception): pass 21 | 22 | class HandshakeError(WebSocketException): 23 | def __init__(self, msg): 24 | self.msg = msg 25 | 26 | def __str__(self): 27 | return self.msg 28 | -------------------------------------------------------------------------------- /vertx-web-validation/src/main/java/io/vertx/ext/web/validation/builder/ParameterProcessorFactory.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.validation.builder; 2 | 3 | import io.vertx.codegen.annotations.GenIgnore; 4 | import io.vertx.codegen.annotations.VertxGen; 5 | import io.vertx.ext.web.validation.impl.ParameterLocation; 6 | import io.vertx.ext.web.validation.impl.parameter.ParameterProcessor; 7 | import io.vertx.json.schema.SchemaParser; 8 | 9 | /** 10 | * This interface is used to build parameter processors supported on every {@link ParameterLocation}. 11 | * You can use in query and cookie more complex parameters with {@link StyledParameterProcessorFactory}.
12 | * 13 | * Look at {@link Parameters} for all available factories 14 | */ 15 | @VertxGen 16 | @FunctionalInterface 17 | public interface ParameterProcessorFactory { 18 | 19 | @GenIgnore(GenIgnore.PERMITTED_TYPE) 20 | ParameterProcessor create(ParameterLocation location, SchemaParser jsonSchemaParser); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /vertx-web/src/main/assembly/docs.xml: -------------------------------------------------------------------------------- 1 | 4 | docs 5 | 6 | zip 7 | 8 | false 9 | 10 | 11 | ${asciidoc.dir} 12 | / 13 | 14 | 15 | ${project.build.directory}/docs 16 | / 17 | 18 | groovy/groovydoc/** 19 | java/apidocs/** 20 | js/jsdoc/** 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /vertx-web-api-service/src/test/java/io/vertx/ext/web/api/service/FailureTestServiceImpl.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.api.service; 2 | 3 | import io.vertx.core.AsyncResult; 4 | import io.vertx.core.Future; 5 | import io.vertx.core.Handler; 6 | import io.vertx.core.Vertx; 7 | import io.vertx.core.json.JsonObject; 8 | 9 | public class FailureTestServiceImpl implements FailureTestService { 10 | Vertx vertx; 11 | 12 | public FailureTestServiceImpl(Vertx vertx) { 13 | this.vertx = vertx; 14 | } 15 | 16 | @Override 17 | public Future testFailure(ServiceRequest context) { 18 | JsonObject body = context.getParams().getJsonObject("body"); 19 | return Future.failedFuture(new Exception("error for " + body.getString("name"))); 20 | } 21 | 22 | @Override 23 | public Future testException(ServiceRequest context) { 24 | JsonObject body = context.getParams().getJsonObject("body"); 25 | throw new IllegalArgumentException(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vertx-web-api-service/src/main/java/io/vertx/ext/web/api/service/generator/model/WebApiProxyModelProvider.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.api.service.generator.model; 2 | 3 | import io.vertx.codegen.Model; 4 | import io.vertx.codegen.ModelProvider; 5 | import io.vertx.codegen.type.TypeMirrorFactory; 6 | import io.vertx.ext.web.api.service.WebApiServiceGen; 7 | 8 | import javax.annotation.processing.ProcessingEnvironment; 9 | import javax.lang.model.element.TypeElement; 10 | 11 | /** 12 | * @author Francesco Guardiani 13 | */ 14 | public class WebApiProxyModelProvider implements ModelProvider { 15 | @Override 16 | public Model getModel(ProcessingEnvironment env, TypeMirrorFactory typeFactory, TypeElement elt) { 17 | if (elt.getAnnotation(WebApiServiceGen.class) != null) { 18 | WebApiProxyModel model = new WebApiProxyModel(env, typeFactory, elt); 19 | return model; 20 | } else { 21 | return null; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /vertx-web-api-service/src/test/java/io/vertx/ext/web/api/service/TestService.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.api.service; 2 | 3 | import io.vertx.core.AsyncResult; 4 | import io.vertx.core.Future; 5 | import io.vertx.core.Handler; 6 | import io.vertx.core.Vertx; 7 | import io.vertx.core.json.JsonObject; 8 | 9 | @WebApiServiceGen 10 | public interface TestService { 11 | @Deprecated 12 | Future testA(ServiceRequest context); 13 | @Deprecated 14 | Future testB(JsonObject body, ServiceRequest context); 15 | @Deprecated 16 | Future testEmptyServiceResponse(ServiceRequest context); 17 | @Deprecated 18 | Future testUser(ServiceRequest context); 19 | @Deprecated 20 | Future extraPayload(ServiceRequest context); 21 | @Deprecated 22 | Future testAuthorization(ServiceRequest context); 23 | 24 | static TestService create(Vertx vertx) { 25 | return new TestServiceImpl(vertx); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vertx-web-api-service/src/test/java/io/vertx/ext/web/api/service/generator/models/ValidWebApiProxy.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.api.service.generator.models; 2 | 3 | import io.vertx.codegen.annotations.ProxyClose; 4 | import io.vertx.core.Future; 5 | import io.vertx.core.json.JsonObject; 6 | import io.vertx.ext.web.api.service.ServiceRequest; 7 | import io.vertx.ext.web.api.service.ServiceResponse; 8 | import io.vertx.ext.web.api.service.WebApiServiceGen; 9 | import io.vertx.ext.web.validation.RequestParameter; 10 | 11 | /** 12 | * @author Francesco Guardiani 13 | */ 14 | @WebApiServiceGen 15 | public interface ValidWebApiProxy { 16 | 17 | Future testA(ServiceRequest context); 18 | 19 | Future testB(Integer id, JsonObject body, ServiceRequest context); 20 | 21 | Future testC(Integer id, RequestParameter body, ServiceRequest context); 22 | 23 | @ProxyClose 24 | void closeIt(); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/security_scopes_test.yaml: -------------------------------------------------------------------------------- 1 | openapi: 3.0.0 2 | 3 | info: 4 | version: 1.0.0 5 | title: Test for auth scopes 6 | license: 7 | name: Apache 2.0 License 8 | 9 | paths: 10 | /two_scopes_required: 11 | get: 12 | operationId: twoScopesRequired 13 | security: 14 | - bearerAuth: 15 | - read 16 | - write 17 | responses: 18 | 200: 19 | description: Something 20 | 21 | /one_scope_required: 22 | get: 23 | operationId: oneScopeRequired 24 | security: 25 | - bearerAuth: 26 | - read 27 | responses: 28 | 200: 29 | description: Something 30 | 31 | /no_scopes: 32 | get: 33 | operationId: noScopesRequired 34 | security: 35 | - bearerAuth: [] 36 | responses: 37 | 200: 38 | description: Something 39 | 40 | components: 41 | securitySchemes: 42 | bearerAuth: 43 | type: http 44 | scheme: bearer -------------------------------------------------------------------------------- /vertx-web/src/test/java/io/vertx/ext/web/handler/AuthWithSessionsTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Red Hat, Inc. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Apache License v2.0 which accompanies this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * 11 | * The Apache License v2.0 is available at 12 | * http://www.opensource.org/licenses/apache2.0.php 13 | * 14 | * You may elect to redistribute this code under either of these licenses. 15 | */ 16 | package io.vertx.ext.web.handler; 17 | 18 | import io.vertx.ext.web.WebTestBase; 19 | import org.junit.Test; 20 | 21 | /** 22 | * @author Tim Fox 23 | */ 24 | public class AuthWithSessionsTest extends WebTestBase { 25 | 26 | @Test 27 | public void testAuthWithSessions() throws Exception { 28 | 29 | 30 | 31 | } 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /vertx-web-openapi-router/src/test/resources/security/security_scopes_test.yaml: -------------------------------------------------------------------------------- 1 | openapi: 3.0.0 2 | 3 | info: 4 | version: 1.0.0 5 | title: Test for auth scopes 6 | license: 7 | name: Apache 2.0 License 8 | 9 | paths: 10 | /two_scopes_required: 11 | get: 12 | operationId: twoScopesRequired 13 | security: 14 | - bearerAuth: 15 | - read 16 | - write 17 | responses: 18 | 200: 19 | description: Something 20 | 21 | /one_scope_required: 22 | get: 23 | operationId: oneScopeRequired 24 | security: 25 | - bearerAuth: 26 | - read 27 | responses: 28 | 200: 29 | description: Something 30 | 31 | /no_scopes: 32 | get: 33 | operationId: noScopesRequired 34 | security: 35 | - bearerAuth: [] 36 | responses: 37 | 200: 38 | description: Something 39 | 40 | components: 41 | securitySchemes: 42 | bearerAuth: 43 | type: http 44 | scheme: bearer -------------------------------------------------------------------------------- /README.adoc: -------------------------------------------------------------------------------- 1 | = Vert.x-Web 2 | 3 | image:https://github.com/vert-x3/vertx-web/actions/workflows/ci-5.x.yml/badge.svg["Build Status (5.x)",link="https://github.com/vert-x3/vertx-web/actions/workflows/ci-5.x.yml"] 4 | image:https://github.com/vert-x3/vertx-web/actions/workflows/ci-4.x.yml/badge.svg["Build Status (4.x)",link="https://github.com/vert-x3/vertx-web/actions/workflows/ci-4.x.yml"] 5 | image:https://img.shields.io/maven-central/v/io.vertx/vertx-web.svg["Maven Central"] 6 | image:https://bestpractices.coreinfrastructure.org/projects/540/badge["CII Best Practices",link="https://bestpractices.coreinfrastructure.org/projects/540"] 7 | 8 | Vert.x-Web is a set of building blocks for building web applications with Vert.x. Think of it as a Swiss Army Knife for building 9 | modern, scalable, web apps. 10 | 11 | Please see the main documentation on the web-site for a full description: 12 | 13 | * https://vertx.io/docs/#web[Web-site documentation] 14 | 15 | == Template engines 16 | 17 | Template engine implementations are in the template engine sub-project. 18 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/java/io/vertx/ext/web/openapi/RouteBuilderTest.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.openapi; 2 | 3 | import io.vertx.core.Vertx; 4 | import io.vertx.junit5.VertxExtension; 5 | import io.vertx.junit5.VertxTestContext; 6 | import org.junit.jupiter.api.Test; 7 | import org.junit.jupiter.api.extension.ExtendWith; 8 | 9 | import static org.assertj.core.api.Assertions.assertThat; 10 | 11 | @ExtendWith(VertxExtension.class) 12 | public class RouteBuilderTest { 13 | 14 | @Test 15 | public void testLoadFromClassPath(Vertx vertx, VertxTestContext testContext) { 16 | RouterBuilder.create(vertx, "jar:file:/target/app.jar!/api.yaml") 17 | .onFailure(err -> { 18 | assertThat(err).isNotNull(); 19 | assertThat(err.getMessage()).isEqualTo("Cannot load the spec in path jar:file:/target/app.jar!/api.yaml"); 20 | assertThat(err.getCause()).isNotNull(); 21 | assertThat(err.getCause().getMessage()).isEqualTo("Unsupported protocol: jar"); 22 | testContext.completeNow(); 23 | }); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/java/io/vertx/ext/web/openapi/service/TestService.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.openapi.service; 2 | 3 | import io.vertx.codegen.annotations.VertxGen; 4 | import io.vertx.core.AsyncResult; 5 | import io.vertx.core.Future; 6 | import io.vertx.core.Handler; 7 | import io.vertx.core.Vertx; 8 | import io.vertx.core.json.JsonObject; 9 | import io.vertx.ext.web.api.service.ServiceRequest; 10 | import io.vertx.ext.web.api.service.ServiceResponse; 11 | import io.vertx.ext.web.api.service.WebApiServiceGen; 12 | 13 | @WebApiServiceGen 14 | @VertxGen 15 | public interface TestService { 16 | Future testA(ServiceRequest context); 17 | Future testB(JsonObject body, ServiceRequest context); 18 | Future testEmptyServiceResponse(ServiceRequest context); 19 | Future testUser(ServiceRequest context); 20 | Future extraPayload(ServiceRequest context); 21 | 22 | static TestService create(Vertx vertx) { 23 | return new TestServiceImpl(vertx); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vertx-web-validation/src/main/java/io/vertx/ext/web/validation/impl/parser/SplitterCharArrayParser.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.validation.impl.parser; 2 | 3 | import io.vertx.core.json.JsonArray; 4 | import io.vertx.ext.web.validation.MalformedValueException; 5 | 6 | import java.util.Arrays; 7 | 8 | public class SplitterCharArrayParser extends ArrayParser implements ValueParser { 9 | 10 | private String separator; 11 | 12 | public SplitterCharArrayParser(ValueParser itemsParser, String separator) { 13 | super(itemsParser); 14 | this.separator = separator; 15 | } 16 | 17 | @Override 18 | public JsonArray parse(String serialized) throws MalformedValueException { 19 | return Arrays 20 | .stream(serialized.split(separator, -1)) 21 | .map(this::parseValue) 22 | .reduce(new JsonArray(), JsonArray::add, JsonArray::addAll); 23 | } 24 | 25 | @Override 26 | protected boolean mustNullateValue(String serialized) { 27 | return serialized.isEmpty() && itemsParser != ValueParser.NOOP_PARSER; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vertx-web-client/src/test/java/io/vertx/ext/web/client/SharedWebClientTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Red Hat, Inc. 3 | * 4 | * Red Hat licenses this file to you under the Apache License, version 2.0 5 | * (the "License"); you may not use this file except in compliance with the 6 | * License. You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | package io.vertx.ext.web.client; 18 | 19 | import io.vertx.core.http.HttpClientOptions; 20 | 21 | public class SharedWebClientTest extends WebClientTest { 22 | 23 | @Override 24 | protected HttpClientOptions createBaseClientOptions() { 25 | return super.createBaseClientOptions().setShared(true); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/main/java/io/vertx/ext/web/openapi/impl/JsonBodyProcessorGenerator.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.openapi.impl; 2 | 3 | import io.vertx.core.json.JsonObject; 4 | import io.vertx.core.json.pointer.JsonPointer; 5 | import io.vertx.ext.web.impl.Utils; 6 | import io.vertx.ext.web.validation.impl.body.BodyProcessor; 7 | import io.vertx.ext.web.validation.impl.body.JsonBodyProcessorImpl; 8 | 9 | public class JsonBodyProcessorGenerator implements BodyProcessorGenerator { 10 | 11 | @Override 12 | public boolean canGenerate(String mediaTypeName, JsonObject mediaTypeObject) { 13 | return Utils.isJsonContentType(mediaTypeName); 14 | } 15 | 16 | @Override 17 | public BodyProcessor generate(String mediaTypeName, JsonObject mediaTypeObject, JsonPointer mediaTypePointer, GeneratorContext context) { 18 | SchemaHolder schemas = context.getSchemaHolder( 19 | mediaTypeObject.getJsonObject("schema", new JsonObject()), 20 | mediaTypePointer.copy().append("schema") 21 | ); 22 | return new JsonBodyProcessorImpl(schemas.getValidator()); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /vertx-web-graphql/vertx-web-graphiql/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vertx-web-graphiql", 3 | "version": "0.1.0", 4 | "private": true, 5 | "homepage": ".", 6 | "dependencies": { 7 | "@graphiql/toolkit": "0.8.0", 8 | "graphiql": "2.2.0", 9 | "graphql": "16.6.0", 10 | "graphql-ws": "5.11.2", 11 | "lodash": "4.17.21", 12 | "react": "18.2.0", 13 | "react-dom": "18.2.0", 14 | "react-scripts": "5.0.1" 15 | }, 16 | "devDependencies": { 17 | "recursive-copy": "2.0.14" 18 | }, 19 | "scripts": { 20 | "start": "react-scripts start", 21 | "build": "react-scripts build", 22 | "test": "react-scripts test", 23 | "eject": "react-scripts eject" 24 | }, 25 | "eslintConfig": { 26 | "extends": "react-app" 27 | }, 28 | "browserslist": { 29 | "production": [ 30 | ">0.2%", 31 | "not dead", 32 | "not op_mini all" 33 | ], 34 | "development": [ 35 | "last 1 chrome version", 36 | "last 1 firefox version", 37 | "last 1 safari version" 38 | ] 39 | }, 40 | "proxy": "http://localhost:8080" 41 | } 42 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/main/java/io/vertx/ext/web/openapi/impl/JsonPointerIteratorWithLoader.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.openapi.impl; 2 | 3 | import io.vertx.core.json.JsonObject; 4 | import io.vertx.core.json.pointer.impl.JsonPointerIteratorImpl; 5 | import io.vertx.ext.web.openapi.OpenAPIHolder; 6 | 7 | public class JsonPointerIteratorWithLoader extends JsonPointerIteratorImpl { 8 | private final OpenAPIHolder loader; 9 | 10 | public JsonPointerIteratorWithLoader(OpenAPIHolder loader) { 11 | super(); 12 | this.loader = loader; 13 | } 14 | 15 | @Override 16 | public boolean objectContainsKey(Object value, String key) { 17 | if (value instanceof JsonObject) 18 | value = loader.solveIfNeeded((JsonObject) value); 19 | return super.objectContainsKey(value, key); 20 | } 21 | 22 | @Override 23 | public Object getObjectParameter(Object value, String key, boolean createOnMissing) { 24 | if (value instanceof JsonObject) 25 | value = loader.solveIfNeeded((JsonObject) value); 26 | return super.getObjectParameter(value, key, createOnMissing); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /vertx-web-client/src/test/java/io/vertx/ext/web/client/jackson/WineAndCheese.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.client.jackson; 2 | 3 | import java.util.Objects; 4 | 5 | /** 6 | * @author Julien Viet 7 | */ 8 | public class WineAndCheese { 9 | 10 | private String wine; 11 | private String cheese; 12 | 13 | public String getWine() { 14 | return wine; 15 | } 16 | 17 | public WineAndCheese setWine(String wine) { 18 | this.wine = wine; 19 | return this; 20 | } 21 | 22 | public String getCheese() { 23 | return cheese; 24 | } 25 | 26 | public WineAndCheese setCheese(String cheese) { 27 | this.cheese = cheese; 28 | return this; 29 | } 30 | 31 | @Override 32 | public boolean equals(Object obj) { 33 | if (obj instanceof WineAndCheese) { 34 | WineAndCheese that = (WineAndCheese) obj; 35 | return Objects.equals(wine, that.wine) && Objects.equals(cheese, that.cheese); 36 | } 37 | return false; 38 | } 39 | 40 | @Override 41 | public int hashCode() { 42 | return Objects.hash(wine, cheese); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/java/io/vertx/ext/web/openapi/impl/OpenAPI3UtilsTest.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.openapi.impl; 2 | 3 | import org.junit.jupiter.api.Test; 4 | 5 | import static org.assertj.core.api.Assertions.assertThat; 6 | 7 | public class OpenAPI3UtilsTest { 8 | 9 | @Test 10 | public void testOperationIdSanitizer() { 11 | assertThat(OpenAPI3Utils.sanitizeOperationId("operationId")).isEqualTo("operationId"); 12 | assertThat(OpenAPI3Utils.sanitizeOperationId("operation id")).isEqualTo("operationId"); 13 | assertThat(OpenAPI3Utils.sanitizeOperationId("operation Id")).isEqualTo("operationId"); 14 | assertThat(OpenAPI3Utils.sanitizeOperationId("operation-id")).isEqualTo("operationId"); 15 | assertThat(OpenAPI3Utils.sanitizeOperationId("operation_id")).isEqualTo("operationId"); 16 | assertThat(OpenAPI3Utils.sanitizeOperationId("operation__id-")).isEqualTo("operationId"); 17 | assertThat(OpenAPI3Utils.sanitizeOperationId("operation_- id ")).isEqualTo("operationId"); 18 | assertThat(OpenAPI3Utils.sanitizeOperationId("operation_- A B")).isEqualTo("operationAB"); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /.github/workflows/deploy.yml: -------------------------------------------------------------------------------- 1 | name: Deploy 2 | on: 3 | workflow_call: 4 | inputs: 5 | branch: 6 | required: true 7 | type: string 8 | jdk: 9 | default: 8 10 | type: string 11 | jobs: 12 | Deploy: 13 | name: Deploy to OSSRH 14 | runs-on: ubuntu-latest 15 | env: 16 | VERTX_NEXUS_USERNAME: ${{ secrets.VERTX_NEXUS_USERNAME }} 17 | VERTX_NEXUS_PASSWORD: ${{ secrets.VERTX_NEXUS_PASSWORD }} 18 | steps: 19 | - name: Checkout 20 | uses: actions/checkout@v2 21 | with: 22 | ref: ${{ inputs.branch }} 23 | - name: Install JDK 24 | uses: actions/setup-java@v2 25 | with: 26 | java-version: ${{ inputs.jdk }} 27 | distribution: temurin 28 | - name: Get project version 29 | run: echo "PROJECT_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:evaluate -Dexpression=project.version -B | grep -v '\[')" >> $GITHUB_ENV 30 | - name: Maven deploy 31 | if: ${{ endsWith(env.PROJECT_VERSION, '-SNAPSHOT') }} 32 | run: mvn deploy -s .github/maven-cd-settings.xml -DskipTests -B 33 | -------------------------------------------------------------------------------- /vertx-web-api-service/src/test/java/io/vertx/ext/web/api/service/AnotherTestService.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.api.service; 2 | 3 | import io.vertx.codegen.annotations.ProxyClose; 4 | import io.vertx.core.AsyncResult; 5 | import io.vertx.core.Future; 6 | import io.vertx.core.Handler; 7 | import io.vertx.core.Vertx; 8 | import io.vertx.core.json.JsonObject; 9 | import io.vertx.ext.web.validation.RequestParameter; 10 | 11 | @WebApiServiceGen 12 | public 13 | interface AnotherTestService { 14 | 15 | @Deprecated 16 | Future testC(ServiceRequest context); 17 | 18 | @Deprecated 19 | Future testD(ServiceRequest context); 20 | 21 | @Deprecated 22 | Future testE(Integer id, JsonObject body, ServiceRequest context); 23 | 24 | @Deprecated 25 | Future testF(Integer id, RequestParameter body, ServiceRequest context); 26 | 27 | @Deprecated 28 | Future testDataObject(FilterData body, ServiceRequest context); 29 | 30 | @ProxyClose 31 | void close(); 32 | 33 | static AnotherTestService create(Vertx vertx) { 34 | return new AnotherTestServiceImpl(vertx); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /vertx-web/src/test/sockjs-protocol/linecache2/tests/inspect_fodder.py: -------------------------------------------------------------------------------- 1 | # line 1 2 | 'A module docstring.' 3 | 4 | import sys, inspect 5 | # line 5 6 | 7 | # line 7 8 | def spam(a, b, c, d=3, e=4, f=5, *g, **h): 9 | eggs(b + d, c + f) 10 | 11 | # line 11 12 | def eggs(x, y): 13 | "A docstring." 14 | global fr, st 15 | fr = inspect.currentframe() 16 | st = inspect.stack() 17 | p = x 18 | q = y / 0 19 | 20 | # line 20 21 | class StupidGit: 22 | """A longer, 23 | 24 | indented 25 | 26 | docstring.""" 27 | # line 27 28 | 29 | def abuse(self, a, b, c): 30 | """Another 31 | 32 | \tdocstring 33 | 34 | containing 35 | 36 | \ttabs 37 | \t 38 | """ 39 | self.argue(a, b, c) 40 | # line 40 41 | def argue(self, a, b, c): 42 | try: 43 | spam(a, b, c) 44 | except: 45 | self.ex = sys.exc_info() 46 | self.tr = inspect.trace() 47 | 48 | # line 48 49 | class MalodorousPervert(StupidGit): 50 | pass 51 | 52 | Tit = MalodorousPervert 53 | 54 | class ParrotDroppings: 55 | pass 56 | 57 | class FesteringGob(MalodorousPervert, ParrotDroppings): 58 | pass 59 | -------------------------------------------------------------------------------- /vertx-web-graphql/src/test/resources/batchUpload.txt: -------------------------------------------------------------------------------- 1 | --------------------------560b6209af099a26 2 | Content-Disposition: form-data; name="operations" 3 | 4 | [{ "query": "mutation ($file: Upload!) { singleUpload(file: $file) { id } }", "variables": { "file": null } }, { "query": "mutation($files: [Upload!]!) { multipleUpload(files: $files) { id } }", "variables": { "files": [null, null] } }] 5 | --------------------------560b6209af099a26 6 | Content-Disposition: form-data; name="map" 7 | 8 | { "0": ["0.variables.file"], "1": ["1.variables.files.0"], "2": ["1.variables.files.1"] } 9 | --------------------------560b6209af099a26 10 | Content-Disposition: form-data; name="0"; filename="a.txt" 11 | Content-Type: text/plain 12 | 13 | Alpha file content. 14 | 15 | --------------------------560b6209af099a26 16 | Content-Disposition: form-data; name="1"; filename="b.txt" 17 | Content-Type: text/plain 18 | 19 | Bravo file content. 20 | 21 | --------------------------560b6209af099a26 22 | Content-Disposition: form-data; name="2"; filename="c.txt" 23 | Content-Type: text/plain 24 | 25 | Charlie file content. 26 | 27 | --------------------------560b6209af099a26-- 28 | 29 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-pebble/src/test/java/io/vertx/ext/web/templ/extension/TestExtension.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.templ.extension; 2 | 3 | import io.pebbletemplates.pebble.extension.AbstractExtension; 4 | import io.pebbletemplates.pebble.extension.Function; 5 | import io.pebbletemplates.pebble.template.EvaluationContext; 6 | import io.pebbletemplates.pebble.template.PebbleTemplate; 7 | 8 | import java.util.Collections; 9 | import java.util.List; 10 | import java.util.Map; 11 | 12 | /** 13 | * Created by jensklingsporn on 22.02.17. 14 | */ 15 | public class TestExtension extends AbstractExtension { 16 | 17 | @Override 18 | public Map getFunctions() { 19 | return Collections.singletonMap("createString", new CreateStringFunction()); 20 | } 21 | 22 | static class CreateStringFunction implements Function { 23 | 24 | @Override 25 | public Object execute(Map map, PebbleTemplate pebbleTemplate, EvaluationContext evaluationContext, int i) { 26 | return "TEST"; 27 | } 28 | 29 | @Override 30 | public List getArgumentNames() { 31 | return Collections.emptyList(); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vertx-web-graphql/src/main/java/io/vertx/ext/web/handler/graphql/TriConsumer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Red Hat, Inc. 3 | * 4 | * Red Hat licenses this file to you under the Apache License, version 2.0 5 | * (the "License"); you may not use this file except in compliance with the 6 | * License. You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | package io.vertx.ext.web.handler.graphql; 18 | 19 | /** 20 | * Like {@link java.util.function.BiConsumer} but accepts three arguments. 21 | * 22 | * @deprecated only useful in dataloader package which is now deprecated 23 | */ 24 | @FunctionalInterface 25 | @Deprecated 26 | public interface TriConsumer { 27 | 28 | /** 29 | * Execute with the provided arguments. 30 | */ 31 | void accept(T t, U u, V v); 32 | } 33 | -------------------------------------------------------------------------------- /vertx-web-graphql/src/test/java/io/vertx/ext/web/handler/graphql/User.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Red Hat, Inc. 3 | * 4 | * Red Hat licenses this file to you under the Apache License, version 2.0 5 | * (the "License"); you may not use this file except in compliance with the 6 | * License. You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | package io.vertx.ext.web.handler.graphql; 18 | 19 | /** 20 | * @author Thomas Segismont 21 | */ 22 | public class User { 23 | private final String id; 24 | private final String name; 25 | 26 | public User(String id, String name) { 27 | this.id = id; 28 | this.name = name; 29 | } 30 | 31 | public String getId() { 32 | return id; 33 | } 34 | 35 | public String getName() { 36 | return name; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vertx-web/src/test/sockjs-protocol/websocket/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | websocket - WebSocket client library for Python 3 | 4 | Copyright (C) 2010 Hiroki Ohtani(liris) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 | Boston, MA 02110-1335 USA 20 | 21 | """ 22 | from ._abnf import * 23 | from ._app import WebSocketApp 24 | from ._core import * 25 | from ._exceptions import * 26 | from ._logging import * 27 | from ._socket import * 28 | 29 | __version__ = "0.57.0" 30 | -------------------------------------------------------------------------------- /vertx-web/src/test/java/io/vertx/ext/web/impl/ParsableHeaderValueTest.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.impl; 2 | 3 | import static org.junit.Assert.*; 4 | 5 | import org.junit.Before; 6 | import org.junit.Test; 7 | 8 | import io.vertx.ext.web.ParsedHeaderValue; 9 | 10 | public class ParsableHeaderValueTest { 11 | 12 | private ParsableHeaderValue headerValue; 13 | 14 | @Before 15 | public void initialize() { 16 | headerValue = new ParsableHeaderValue("application/json; charset=UTF-8"); 17 | } 18 | 19 | @Test 20 | public void testIsMatchedByEqualsCases() { 21 | ParsedHeaderValue value = new ParsableMIMEValue("application/json; charset=UTF-8").forceParse(); 22 | assertTrue(headerValue.isMatchedBy(value)); 23 | } 24 | 25 | @Test 26 | public void testIsMatchedByDiffCases() { 27 | ParsedHeaderValue value = new ParsableMIMEValue("application/json; charset=utf-8").forceParse(); 28 | assertTrue(headerValue.isMatchedBy(value)); 29 | } 30 | 31 | @Test 32 | public void testIsMatchedByDiff() { 33 | ParsedHeaderValue value = new ParsableMIMEValue("application/json; charset=UTF-16").forceParse(); 34 | assertFalse(headerValue.isMatchedBy(value)); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /vertx-web-api-service/src/test/java/io/vertx/ext/web/api/service/futures/FuturesServiceImpl.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.api.service.futures; 2 | 3 | import io.vertx.core.Future; 4 | import io.vertx.core.json.JsonObject; 5 | import io.vertx.ext.web.api.service.ServiceRequest; 6 | import io.vertx.ext.web.api.service.ServiceResponse; 7 | import io.vertx.ext.web.validation.RequestParameter; 8 | 9 | public class FuturesServiceImpl implements FuturesService { 10 | 11 | @Override 12 | public Future testFutureWithRequestParameter(final RequestParameter param, final ServiceRequest context) { 13 | return Future.succeededFuture(ServiceResponse.completedWithJson(new JsonObject().put("param", param.getInteger()))); 14 | } 15 | 16 | @Override 17 | public Future testFutureWithIntParameter(final int param, final ServiceRequest context) { 18 | return Future.succeededFuture(ServiceResponse.completedWithJson(new JsonObject().put("param", param))); 19 | } 20 | 21 | @Override 22 | public Future testFuture(final ServiceRequest context) { 23 | return Future.succeededFuture(ServiceResponse.completedWithJson(new JsonObject().put("foo", "bar"))); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /.github/workflows/ci-5.x.yml: -------------------------------------------------------------------------------- 1 | name: vertx-web (5.x) 2 | on: 3 | push: 4 | branches: 5 | - master 6 | pull_request: 7 | branches: 8 | - master 9 | schedule: 10 | - cron: '0 5 * * *' 11 | jobs: 12 | CI: 13 | strategy: 14 | matrix: 15 | include: 16 | - os: ubuntu-latest 17 | jdk: 11 18 | - os: ubuntu-latest 19 | jdk: 17 20 | - os: windows-latest 21 | jdk: 11 22 | uses: ./.github/workflows/ci.yml 23 | with: 24 | branch: ${{ github.event.pull_request.head.sha || github.ref_name }} 25 | jdk: ${{ matrix.jdk }} 26 | os: ${{ matrix.os }} 27 | secrets: inherit 28 | IT: 29 | uses: ./.github/workflows/it.yml 30 | with: 31 | branch: ${{ github.event.pull_request.head.sha || github.ref_name }} 32 | jdk: 11 33 | secrets: inherit 34 | Deploy: 35 | if: ${{ github.repository_owner == 'vert-x3' && (github.event_name == 'push' || github.event_name == 'schedule') }} 36 | needs: [CI, IT] 37 | uses: ./.github/workflows/deploy.yml 38 | with: 39 | branch: ${{ github.event.pull_request.head.sha || github.ref_name }} 40 | jdk: 11 41 | secrets: inherit 42 | -------------------------------------------------------------------------------- /vertx-web-validation/src/main/java/io/vertx/ext/web/validation/impl/parser/SplitterCharTupleParser.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.validation.impl.parser; 2 | 3 | import io.vertx.core.json.JsonArray; 4 | import io.vertx.ext.web.validation.MalformedValueException; 5 | 6 | import java.util.List; 7 | 8 | public class SplitterCharTupleParser extends TupleParser implements ValueParser { 9 | 10 | private final String separator; 11 | 12 | public SplitterCharTupleParser(List> itemsParser, ValueParser additionalItemsParser, String separator) { 13 | super(itemsParser, additionalItemsParser); 14 | this.separator = separator; 15 | } 16 | 17 | @Override 18 | public JsonArray parse(String serialized) throws MalformedValueException { 19 | JsonArray result = new JsonArray(); 20 | String[] splitted = serialized.split(separator, -1); 21 | for (int i = 0; i < splitted.length; i++) { 22 | parseItem(i, splitted[i]).forEach(result::add); 23 | } 24 | return result; 25 | } 26 | 27 | @Override 28 | protected boolean mustNullateValue(String serialized, ValueParser parser) { 29 | return serialized.isEmpty() && parser != ValueParser.NOOP_PARSER; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vertx-web-graphql/src/main/java/io/vertx/ext/web/handler/graphql/ws/ConnectionInitEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Red Hat, Inc. 3 | * 4 | * Red Hat licenses this file to you under the Apache License, version 2.0 5 | * (the "License"); you may not use this file except in compliance with the 6 | * License. You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | package io.vertx.ext.web.handler.graphql.ws; 18 | 19 | import io.vertx.codegen.annotations.CacheReturn; 20 | import io.vertx.codegen.annotations.VertxGen; 21 | import io.vertx.core.Promise; 22 | 23 | @VertxGen 24 | public interface ConnectionInitEvent extends Promise { 25 | 26 | /** 27 | * Provides {@link MessageType#CONNECTION_INIT} message content. 28 | * 29 | * @return message 30 | */ 31 | @CacheReturn 32 | Message message(); 33 | } 34 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-rocker/src/main/java/io/vertx/ext/web/templ/rocker/impl/VertxBufferOutputFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Red Hat, Inc. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Apache License v2.0 which accompanies this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * 11 | * The Apache License v2.0 is available at 12 | * http://www.opensource.org/licenses/apache2.0.php 13 | * 14 | * You may elect to redistribute this code under either of these licenses. 15 | */ 16 | 17 | package io.vertx.ext.web.templ.rocker.impl; 18 | 19 | import com.fizzed.rocker.ContentType; 20 | import com.fizzed.rocker.RockerOutputFactory; 21 | 22 | /** 23 | * @author Xianguang Zhou 24 | */ 25 | public class VertxBufferOutputFactory implements RockerOutputFactory { 26 | 27 | @Override 28 | public VertxBufferOutput create(ContentType contentType, String charsetName) { 29 | return new VertxBufferOutput(contentType, charsetName); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /vertx-web-validation/src/main/java/io/vertx/ext/web/validation/builder/Parsers.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.validation.builder; 2 | 3 | import io.vertx.codegen.annotations.VertxGen; 4 | import io.vertx.ext.web.validation.impl.parser.SplitterCharArrayParser; 5 | import io.vertx.ext.web.validation.impl.parser.SplitterCharObjectParser; 6 | import io.vertx.ext.web.validation.impl.parser.SplitterCharTupleParser; 7 | 8 | /** 9 | * In this interface you can find all available {@link ArrayParserFactory}, {@link ObjectParserFactory} & {@link TupleParserFactory} 10 | */ 11 | @VertxGen 12 | public interface Parsers { 13 | 14 | static ArrayParserFactory commaSeparatedArrayParser() { 15 | return itemsParser -> new SplitterCharArrayParser(itemsParser, ","); 16 | } 17 | 18 | static ObjectParserFactory commaSeparatedObjectParser() { 19 | return (propertiesParser, patternPropertiesParser, additionalPropertiesParser) -> new SplitterCharObjectParser(propertiesParser, patternPropertiesParser, additionalPropertiesParser, ","); 20 | } 21 | 22 | static TupleParserFactory commaSeparatedTupleParser() { 23 | return (itemsParser, additionalItemsParser) -> new SplitterCharTupleParser(itemsParser, additionalItemsParser, ","); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /vertx-web-graphql/vertx-web-graphiql/copy-to-resources.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Red Hat, Inc. 3 | * 4 | * Red Hat licenses this file to you under the Apache License, version 2.0 5 | * (the "License"); you may not use this file except in compliance with the 6 | * License. You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | const fs = require('fs/promises'); 17 | const copy = require('recursive-copy'); 18 | 19 | const destDir = '../src/main/resources/io/vertx/ext/web/handler/graphiql'; 20 | 21 | fs.rm(destDir, {force: true, recursive: true}) 22 | .then(() => 23 | copy('build', destDir, { 24 | filter: [ 25 | 'index.html', 26 | 'static/**/*.js', 27 | 'static/**/*.css' 28 | ] 29 | })) 30 | .catch(function (error) { 31 | console.error('Copy failed: ' + error); 32 | process.exit(1); 33 | }); 34 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/java/io/vertx/ext/web/openapi/asserts/JsonAssert.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.openapi.asserts; 2 | 3 | import io.vertx.core.json.pointer.JsonPointer; 4 | import org.assertj.core.api.AbstractAssert; 5 | import org.assertj.core.api.StringAssert; 6 | 7 | import java.net.URI; 8 | import java.util.Arrays; 9 | import java.util.stream.Collectors; 10 | 11 | import static org.assertj.core.api.Assertions.assertThat; 12 | 13 | public class JsonAssert extends AbstractAssert { 14 | public JsonAssert(Object actual) { 15 | super(actual, JsonAssert.class); 16 | } 17 | 18 | public JsonAssert extracting(String... pointerTokens) { 19 | return new JsonAssert(JsonPointer.create().append(Arrays.stream(pointerTokens).collect(Collectors.toList())).queryJson(actual)); 20 | } 21 | 22 | public JsonAssert extracting(JsonPointer pointer) { 23 | return new JsonAssert(pointer.queryJson(actual)); 24 | } 25 | 26 | public JsonAssert extracting(URI unparsedPointer) { 27 | return extracting(JsonPointer.fromURI(unparsedPointer)); 28 | } 29 | 30 | public StringAssert asString() { 31 | assertThat(actual).isInstanceOf(String.class); 32 | return new StringAssert((String) actual); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/java/io/vertx/ext/web/openapi/service/PathExtensionTestServiceImpl.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.openapi.service; 2 | 3 | import io.vertx.core.AsyncResult; 4 | import io.vertx.core.Future; 5 | import io.vertx.core.Handler; 6 | import io.vertx.ext.web.api.service.ServiceRequest; 7 | import io.vertx.ext.web.api.service.ServiceResponse; 8 | 9 | public class PathExtensionTestServiceImpl implements PathExtensionTestService { 10 | @Override 11 | public Future pathLevelGet(ServiceRequest context) { 12 | return Future.succeededFuture(new ServiceResponse().setStatusMessage("pathLevelGet")); 13 | } 14 | 15 | @Override 16 | public Future getPathLevel(ServiceRequest context) { 17 | return Future.succeededFuture(new ServiceResponse().setStatusMessage("getPathLevel")); 18 | } 19 | 20 | @Override 21 | public Future pathLevelPost(ServiceRequest context) { 22 | return Future.succeededFuture(new ServiceResponse().setStatusMessage("pathLevelPost")); 23 | } 24 | 25 | @Override 26 | public Future postPathLevel(ServiceRequest context) { 27 | return Future.succeededFuture(new ServiceResponse().setStatusMessage("postPathLevel")); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vertx-web-common/src/main/java/io/vertx/ext/web/codec/spi/BodyStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Red Hat, Inc. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Apache License v2.0 which accompanies this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * 11 | * The Apache License v2.0 is available at 12 | * http://www.opensource.org/licenses/apache2.0.php 13 | * 14 | * You may elect to redistribute this code under either of these licenses. 15 | */ 16 | package io.vertx.ext.web.codec.spi; 17 | 18 | import io.vertx.core.Future; 19 | import io.vertx.core.Handler; 20 | import io.vertx.core.buffer.Buffer; 21 | import io.vertx.core.streams.WriteStream; 22 | 23 | /** 24 | * The body stream decodes a {@link WriteStream} into the a {@code T} instance. 25 | * 26 | * @author Julien Viet 27 | */ 28 | public interface BodyStream extends WriteStream, Handler { 29 | 30 | /** 31 | * @return the future signaling the completion of the stream 32 | */ 33 | Future result(); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /vertx-web/src/main/java/io/vertx/ext/web/sstore/impl/SessionInternal.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Red Hat, Inc. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Apache License v2.0 which accompanies this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * 11 | * The Apache License v2.0 is available at 12 | * http://www.opensource.org/licenses/apache2.0.php 13 | * 14 | * You may elect to redistribute this code under either of these licenses. 15 | */ 16 | package io.vertx.ext.web.sstore.impl; 17 | 18 | /** 19 | * Internal interface to allow cleanup of internal state after a session is stored. 20 | */ 21 | public interface SessionInternal { 22 | 23 | /** 24 | * Mark this session as flushed, this gives the object a change to clear any state management flags. 25 | * 26 | * @param skipCrc if the intention is NOT to keep using the session after this call, 27 | * a small optimization can be performed (skip updating the internal CRC) 28 | * which is unnecessary. 29 | */ 30 | void flushed(boolean skipCrc); 31 | } 32 | -------------------------------------------------------------------------------- /vertx-web/src/main/java/io/vertx/ext/web/handler/PlatformHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Red Hat, Inc. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Apache License v2.0 which accompanies this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * 11 | * The Apache License v2.0 is available at 12 | * http://www.opensource.org/licenses/apache2.0.php 13 | * 14 | * You may elect to redistribute this code under either of these licenses. 15 | */ 16 | package io.vertx.ext.web.handler; 17 | 18 | import io.vertx.codegen.annotations.VertxGen; 19 | import io.vertx.core.Handler; 20 | import io.vertx.ext.web.RoutingContext; 21 | 22 | /** 23 | * Base platform interface for handlers that provide functionality to the application platform. 24 | * 25 | * Two examples are: 26 | * 27 | *
    28 | *
  • {@link BodyHandler}
  • 29 | *
  • {@link SessionHandler}
  • 30 | *
31 | * 32 | * @author Paulo Lopes 33 | */ 34 | @VertxGen(concrete = false) 35 | public interface PlatformHandler extends Handler { 36 | } 37 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-handlebars/src/main/java/io/vertx/ext/web/templ/handlebars/impl/JsonFormatter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Red Hat, Inc. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Apache License v2.0 which accompanies this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * 11 | * The Apache License v2.0 is available at 12 | * http://www.opensource.org/licenses/apache2.0.php 13 | * 14 | * You may elect to redistribute this code under either of these licenses. 15 | */ 16 | package io.vertx.ext.web.templ.handlebars.impl; 17 | 18 | import com.github.jknack.handlebars.Formatter; 19 | import io.vertx.core.json.JsonArray; 20 | import io.vertx.core.json.JsonObject; 21 | 22 | public class JsonFormatter implements Formatter { 23 | @Override 24 | public Object format(Object value, Chain next) { 25 | if (value instanceof JsonObject) { 26 | return ((JsonObject) value).encode(); 27 | } 28 | if (value instanceof JsonArray) { 29 | return ((JsonArray) value).encode(); 30 | } 31 | return next.format(value); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vertx-web-openapi-router/src/test/java/io/vertx/router/ResourceHelper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023, SAP SE 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 7 | * which is available at https://www.apache.org/licenses/LICENSE-2.0. 8 | * 9 | * SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 10 | * 11 | */ 12 | 13 | package io.vertx.router; 14 | 15 | import io.vertx.core.Vertx; 16 | import io.vertx.core.json.JsonObject; 17 | 18 | import java.nio.file.Path; 19 | import java.nio.file.Paths; 20 | 21 | public final class ResourceHelper { 22 | 23 | public static final Path TEST_RESOURCE_PATH = Paths.get("src", "test", "resources"); 24 | 25 | private ResourceHelper() { 26 | 27 | } 28 | 29 | public static Path getRelatedTestResourcePath(Class relatedClass) { 30 | Path related = Paths.get(relatedClass.getPackage().getName().replace(".", "/")); 31 | return TEST_RESOURCE_PATH.resolve(related); 32 | } 33 | 34 | public static JsonObject loadJson(Vertx vertx, Path path) { 35 | return vertx.fileSystem().readFileBlocking(path.toString()).toJsonObject(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vertx-web/src/test/resources/vertx-default-jul-logging.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2014 Red Hat, Inc. 3 | # 4 | # All rights reserved. This program and the accompanying materials 5 | # are made available under the terms of the Eclipse Public License v1.0 6 | # and Apache License v2.0 which accompanies this distribution. 7 | # 8 | # The Eclipse Public License is available at 9 | # http://www.eclipse.org/legal/epl-v10.html 10 | # 11 | # The Apache License v2.0 is available at 12 | # http://www.opensource.org/licenses/apache2.0.php 13 | # 14 | # You may elect to redistribute this code under either of these licenses. 15 | # 16 | handlers=java.util.logging.ConsoleHandler,java.util.logging.FileHandler 17 | java.util.logging.SimpleFormatter.format=%5$s %6$s\n 18 | java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter 19 | java.util.logging.ConsoleHandler.level=FINEST 20 | java.util.logging.FileHandler.level=INFO 21 | java.util.logging.FileHandler.formatter=io.vertx.core.logging.impl.VertxLoggerFormatter 22 | 23 | # Put the log in the system temporary directory 24 | java.util.logging.FileHandler.pattern=%t/vertx.log 25 | 26 | .level=INFO 27 | io.vertx.ext.web.level=INFO 28 | io.vertx.level=INFO 29 | io.netty.util.internal.PlatformDependent.level=SEVERE 30 | -------------------------------------------------------------------------------- /vertx-web-proxy/src/main/java/io/vertx/ext/web/proxy/handler/ProxyHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011-2021 Contributors to the Eclipse Foundation 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 7 | * which is available at https://www.apache.org/licenses/LICENSE-2.0. 8 | * 9 | * SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 10 | */ 11 | 12 | package io.vertx.ext.web.proxy.handler; 13 | 14 | import io.vertx.codegen.annotations.VertxGen; 15 | import io.vertx.core.Handler; 16 | import io.vertx.ext.web.RoutingContext; 17 | import io.vertx.ext.web.proxy.handler.impl.ProxyHandlerImpl; 18 | import io.vertx.httpproxy.HttpProxy; 19 | 20 | /** 21 | * @author Emad Alblueshi 22 | */ 23 | 24 | @VertxGen 25 | public interface ProxyHandler extends Handler { 26 | 27 | static ProxyHandler create(HttpProxy httpProxy) { 28 | return new ProxyHandlerImpl(httpProxy); 29 | } 30 | 31 | static ProxyHandler create(HttpProxy httpProxy, int port, String host) { 32 | return new ProxyHandlerImpl(httpProxy, port, host); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vertx-web/src/main/java/io/vertx/ext/web/handler/SecurityPolicyHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Red Hat, Inc. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Apache License v2.0 which accompanies this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * 11 | * The Apache License v2.0 is available at 12 | * http://www.opensource.org/licenses/apache2.0.php 13 | * 14 | * You may elect to redistribute this code under either of these licenses. 15 | */ 16 | package io.vertx.ext.web.handler; 17 | 18 | import io.vertx.codegen.annotations.VertxGen; 19 | import io.vertx.core.Handler; 20 | import io.vertx.ext.web.RoutingContext; 21 | 22 | /** 23 | * Base security policy interface for handlers that provide HTTP security related headers. 24 | *

25 | * Sub-interfaces help you secure your applications by setting various HTTP headers. It's not a silver bullet, 26 | * but it can help! 27 | *

28 | * 29 | * @author Paulo Lopes 30 | */ 31 | @VertxGen(concrete = false) 32 | public interface SecurityPolicyHandler extends Handler { 33 | } 34 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-rythm/src/main/java/io/vertx/ext/web/templ/rythm/RythmTemplateEngine.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.templ.rythm; 2 | 3 | import io.vertx.codegen.annotations.VertxGen; 4 | import io.vertx.core.Vertx; 5 | import io.vertx.ext.web.common.template.TemplateEngine; 6 | import io.vertx.ext.web.templ.rythm.impl.RythmTemplateEngineImpl; 7 | import org.rythmengine.RythmEngine; 8 | 9 | /** 10 | * A template engine that uses the rythm library. 11 | * The {@link #unwrap()} shall return an object of class {@link RythmEngine} 12 | * @author Konstantin Volivach kostya05983@mail.ru 13 | */ 14 | @VertxGen 15 | public interface RythmTemplateEngine extends TemplateEngine { 16 | 17 | /** 18 | * Default template extension 19 | */ 20 | String DEFAULT_TEMPLATE_EXTENSION = "html"; 21 | 22 | /** 23 | * Create a template engine using defaults 24 | * 25 | * @return the engine 26 | */ 27 | static RythmTemplateEngine create(Vertx vertx) { 28 | return create(vertx, DEFAULT_TEMPLATE_EXTENSION); 29 | } 30 | 31 | /** 32 | * Create a template engine using defaults 33 | * 34 | * @return the engine 35 | */ 36 | static RythmTemplateEngine create(Vertx vertx, String extension) { 37 | return new RythmTemplateEngineImpl(vertx, extension); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /vertx-web/src/main/java/io/vertx/ext/web/handler/ProtocolUpgradeHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Red Hat, Inc. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Apache License v2.0 which accompanies this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * 11 | * The Apache License v2.0 is available at 12 | * http://www.opensource.org/licenses/apache2.0.php 13 | * 14 | * You may elect to redistribute this code under either of these licenses. 15 | */ 16 | package io.vertx.ext.web.handler; 17 | 18 | import io.vertx.codegen.annotations.VertxGen; 19 | import io.vertx.core.Handler; 20 | import io.vertx.ext.web.RoutingContext; 21 | 22 | /** 23 | * Base interface for handlers that perform protocol upgrades. 24 | * 25 | * Sub-interfaces hint vert.x core that we should hold the request. This allows later parsing. It can be available 26 | * during the upgrade, even if there are asynchronous calls in between. 27 | * 28 | * @author Paulo Lopes 29 | */ 30 | @VertxGen(concrete = false) 31 | public interface ProtocolUpgradeHandler extends Handler { 32 | } 33 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/java/io/vertx/ext/web/openapi/service/AnotherTestService.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.openapi.service; 2 | 3 | import io.vertx.codegen.annotations.ProxyClose; 4 | import io.vertx.codegen.annotations.VertxGen; 5 | import io.vertx.core.AsyncResult; 6 | import io.vertx.core.Future; 7 | import io.vertx.core.Handler; 8 | import io.vertx.core.Vertx; 9 | import io.vertx.core.json.JsonObject; 10 | import io.vertx.ext.web.api.service.ServiceRequest; 11 | import io.vertx.ext.web.api.service.ServiceResponse; 12 | import io.vertx.ext.web.api.service.WebApiServiceGen; 13 | import io.vertx.ext.web.validation.RequestParameter; 14 | 15 | @WebApiServiceGen 16 | @VertxGen 17 | public interface AnotherTestService { 18 | 19 | Future testC(ServiceRequest context); 20 | 21 | Future testD(ServiceRequest context); 22 | 23 | Future testE(Integer id, JsonObject body, ServiceRequest context); 24 | 25 | Future testF(Integer id, RequestParameter body, ServiceRequest context); 26 | 27 | Future testDataObject(FilterData body, ServiceRequest context); 28 | 29 | @ProxyClose 30 | void close(); 31 | 32 | static AnotherTestService create(Vertx vertx) { 33 | return new AnotherTestServiceImpl(vertx); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /vertx-web-validation/src/main/java/io/vertx/ext/web/validation/impl/parser/TupleParser.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.validation.impl.parser; 2 | 3 | import java.util.List; 4 | import java.util.stream.Stream; 5 | 6 | public abstract class TupleParser { 7 | 8 | private final ValueParser[] itemsParser; 9 | private final ValueParser additionalItemsParser; 10 | 11 | @SuppressWarnings("unchecked") 12 | public TupleParser(List> itemsParser, ValueParser additionalItemsParser) { 13 | this.itemsParser = itemsParser.toArray(new ValueParser[0]); 14 | this.additionalItemsParser = additionalItemsParser != null ? additionalItemsParser : ValueParser.NOOP_PARSER; 15 | } 16 | 17 | protected Stream parseItem(int i, String serialized) { 18 | if (i < itemsParser.length) 19 | return Stream.of(parseValue(serialized, itemsParser[i])); 20 | else if (additionalItemsParser != null) 21 | return Stream.of(parseValue(serialized, additionalItemsParser)); 22 | else 23 | return null; 24 | } 25 | 26 | private Object parseValue(String v, ValueParser parser) { 27 | return mustNullateValue(v, parser) ? null : parser.parse(v); 28 | } 29 | 30 | protected abstract boolean mustNullateValue(String serialized, ValueParser parser); 31 | } 32 | -------------------------------------------------------------------------------- /vertx-web-validation/src/main/java/io/vertx/ext/web/validation/impl/parameter/ParameterProcessor.java: -------------------------------------------------------------------------------- 1 | package io.vertx.ext.web.validation.impl.parameter; 2 | 3 | import io.vertx.core.Future; 4 | import io.vertx.ext.web.validation.RequestParameter; 5 | import io.vertx.ext.web.validation.impl.ParameterLocation; 6 | import io.vertx.ext.web.validation.impl.validator.ValueValidator; 7 | 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | /** 12 | * Entry point for managing request parameters 13 | */ 14 | public interface ParameterProcessor { 15 | 16 | Future process(Map> params); 17 | 18 | String getName(); 19 | 20 | ParameterLocation getLocation(); 21 | 22 | /** 23 | * Create a new request parameter processor 24 | * 25 | * @param parameterName Name of the parameter 26 | * @param location Location of the parameter 27 | * @param isOptional true if is optional 28 | * @param parser parser for the parameter 29 | * @param validator validator for the parameter 30 | * @return 31 | */ 32 | static ParameterProcessor create(String parameterName, ParameterLocation location, boolean isOptional, ParameterParser parser, ValueValidator validator) { 33 | return new ParameterProcessorImpl(parameterName, location, isOptional, parser, validator); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /vertx-web/src/test/java/io/vertx/ext/web/LRUCacheTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Red Hat, Inc. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Apache License v2.0 which accompanies this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * 11 | * The Apache License v2.0 is available at 12 | * http://www.opensource.org/licenses/apache2.0.php 13 | * 14 | * You may elect to redistribute this code under either of these licenses. 15 | */ 16 | 17 | package io.vertx.ext.web; 18 | 19 | import io.vertx.ext.web.impl.LRUCache; 20 | import org.junit.Test; 21 | 22 | import java.util.Map; 23 | 24 | /** 25 | * @author Tim Fox 26 | */ 27 | public class LRUCacheTest extends LRUCacheTestBase { 28 | 29 | @Override 30 | protected Map createCache() { 31 | return new LRUCache<>(maxSize); 32 | } 33 | 34 | @Test(expected=IllegalArgumentException.class) 35 | public void testCacheInvalidSize1() { 36 | new LRUCache<>(0); 37 | } 38 | 39 | @Test(expected=IllegalArgumentException.class) 40 | public void testCacheInvalidSize2() { 41 | new LRUCache<>(-1); 42 | } 43 | 44 | 45 | } 46 | -------------------------------------------------------------------------------- /vertx-web/src/main/java/io/vertx/ext/web/handler/AuthenticationHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Red Hat, Inc. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Apache License v2.0 which accompanies this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * 11 | * The Apache License v2.0 is available at 12 | * http://www.opensource.org/licenses/apache2.0.php 13 | * 14 | * You may elect to redistribute this code under either of these licenses. 15 | */ 16 | 17 | package io.vertx.ext.web.handler; 18 | 19 | import io.vertx.codegen.annotations.VertxGen; 20 | import io.vertx.core.Handler; 21 | import io.vertx.ext.web.RoutingContext; 22 | 23 | /** 24 | * Base interface for auth handlers. 25 | *

26 | * An auth handler allows your application to provide authentication support. 27 | *

28 | * An Auth handler may require a {@link SessionHandler} to be on the routing chain before it. 29 | * 30 | * @author Tim Fox 31 | * @author Paulo Lopes 32 | */ 33 | @VertxGen(concrete = false) 34 | public interface AuthenticationHandler extends Handler { 35 | } 36 | -------------------------------------------------------------------------------- /vertx-web/src/main/java/io/vertx/ext/web/handler/ResponseTimeHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Red Hat, Inc. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Apache License v2.0 which accompanies this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * 11 | * The Apache License v2.0 is available at 12 | * http://www.opensource.org/licenses/apache2.0.php 13 | * 14 | * You may elect to redistribute this code under either of these licenses. 15 | */ 16 | 17 | package io.vertx.ext.web.handler; 18 | 19 | import io.vertx.codegen.annotations.VertxGen; 20 | import io.vertx.ext.web.handler.impl.ResponseTimeHandlerImpl; 21 | 22 | /** 23 | * Handler which adds a header `x-response-time` in the response of matching requests containing the time taken 24 | * in ms to process the request. 25 | * 26 | * @author Tim Fox 27 | */ 28 | @VertxGen 29 | public interface ResponseTimeHandler extends PlatformHandler { 30 | 31 | /** 32 | * Create a handler 33 | * 34 | * @return the handler 35 | */ 36 | static ResponseTimeHandler create() { 37 | return new ResponseTimeHandlerImpl(); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /vertx-web/src/test/sockjs-protocol/ws4py/compat.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | __doc__ = """ 3 | This compatibility module is inspired by the one found 4 | in CherryPy. It provides a common entry point for the various 5 | functions and types that are used with ws4py but which 6 | differ from Python 2.x to Python 3.x 7 | 8 | There are likely better ways for some of them so feel 9 | free to provide patches. 10 | 11 | Note this has been tested against 2.7 and 3.3 only but 12 | should hopefully work fine with other versions too. 13 | """ 14 | import sys 15 | 16 | if sys.version_info >= (3, 0): 17 | py3k = True 18 | from urllib.parse import urlsplit 19 | range = range 20 | unicode = str 21 | basestring = (bytes, str) 22 | _ord = ord 23 | 24 | def get_connection(fileobj): 25 | return fileobj.raw._sock 26 | 27 | def detach_connection(fileobj): 28 | fileobj.detach() 29 | 30 | def ord(c): 31 | if isinstance(c, int): 32 | return c 33 | return _ord(c) 34 | else: 35 | py3k = False 36 | from urlparse import urlsplit 37 | range = xrange 38 | unicode = unicode 39 | basestring = basestring 40 | ord = ord 41 | 42 | def get_connection(fileobj): 43 | return fileobj._sock 44 | 45 | def detach_connection(fileobj): 46 | fileobj._sock = None 47 | -------------------------------------------------------------------------------- /vertx-template-engines/vertx-web-templ-jte/src/main/java/io/vertx/ext/web/templ/jte/impl/JteBufferUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Red Hat, Inc. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Apache License v2.0 which accompanies this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * 11 | * The Apache License v2.0 is available at 12 | * http://www.opensource.org/licenses/apache2.0.php 13 | * 14 | * You may elect to redistribute this code under either of these licenses. 15 | */ 16 | package io.vertx.ext.web.templ.jte.impl; 17 | 18 | 19 | import gg.jte.output.Utf8ByteOutput; 20 | import io.vertx.core.buffer.Buffer; 21 | 22 | import java.io.IOException; 23 | import java.io.UncheckedIOException; 24 | 25 | /** 26 | * @author Andreas Hager 27 | */ 28 | public class JteBufferUtil { 29 | 30 | public static Buffer toBuffer(Utf8ByteOutput output) { 31 | Buffer buffer = Buffer.buffer(output.getContentLength()); 32 | 33 | try { 34 | output.writeTo(buffer::appendBytes); 35 | } catch (IOException e) { 36 | throw new UncheckedIOException(e); 37 | } 38 | 39 | return buffer; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /vertx-web-common/src/main/java/io/vertx/ext/web/common/template/impl/TemplateHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Red Hat, Inc. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Apache License v2.0 which accompanies this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * 11 | * The Apache License v2.0 is available at 12 | * http://www.opensource.org/licenses/apache2.0.php 13 | * 14 | * You may elect to redistribute this code under either of these licenses. 15 | */ 16 | package io.vertx.ext.web.common.template.impl; 17 | 18 | import io.vertx.core.shareddata.Shareable; 19 | 20 | /** 21 | * @author Paulo Lopes 22 | */ 23 | public class TemplateHolder implements Shareable { 24 | 25 | private final T template; 26 | private final String baseDir; 27 | 28 | public TemplateHolder(T template) { 29 | this(template, null); 30 | } 31 | 32 | public TemplateHolder(T template, String baseDir) { 33 | this.template = template; 34 | this.baseDir = baseDir; 35 | } 36 | 37 | public T template() { 38 | return template; 39 | } 40 | 41 | public String baseDir() { 42 | return baseDir; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /vertx-web-graphql/src/test/java/io/vertx/ext/web/handler/graphql/UnsupportedMethodTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Red Hat, Inc. 3 | * 4 | * Red Hat licenses this file to you under the Apache License, version 2.0 5 | * (the "License"); you may not use this file except in compliance with the 6 | * License. You may obtain a copy of the License at: 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | package io.vertx.ext.web.handler.graphql; 18 | 19 | import org.junit.Test; 20 | 21 | import static io.vertx.core.http.HttpMethod.PUT; 22 | 23 | /** 24 | * @author Thomas Segismont 25 | */ 26 | public class UnsupportedMethodTest extends GraphQLTestBase { 27 | 28 | @Test 29 | public void testUnsupportedMethod() throws Exception { 30 | GraphQLRequest request = new GraphQLRequest() 31 | .setMethod(PUT) 32 | .setGraphQLQuery("query { allLinks { url } }"); 33 | request.send(client, 405, onSuccess(v -> { 34 | testComplete(); 35 | })); 36 | await(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vertx-web-openapi/src/test/resources/specs/shared_request_body.yaml: -------------------------------------------------------------------------------- 1 | openapi: 3.0.0 2 | info: 3 | description: bug repro 4 | version: 1.0.0 5 | title: bug repro 6 | 7 | paths: 8 | /v1/working: 9 | post: 10 | operationId: thisWayWorks 11 | requestBody: 12 | required: true 13 | content: 14 | application/json: 15 | schema: 16 | $ref: '#/components/schemas/Bug' 17 | responses: 18 | '200': 19 | $ref: '#/components/responses/200_Bug' 20 | 21 | /v1/notworking: 22 | post: 23 | operationId: thisWayBroken 24 | requestBody: 25 | $ref: '#/components/requestBodies/Bug' 26 | responses: 27 | '200': 28 | $ref: '#/components/responses/200_Bug' 29 | 30 | components: 31 | requestBodies: 32 | Bug: 33 | required: true 34 | content: 35 | application/json: 36 | schema: 37 | $ref: '#/components/schemas/Bug' 38 | responses: 39 | 200_Bug: 40 | description: Bug 41 | content: 42 | application/json: 43 | schema: 44 | $ref: '#/components/schemas/Bug' 45 | schemas: 46 | Bug: 47 | type: object 48 | properties: 49 | id: 50 | type: string 51 | name: 52 | type: string 53 | required: 54 | - name 55 | --------------------------------------------------------------------------------