RESTX, the lightweight Java REST framework

Related tags

Spring Boot restx
Overview

RESTX - the lightweight Java REST framework

Build Status

RESTX is a full lightweight disrupting stack, which includes Swagger-like ui & considers REST specs tests as docs.

It shares similarities with modern frameworks like Play! like hot compile and a very productive experience, but focused on REST and pure Java.

It's licensed under the very commercial friendly Apache License 2, and is actively maintained by a community of developers.

You can get more details from the web site at http://restx.io/

Here you will find the build instructions if you want to build RESTX yourself, and why not contribute to the project.

Build

RESTX requires Java 7.

You can build it using either Maven 2+ or EasyAnt.

With Maven:

mvn install

With EasyAnt:

easyant test package

Changing dependencies

The sources for module descriptors are the md.restx.json files located in each module, and the restx.build.properties for the dependencies version.

Maven poms and EasyAnt Ivy files are generated from these files using restx build generate pom + build generate ivy.

Project organisation

RESTX is decomposed in a set of modules, each one following the traditional Java project layout (main sources in src/main, test sources in src/test).

The main modules are restx-core and restx-factory.

Here is a brief summary of each module:

Main modules:

  • restx-common: Some shared utilities, only few ones, relying on Guava we already get a lot of nice utilities from there.
  • restx-factory: RESTX Dependency Injection (DI) container. Brought as transitive dependency from restx-core.
  • restx-classloader: Hot reload / hot compile support
  • restx-apidocs-doclet: Some javadoc doclets used when generating apidocs
  • restx-core: Core module, includes the REST framework, base security, JSON support, ...

By relying on restx-core module, every modules described above will be retrieved as transitive dependencies

  • restx-core-annotation-processor: Annotation processing to generate routers based on RESTX core annotations. Needed at compile/build time only.

Optional dependencies providing specific features

  • restx-i18n: I18n Support
  • restx-security-basic: A basic implementation of security, still enough in many cases but you can remove it at will
  • restx-core-java8: Java 8 support (like Optional) for restx
  • restx-specs-tests: Enables using RESTX specs as JUnit tests.
  • restx-specs-tests-java8: Support for java 8 time API during specs tests
  • restx-specs-server: Enables using RESTX specs as HTTP mocks (running a server serving spec files responses given spec files requests).
  • restx-factory-testing: A module dedicated to test restx-factory features involving annotation processing.
  • restx-validation: Bean validation support (based on hibernate-validator implementation) for POJOs BODY parameters
  • restx-webjars: Webjars support through urls like /@/webjars/*

MongoDB support through Jongo API:

  • restx-jongo: Main MongoDB support through Jongo API.
  • restx-jongo-specs-tests: Support of Jongo in your specs (recording and running).

Admin console modules (these are not required modules and are intended only for administration/monitoring) :

  • restx-admin: The pluggable RESTX admin web console.
  • restx-apidocs: The famous API Docs web console, as a plugin for restx-admin.
  • restx-monitor-admin: Poor's man app monitoring web console, plugin for restx-admin.
  • restx-factory-admin: RESTX Factory admin console, plugin for restx-admin.
  • restx-log-admin: Easy configuration of logback logging from admin console, plugin for restx-admin.
  • restx-specs-admin: RESTX Specs recording and running web console, plugin for restx-admin.
  • restx-i18n-admin: Easy setting of your i18n translations from the web console, plugin for restx-admin.
  • restx-stats-admin: Used to collect stats as explained here

Servers support:

  • restx-servlet: Servlet 2.5+ adapter for RESTX, allowing to embed RESTX in any servlet 2.5+ container.
  • restx-server-jetty8: Embedded Jetty 8 support.
  • restx-server-tomcat: Embedded Tomcat support.
  • restx-server-simple: SimpleFramework adapter for RESTX, this is the lightest and fastest solution.
  • restx-server-testing: JUnit tests for all the supported embedded servers.

restx-server-* are needed only if you want to be able to run restx as a standalone app rather than deploying it If you want to deploy in a web server, you will restx-servlet

Metrics:

  • restx-monitor-codahale: Codahale metrics for monitor module. Not compatible with Google App Engine.

Others:

  • restx-samplest: both a sample of individual features and JUnit tests of them
  • restx-samplest-java8: Same as restx-samplest but for demo-ing restx java8 support
  • restx-annotation-processors-package: assembly module for annotation processor only, if you prefer to setup annotation processing manually with -proc javac option
  • restx-barbarywatch: MacOSX filesystem watching that actually works. Only module with GPL license, but no other module depend on it, it's detected at runtime, and used only during development

Contributing

Contributions are welcome, fork the repo, push your changes to a branch and send a Pull Request.

To be sure the PR will be merged please discuss it on the google group before, or create an issue on GitHub to initiate the discussion.

Comments
  • Different RestxSession cookie names for different apps & Optional injectable components support

    Different RestxSession cookie names for different apps & Optional injectable components support

    When developping several restx application (thus, working on localhost domain), restx cookies are interfering since their names are the same. Moreover, it would be nice to be able to change the RestxSession & RestxSessionSignature cookie names if the restx user doesn't want to tell its consumer that the serverside technology is based on restx.

    Proposition here, is to define :

    • An app.name @Named String, not set by default (to keep backward compatibility), allowing to suffix restx session cookie name with an app name. Thus, you will be able to work on different apps locally, which will have specific cookie names for the localhost domain name.
    • A RestxSessionCookieDescriptor component, intended to welcome generated cookie names, @Provided by default in SecurityFactory with following values : -- RestxSession & RestxSessionSignature if app.name @Named String has not been defined (this will keep bacward compatibility) -- RestxSession-${app.name} & RestxSessionSignature-${app.name} is app.name @Named String has been defined Obviously, this behaviour can be overriden at the user convenience.

    Note that if merged, you will need to update the Generated app explained documentation page, in order to talk about the app.name @Named String.

    EDIT : Updated current pull request with another feature which was needed prior to the RestxSession cookie name generation : handling Optional injectable components. That is to say, if a @Provide method signature is looking like this :

    @Provides
    public Foo foo(Optional<Bar> bar) {
    }
    

    The Bar resolved component will be injected only if found. Otherwise, the Optional.absent() value will be provided. This will obviously work on @Named components too. Note that as soon as you're relying on an Optional component, you :

    • Will need to provide a Generic to the Optional used (otherwise, you will have a compile-time error)
    • Won't have any component existence check (since you explicitely said you're not hardly relying on the bar component)
    opened by fcamblor 14
  • Regression in 0.35 on Jongo id generation

    Regression in 0.35 on Jongo id generation

    We have a serious regression in released-but-not-announced-yet 0.35 version for RestX, regarding mongo id generation based on jongo

    First of all, you will be encouraged by Jongo to make following steps :

    • Replace deprecated @ObjectId annotation by @MongoObjectId
    • Replace deprecated @Id annotation by @MongoObjectId @JsonProperty("_id") (@JsonProperty annotation being required only if your field as a different name than _id, for example you name it id)

    Those migration steps are not impacting the regression (we encounter the regression both on "old" and "new" annotations)

    I created a branch on my repository to spot this regression : tests on this branch are green on 0.34 and not on 0.35.

    I identified 3 cases so far :

    ✅ Using @Id/@MongoId annotation AND ObjectId field type

    Following syntax :

    @MongoId @JsonProperty("_id")
    private ObjectId id;
    

    which corresponds to following legacy syntax :

    @Id
    private ObjectId id;
    

    If you're in that case, then no regression will be impacting you

    ⛔️ Using @ObjectId @Id/@MongoId @MongoObjectId @JsonProperty("_id") annotations AND String field type

    Following syntax is currently hitting one bug :

    @MongoId @MongoObjectId @JsonProperty("_id")
    private String id;
    

    which corresponds to following legacy syntax :

    @ObjectId @Id
    private String id;
    

    The detailed bug seems related to [email protected] incompatibility with [email protected] (see this jongo issue related to this bson4jackson issue) as we get following error :

    ERROR restx.StdRestxMainRouter - request raised BsonSerializationException: While decoding a BSON document 4 bytes were required, but only 0 remain
    org.bson.BsonSerializationException: While decoding a BSON document 4 bytes were required, but only 0 remain
    
    Full stacktrace
    ERROR restx.StdRestxMainRouter - request raised BsonSerializationException: While decoding a BSON document 4 bytes were required, but only 0 remain
    org.bson.BsonSerializationException: While decoding a BSON document 4 bytes were required, but only 0 remain
    	at org.bson.io.ByteBufferBsonInput.ensureAvailable(ByteBufferBsonInput.java:218) ~[mongo-java-driver-3.4.0.jar:na]
    	at org.bson.io.ByteBufferBsonInput.readInt32(ByteBufferBsonInput.java:106) ~[mongo-java-driver-3.4.0.jar:na]
    	at org.bson.BsonBinaryWriter.pipe(BsonBinaryWriter.java:304) ~[mongo-java-driver-3.4.0.jar:na]
    	at com.mongodb.DBEncoderAdapter.encode(DBEncoderAdapter.java:47) ~[mongo-java-driver-3.4.0.jar:na]
    	at com.mongodb.DBEncoderFactoryAdapter.encode(DBEncoderFactoryAdapter.java:33) ~[mongo-java-driver-3.4.0.jar:na]
    	at com.mongodb.DBEncoderFactoryAdapter.encode(DBEncoderFactoryAdapter.java:23) ~[mongo-java-driver-3.4.0.jar:na]
    	at com.mongodb.CompoundDBObjectCodec.encode(CompoundDBObjectCodec.java:48) ~[mongo-java-driver-3.4.0.jar:na]
    	at com.mongodb.CompoundDBObjectCodec.encode(CompoundDBObjectCodec.java:27) ~[mongo-java-driver-3.4.0.jar:na]
    	at org.bson.codecs.BsonDocumentWrapperCodec.encode(BsonDocumentWrapperCodec.java:63) ~[mongo-java-driver-3.4.0.jar:na]
    	at org.bson.codecs.BsonDocumentWrapperCodec.encode(BsonDocumentWrapperCodec.java:29) ~[mongo-java-driver-3.4.0.jar:na]
    	at com.mongodb.connection.RequestMessage.addDocument(RequestMessage.java:253) ~[mongo-java-driver-3.4.0.jar:na]
    	at com.mongodb.connection.RequestMessage.addCollectibleDocument(RequestMessage.java:219) ~[mongo-java-driver-3.4.0.jar:na]
    	at com.mongodb.connection.InsertMessage.encodeMessageBodyWithMetadata(InsertMessage.java:73) ~[mongo-java-driver-3.4.0.jar:na]
    	at com.mongodb.connection.RequestMessage.encodeWithMetadata(RequestMessage.java:160) ~[mongo-java-driver-3.4.0.jar:na]
    	at com.mongodb.connection.WriteProtocol.execute(WriteProtocol.java:89) ~[mongo-java-driver-3.4.0.jar:na]
    	at com.mongodb.connection.InsertProtocol.execute(InsertProtocol.java:68) ~[mongo-java-driver-3.4.0.jar:na]
    	at com.mongodb.connection.InsertProtocol.execute(InsertProtocol.java:39) ~[mongo-java-driver-3.4.0.jar:na]
    	at com.mongodb.connection.DefaultServer$DefaultServerProtocolExecutor.execute(DefaultServer.java:168) ~[mongo-java-driver-3.4.0.jar:na]
    	at com.mongodb.connection.DefaultServerConnection.executeProtocol(DefaultServerConnection.java:289) ~[mongo-java-driver-3.4.0.jar:na]
    	at com.mongodb.connection.DefaultServerConnection.insert(DefaultServerConnection.java:76) ~[mongo-java-driver-3.4.0.jar:na]
    	at com.mongodb.operation.InsertOperation.executeProtocol(InsertOperation.java:66) ~[mongo-java-driver-3.4.0.jar:na]
    	at com.mongodb.operation.BaseWriteOperation$1.call(BaseWriteOperation.java:141) ~[mongo-java-driver-3.4.0.jar:na]
    	at com.mongodb.operation.BaseWriteOperation$1.call(BaseWriteOperation.java:133) ~[mongo-java-driver-3.4.0.jar:na]
    	at com.mongodb.operation.OperationHelper.withConnectionSource(OperationHelper.java:422) ~[mongo-java-driver-3.4.0.jar:na]
    	at com.mongodb.operation.OperationHelper.withConnection(OperationHelper.java:413) ~[mongo-java-driver-3.4.0.jar:na]
    	at com.mongodb.operation.BaseWriteOperation.execute(BaseWriteOperation.java:133) ~[mongo-java-driver-3.4.0.jar:na]
    	at com.mongodb.operation.BaseWriteOperation.execute(BaseWriteOperation.java:60) ~[mongo-java-driver-3.4.0.jar:na]
    	at com.mongodb.Mongo.execute(Mongo.java:845) ~[mongo-java-driver-3.4.0.jar:na]
    	at com.mongodb.Mongo$2.execute(Mongo.java:828) ~[mongo-java-driver-3.4.0.jar:na]
    	at com.mongodb.DBCollection.executeWriteOperation(DBCollection.java:342) ~[mongo-java-driver-3.4.0.jar:na]
    	at com.mongodb.DBCollection.insert(DBCollection.java:337) ~[mongo-java-driver-3.4.0.jar:na]
    	at com.mongodb.DBCollection.insert(DBCollection.java:328) ~[mongo-java-driver-3.4.0.jar:na]
    	at com.mongodb.DBCollection.insert(DBCollection.java:298) ~[mongo-java-driver-3.4.0.jar:na]
    	at com.mongodb.DBCollection.insert(DBCollection.java:264) ~[mongo-java-driver-3.4.0.jar:na]
    	at org.jongo.Insert.insert(Insert.java:59) ~[jongo-1.3.0.jar:na]
    	at org.jongo.MongoCollection.insert(MongoCollection.java:140) ~[jongo-1.3.0.jar:na]
    	at org.jongo.MongoCollection.insert(MongoCollection.java:132) ~[jongo-1.3.0.jar:na]
    	at samplest.jongo.MongoResource.createObjectWithObjectIdAnnotation(MongoResource.java:75) ~[classes/:na]
    	at samplest.jongo.MongoResourceRouter$2.doRoute(MongoResourceRouter.java:109) ~[classes/:na]
    	at samplest.jongo.MongoResourceRouter$2.doRoute(MongoResourceRouter.java:104) ~[classes/:na]
    	at restx.entity.StdEntityRoute.handle(StdEntityRoute.java:250) ~[classes/:na]
    	at restx.RestxHandlerMatch.handle(RestxHandlerMatch.java:56) ~[classes/:na]
    	at restx.ResponseCloserFilter.handle(ResponseCloserFilter.java:28) ~[classes/:na]
    	at restx.RestxHandlerMatch.handle(RestxHandlerMatch.java:56) ~[classes/:na]
    	at restx.CacheFilter$1.handle(CacheFilter.java:51) ~[classes/:na]
    	at restx.RestxHandlerMatch.handle(RestxHandlerMatch.java:56) ~[classes/:na]
    	at restx.security.RestxSessionLogFilter.handle(RestxSessionLogFilter.java:43) ~[classes/:na]
    	at restx.RestxHandlerMatch.handle(RestxHandlerMatch.java:56) ~[classes/:na]
    	at restx.security.RestxSessionCookieFilter.handle(RestxSessionCookieFilter.java:100) ~[classes/:na]
    	at restx.RestxHandlerMatch.handle(RestxHandlerMatch.java:56) ~[classes/:na]
    	at restx.StdRestxMainRouter.route(StdRestxMainRouter.java:153) ~[classes/:na]
    	at restx.RestxMainRouterFactory$PerRequestFactoryLoader.route(RestxMainRouterFactory.java:233) [classes/:na]
    	at restx.RestxMainRouterFactory$RecordingMainRouter.route(RestxMainRouterFactory.java:190) [classes/:na]
    	at restx.servlet.AbstractRestxMainRouterServlet.service(AbstractRestxMainRouterServlet.java:48) [classes/:na]
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) [javax.servlet-3.0.0.v201112011016.jar:na]
    	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:669) [jetty-servlet-8.1.8.v20121106.jar:8.1.8.v20121106]
    	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:455) [jetty-servlet-8.1.8.v20121106.jar:8.1.8.v20121106]
    	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137) [jetty-server-8.1.8.v20121106.jar:8.1.8.v20121106]
    	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:536) [jetty-security-8.1.8.v20121106.jar:8.1.8.v20121106]
    	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231) [jetty-server-8.1.8.v20121106.jar:8.1.8.v20121106]
    	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1072) [jetty-server-8.1.8.v20121106.jar:8.1.8.v20121106]
    	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:382) [jetty-servlet-8.1.8.v20121106.jar:8.1.8.v20121106]
    	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193) [jetty-server-8.1.8.v20121106.jar:8.1.8.v20121106]
    	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1006) [jetty-server-8.1.8.v20121106.jar:8.1.8.v20121106]
    	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135) [jetty-server-8.1.8.v20121106.jar:8.1.8.v20121106]
    	at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52) [jetty-server-8.1.8.v20121106.jar:8.1.8.v20121106]
    	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154) [jetty-server-8.1.8.v20121106.jar:8.1.8.v20121106]
    	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) [jetty-server-8.1.8.v20121106.jar:8.1.8.v20121106]
    	at org.eclipse.jetty.server.Server.handle(Server.java:365) [jetty-server-8.1.8.v20121106.jar:8.1.8.v20121106]
    	at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:485) [jetty-server-8.1.8.v20121106.jar:8.1.8.v20121106]
    	at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:937) [jetty-server-8.1.8.v20121106.jar:8.1.8.v20121106]
    	at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:998) [jetty-server-8.1.8.v20121106.jar:8.1.8.v20121106]
    	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:856) [jetty-http-8.1.8.v20121106.jar:8.1.8.v20121106]
    	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240) [jetty-http-8.1.8.v20121106.jar:8.1.8.v20121106]
    	at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82) [jetty-server-8.1.8.v20121106.jar:8.1.8.v20121106]
    	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628) [jetty-io-8.1.8.v20121106.jar:8.1.8.v20121106]
    	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52) [jetty-io-8.1.8.v20121106.jar:8.1.8.v20121106]
    	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) [jetty-util-8.1.8.v20121106.jar:8.1.8.v20121106]
    	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) [jetty-util-8.1.8.v20121106.jar:8.1.8.v20121106]
    	at java.lang.Thread.run(Thread.java:748) [na:1.8.0_144]
    

    ⛔️ Using @Id/@MongoId @JsonProperty("_id") annotations AND String field type

    Following syntax is currently hitting another bug :

    @MongoId @JsonProperty("_id")
    private String id;
    

    which corresponds to following legacy syntax :

    @Id
    private String id;
    

    In that case, the regression is id will be null after a call to JongoCollection.insert(). In 0.34 it was NOT null (id where populated).

    The thing about this issue is it is completely "silent" (no error thrown), so you may not be aware of it if you migrate to 0.35 !

    This issue seems related to [email protected] => [email protected] migration : https://github.com/bguerout/jongo/issues/325

    bug 
    opened by fcamblor 12
  • Better cold classes management

    Better cold classes management

    This PR permits to manage several new things about cold classes.

    • It permits to add inherited classes of cold components (components being loaded in the main factory, such as AutoStartable ones) in cold classes list.
    • It adds a way to declare cold classes using a property: restx.cold.classes. The property value is a list of fqcn separated by :.
    • It adds a way to declare cold classes using a resource file: META-INF/cold-classes.list. Resources will be loaded from the classloader, and every classes listed will be added to the cold classes list. The file must contains a list of fqcn, one per line.
    • It provides a way to fulfil the resource file using an annotation: @Cold. So every classes annotated with @Cold will be added to the resource file (thanks to a new annotation processor).
    opened by a-peyrard 12
  • Packaging restx archives

    Packaging restx archives

    This is a follow up for #62 I provided a new app archive command, allowing to generate a restx archive.

    Some insight about the restx archive : the hello-world application generated from a restx app new will generate something like this :

    $> tree
    .
    ├── META-INF
    │   ├── restx
    │   │   └── app
    │   │       ├── data
    │   │       │   ├── credentials.json
    │   │       │   └── users.json
    │   │       ├── md.restx.json
    │   │       ├── module.ivy
    │   │       ├── pom.xml
    │   │       └── src
    │   │           ├── main
    │   │           │   ├── java
    │   │           │   │   └── helloworld
    │   │           │   │       ├── AppModule.java
    │   │           │   │       ├── AppServer.java
    │   │           │   │       ├── Roles.java
    │   │           │   │       ├── domain
    │   │           │   │       │   └── Message.java
    │   │           │   │       └── rest
    │   │           │   │           └── HelloResource.java
    │   │           │   ├── resources
    │   │           │   │   └── logback.xml
    │   │           │   └── webapp
    │   │           │       └── WEB-INF
    │   │           │           └── web.xml
    │   │           └── test
    │   │               ├── java
    │   │               │   └── helloworld
    │   │               │       └── rest
    │   │               │           └── HelloResourceSpecTest.java
    │   │               └── resources
    │   │                   └── specs
    │   │                       └── hello
    │   │                           ├── should_admin_say_hello.spec.yaml
    │   │                           ├── should_user1_say_hello.spec.yaml
    │   │                           └── should_user2_not_say_hello.spec.yaml
    │   └── services
    │       └── restx.factory.FactoryMachine
    ├── helloworld
    │   ├── AppModule.class
    │   ├── AppModuleFactoryMachine$1.class
    │   ├── AppModuleFactoryMachine$2.class
    │   ├── AppModuleFactoryMachine$3.class
    │   ├── AppModuleFactoryMachine$4.class
    │   ├── AppModuleFactoryMachine$5.class
    │   ├── AppModuleFactoryMachine.class
    │   ├── AppServer.class
    │   ├── Roles.class
    │   ├── domain
    │   │   └── Message.class
    │   └── rest
    │       ├── HelloResource.class
    │       ├── HelloResourceFactoryMachine$1.class
    │       ├── HelloResourceFactoryMachine.class
    │       ├── HelloResourceRouter$1.class
    │       ├── HelloResourceRouter.class
    │       ├── HelloResourceRouterFactoryMachine$1.class
    │       └── HelloResourceRouterFactoryMachine.class
    └── logback.xml
    

    ATM, I'm packaging sources files into the restx archive (because api doc might rely on it to display source contents) For the same reason, I package the src/test/* file hierarchy.

    You can test it easily :

    restx app new
    ................
    restx app archive /tmp/hello.jar
    ................
    restx app grab file:///tmp/hello.jar + app run
    

    FYI, I just created a maven-restx-plugin which will re-use the RestxArchive.pack() utility method, in order to package a standard restx archive (with -restx classifier).

    Important note : having the *.class files in the archive is totally useless since the first thing I do in app grab is to unzip & chroot to META-INF/restx/app/ directory (then, auto compile does the stuff for us).

    opened by fcamblor 12
  • [breaking] Variabilized security roles

    [breaking] Variabilized security roles

    This PR allows to define "variabilized" security roles based on what we have in query params or path param for a dedicated endpoint.

    It will allow to typically have such endpoint checks :

        @GET("/security/{companyId}/{subCompanyId}")
        @RolesAllowed("EDIT_COMPANY_{companyId}_{subCompanyId}")
        public String editSubCompany(String companyId, String subCompanyId){
            // ....
        }
    

    Changes have been made to StdRestxSecurityManager in order to generate a role interpolation map, basically with query & path parameters (but which may be overwritten with specific stuff if wanted on every project .. you'll only need to @Provide another StdRestxSecurityManager)

    By introducing variabilized roles, I added a support for wildcards on roles located in RestxPrincipal That is to say, if current user has role named EDIT_COMPANY_1234_* he will be able to call every urls like /security/1234/* without having any 403 Forbidden response. The wildcard roles checks are generated at compilation time through RestxAnnotationProcessor (because variable cartesian product may take some time to generate, which we would like to avoid at runtime).

    That is to say, corresponding generated code for endpoint above will be :

            new StdEntityRoute<Void, java.lang.String>("default#SecuredResource#editSubCompany",
                    readerRegistry.<Void>build(Void.class, Optional.<String>absent()),
                    writerRegistry.<java.lang.String>build(java.lang.String.class, Optional.<String>absent()),
                    new StdRestxRequestMatcher("GET", "/security/{companyId}/{subCompanyId}"),
                    HttpStatus.OK, RestxLogLevel.DEFAULT) {
                @Override
                protected Optional<java.lang.String> doRoute(RestxRequest request, RestxRequestMatch match, Void body) throws IOException {
                    securityManager.check(request, match, anyOf(hasRole("EDIT_COMPANY_*_*"), hasRole("EDIT_COMPANY_*_{subCompanyId}"), hasRole("EDIT_COMPANY_{companyId}_*"), hasRole("EDIT_COMPANY_{companyId}_{subCompanyId}")));
                    return Optional.of(resource.editSubCompany(
                            /* [PATH] companyId */ match.getPathParam("companyId"),
                            /* [PATH] subCompanyId */ match.getPathParam("subCompanyId")
                    ));
                }
                // ....
    `
    ``
    
    opened by fcamblor 11
  • @ValidatedFor annotation support for validation groups

    @ValidatedFor annotation support for validation groups

    Proposal to support bean validation groups during validation.

    I'm not really satisfied by the current implementation and would like to open the discussion about it.

    At first, I was planning to implement usage below :

        @PermitAll
        @POST("/valid/pojos")
        public void createPOJOWithoutAnnotation(POJO myPojo) { // No @ValidatedFor annotation => Default validation group will be implicitly used here, keeping backward compat behaviour
            LOG.info("Pojo {} {} created !", myPojo.getName(), myPojo.getSubPOJO().getLabel());
        }
    
        @PermitAll
        @POST("/valid/pojos2")
        public void createPOJOWithAnnotation(@ValidatedFor(FormValidations.Create.class) POJO myPojo) { // Here, defining we want to activate the Create validation group mode on validation
            LOG.info("Pojo {} {} created !", myPojo.getName(), myPojo.getSubPOJO().getLabel());
        }
    
        @PermitAll
        @PUT("/valid/pojos/{id}")
        public void createPOJOWithoutAnnotation(Long id, @ValidatedFor({MyCustomValidationGroup.class, FormValidations.Update.class}) POJO myPojo) { // Multiple validation groups can be provided, following bean validation's Validator API
            LOG.info("Pojo {} {} updated !", myPojo.getName(), myPojo.getSubPOJO().getLabel());
        }
    

    with group declaration :

    public interface FormValidations {
        public static interface Create extends Default{}
        public static interface Update extends Default{}
    }
    
    public class ValidationResource {
    // ...
        public static interface MyCustomValidationGroup{}
    // ...
    }
    

    But I faced some issues at annotation processing time when retrieving @ValidatedFor.value() classes : didn't completely understood why, but some classes (either in restx-core or in samplest) were not accessible. You can see some testing I made in commit 7f88a79573d00d5d28c796d238aaf0dfdde1fdcf (from branch validations-validatedfor-with-class, some github comments describe what's going weird)

    Thus, I had to fallback from Class[] to String[] in order to directly provide validation group FQN used for source generation. Which makes declaration look like :

        @PermitAll
        @POST("/valid/pojos")
        public void createPOJOWithoutAnnotation(POJO myPojo) {
            LOG.info("Pojo {} {} created !", myPojo.getName(), myPojo.getSubPOJO().getLabel());
        }
    
        @PermitAll
        @POST("/valid/pojos2")
        public void createPOJOWithAnnotation(@ValidatedFor(FormValidations.CreateFQN) POJO myPojo) {
            LOG.info("Pojo {} {} created !", myPojo.getName(), myPojo.getSubPOJO().getLabel());
        }
    
        @PermitAll
        @PUT("/valid/pojos/{id}")
        public void createPOJOWithoutAnnotation(Long id, @ValidatedFor({MyCustomValidationGroupFQN, FormValidations.UpdateFQN}) POJO myPojo) {
            LOG.info("Pojo {} {} updated !", myPojo.getName(), myPojo.getSubPOJO().getLabel());
        }
    

    and group declaration :

    public interface FormValidations {
        public static final String DefaultFQN = "javax.validation.groups.Default";
        public static final String CreateFQN = "restx.validation.stereotypes.FormValidations.Create";
        public static interface Create extends Default{}
        public static final String UpdateFQN = "restx.validation.stereotypes.FormValidations.Update";
        public static interface Update extends Default{}
    }
    
    public class ValidationResource {
    // ...
        public static interface MyCustomValidationGroup{}
        public static final String MyCustomValidationGroupFQN = "samplest.validation.ValidationResource.MyCustomValidationGroup";
    // ...
    }
    

    If you see any workaround for this issue, I'm opened to discuss it.

    Another way would be to rely on reflection but I know this is something we should avoid, especially for such trivial things.

    opened by fcamblor 10
  • io.restx:restx-core-shell:0.2.9.1 seems broken

    io.restx:restx-core-shell:0.2.9.1 seems broken

    Just executed following steps under Mac OS X :

    $> rm -Rf ~/.restx/
    $> sudo rm /usr/local/bin/restx
    $> curl -s http://restx.io/install.sh | sh
    Downloading RESTX 0.2.9.1 distribution
    ######################################################################## 100.0%
    
    RESTX 0.2.9.1 has been installed in your home directory (~/.restx).
    Writing a launcher script to /usr/local/bin/restx for your convenience.
    This may prompt for your password.
    
    RESTX is now properly installed, you can launch it using the restx command.
    
    To get started, see the docs at:
    
      http://restx.io/docs/
    $> restx
    ===============================================================================
    == WELCOME TO RESTX SHELL - 0.2.9.1 - type `help` for help on available commands
    ===============================================================================
    restx> shell install
    :: loading settings :: url = jar:file:/Users/fcamblor/.restx/lib/restx-shell-0.2.9.1.jar!/restx/shell/ivysettings.xml
    looking for plugins...
    found 3 available plugins
     [  1] io.restx:restx-core-shell:0.2.9.1
            core commands: generate new app, ...
     [  2] io.restx:restx-build-shell:0.2.9.1
            build commands: generate pom, ivy, ...
     [  3] io.restx:restx-specs-shell:0.2.9.1
            specs commands: run a specs server, ...
    Which plugin would you like to install (eg '1 3 5')?
    You can also provide a plugin id in the form <groupId>:<moduleId>:<version>
     plugin to install: 1
    installing io.restx:restx-core-shell:0.2.9.1...
    installed io.restx:restx-core-shell:0.2.9.1
    installed 1 plugins, restarting shell to take them into account
    RESTARTING SHELL...
    
    Exception in thread "main" java.util.ServiceConfigurationError: restx.factory.FactoryMachine: Provider restx.jackson.FrontObjectMapperFactoryFactoryMachine could not be instantiated: java.lang.NoClassDefFoundError: com/fasterxml/jackson/datatype/joda/JodaModule
        at java.util.ServiceLoader.fail(ServiceLoader.java:224)
        at java.util.ServiceLoader.access$100(ServiceLoader.java:181)
        at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:370)
        at java.util.ServiceLoader$1.next(ServiceLoader.java:438)
        at com.google.common.collect.Iterators.addAll(Iterators.java:384)
        at com.google.common.collect.Iterables.addAll(Iterables.java:336)
        at com.google.common.collect.AbstractMultimap.putAll(AbstractMultimap.java:74)
        at com.google.common.collect.ArrayListMultimap.putAll(ArrayListMultimap.java:66)
        at restx.factory.Factory$Builder.addFromServiceLoader(Factory.java:103)
        at restx.shell.RestxShell.<init>(RestxShell.java:51)
        at restx.shell.RestxShell.main(RestxShell.java:317)
    Caused by: java.lang.NoClassDefFoundError: com/fasterxml/jackson/datatype/joda/JodaModule
        at restx.jackson.FrontObjectMapperFactoryFactoryMachine.<clinit>(FrontObjectMapperFactoryFactoryMachine.java:10)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:264)
        at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:362)
        ... 8 more
    Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.datatype.joda.JodaModule
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
        ... 12 more
    

    When re-launching the shell, same error.

    Seems like some dependencies are missing. I added them (com.fasterxml.jackson.datatype:jackson-datatype-joda:2.1.2, com.fasterxml.jackson.datatype:jackson-datatype-guava:2.1.2 and javax.validation:validation-api:1.1.0.Final) manually in the ~/.restx/lib/ folder and it solved the issue.

    But later, during a restx app run, I encountered new errors :

    $> restx app run
    ===============================================================================
    == WELCOME TO RESTX SHELL - 0.2.9.1 - BATCH MODE
    ===============================================================================
    > app run
    compiling App... [DONE]
    copying resources... [DONE]
    starting com.crowdstore.AppServer... - type `stop` to stop it and go back to restx shell
    Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/jetty/server/Connector
        at com.crowdstore.AppServer.main(AppServer.java:20)
    Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.server.Connector
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
        ... 1 more
    

    => I gave up :)

    Note that before adding manually the libs, I had :

    $> ls ~/.restx/lib
    compiler-0.8.11.jar             jackson-annotations-2.1.1.jar   javassist-3.16.1-GA.jar         logback-classic-1.0.11.jar      restx-factory-0.2.9.1.jar       xml-apis-1.0.b2.jar
    dom4j-1.6.1.jar                 jackson-core-2.1.1.jar          javax.inject-1.jar              logback-core-1.0.11.jar         restx-shell-0.2.9.1.jar
    guava-14.0.1.jar                jackson-databind-2.1.2.jar      jline-2.10.jar                  reflections-0.9.9-RC1.jar       restx-shell-manager-0.2.9.1.jar
    ivy-2.3.0.jar                   jamon-2.7.jar                   joda-time-2.2.jar               restx-common-0.2.9.1.jar        slf4j-api-1.7.5.jar
    
    bug 
    opened by fcamblor 9
  • $RestxSession special header, more samples in AppModule generated file (app.name, security) & test harness for restx-core-shell

    $RestxSession special header, more samples in AppModule generated file (app.name, security) & test harness for restx-core-shell

    Taking into account :

    • The new app.name component (using the restx shell's appName property)
    • Changing ordering of components, putting SignatureKey first, in order to follow documentation ordering on Generated app explained's AppModule section

    During implementation, some new features appeared :

    • Implementing a $RestxSession special header in restx specs files, allowing to define a restx session content (with proper cookie name, given available RestxCookieDescriptor component) and sign it with current SignatureKey component
    • Improved HelloResource sample by providing a basic security implementation sample and using the @RolesAllowed annotation
    • Provided a test harness in restx-core-shell allowing to validate that app new shell command generates a new app and this app has green tests
    opened by fcamblor 9
  • Improve watch service for windows

    Improve watch service for windows

    In windows, if a file is modified the default watch service is sending three events, one delete, one create and one modify. I will try to investigate in order to check if there is a solution for this, otherwise I think that we might solve this by creating a special event coalescor for windows, which will merge delete and create event for same files into a modify event.

    enhancement 
    opened by a-peyrard 8
  • Introducing restx archives

    Introducing restx archives

    It would be a good thing to allow to create some archive format dedicated to restx (for instance, *.restxar)

    Requirements for this archive would be :

    • To contain your project's class files
    • Your project's dependencies descriptor (located in /META-INF/)
    • Optionally your project's static resources Because of point 2, this restx archive should be really small (especially compared to a standard war which integrates every of its libraries)

    Purpose of this archive would be to add the ability to the restx-shell to provision dependencies then start your project with provisionned classpath. I'm thinking about something like restx app run myproject.restxar which would :

    • Read /META-INF/md.restx.json to gather dependencies coordinates
    • Call ivy to download these dependencies
    • Run the archive "as is" it was a jar, embedding it within a server (optionally, the server could be given as a parameter to the shell) and providing downloaded dependencies in the classpath
    enhancement shell 
    opened by fcamblor 8
  • MongoModule should implement AutoCloseable

    MongoModule should implement AutoCloseable

    Hi there,

    I was facing a strange issue with one of our app, let me explain what we're doing and what was causing this :

    • we run job through quartz
    • these jobs are using injection facilities provided by restx by creating a new factory then closing it when the job is done

    When the app was running for quite a long time, we were facing OOME : can not start new native thread from com.mongodb.Mongo. By digging into the code I found out that new MongoClient() creates a new Thread (named MongoCleaner), the problem is that, when we close the factory, the mongoClient is not closed.

    The actual fix (for this use case) consists in doing the following when closing the factory :

    final MongoClient client = factory.getComponent(MongoClient.class);
    if (client != null) {
        client.close();
    }
    factory.close();
    

    Do you think it is a real issue and thus should be fixed by making MongoModule implementing / or returning a AutoCloseable to do this kind of cleanup ?

    opened by CedricGatay 7
  • Is there a getHeaders() method?

    Is there a getHeaders() method?

    I can see that I'm able to getHeader(String), but I want to collect all x-* headers without knowing them in advance.

    I'm able to use req.unwrap(Request.class) to get the text request headers and parse.

    Just thought it would be nicer to have a getHeaders on the RestxRequest class.

    opened by jseparovic 1
  • Bump jackson-databind from 2.10.1 to 2.12.6.1

    Bump jackson-databind from 2.10.1 to 2.12.6.1

    Bumps jackson-databind from 2.10.1 to 2.12.6.1.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump snakeyaml from 1.25 to 1.31

    Bump snakeyaml from 1.25 to 1.31

    Bumps snakeyaml from 1.25 to 1.31.

    Commits
    • a3e641b Remove unused code for comments
    • d2ed568 Remove unused code
    • ab76f86 Add @​Deprecated annotation to constructs marked with @​deprecated javadoc.
    • bc7869b Make billionLaughsAttackTest.billionLaughsAttackExpanded() robust
    • 4cfb7b7 Merged in make-billion-laughs-attack-test-robust (pull request #7)
    • da5ba16 Update changes.xml
    • 23fbcef add test with JavaBean property of parameterized Collection
    • 6385279 change how we set detected type to JavaBean Collection property item
    • 0468784 force keyNode to be String for JavaBeans
    • 467bcc9 expect node to be scalar when enforcings String keys
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • [SECURITY] Fix Zip Slip Vulnerability

    [SECURITY] Fix Zip Slip Vulnerability

    Security Vulnerability Fix

    This pull request fixes a Zip Slip vulnerability either due to an insufficient, or missing guard when unzipping zip files.

    Even if you deem, as the maintainer of this project, this is not necessarily fixing a security vulnerability, it is still, most likely, a valid security hardening.

    Preamble

    Impact

    This issue allows a malicious zip file to potentially break out of the expected destination directory, writing contents into arbitrary locations on the file system. Overwriting certain files/directories could allow an attacker to achieve remote code execution on a target system by exploiting this vulnerability.

    Why?

    The best description of Zip-Slip can be found in the white paper published by Snyk: Zip Slip Vulnerability

    But I had a guard in place, why wasn't it sufficient?

    If the changes you see are a change to the guard, not the addition of a new guard, this is probably because this code contains a Zip-Slip vulnerability due to a partial path traversal vulnerability.

    To demonstrate this vulnerability, consider "/usr/outnot".startsWith("/usr/out"). The check is bypassed although /outnot is not under the /out directory. It's important to understand that the terminating slash may be removed when using various String representations of the File object. For example, on Linux, println(new File("/var")) will print /var, but println(new File("/var", "/") will print /var/; however, println(new File("/var", "/").getCanonicalPath()) will print /var.

    The Fix

    Implementing a guard comparing paths with the method java.nio.files.Path#startsWith will adequately protect against this vulnerability.

    For example: file.getCanonicalFile().toPath().startsWith(BASE_DIRECTORY) or file.getCanonicalFile().toPath().startsWith(BASE_DIRECTORY_FILE.getCanonicalFile().toPath())

    Other Examples

    :arrow_right: Vulnerability Disclosure :arrow_left:

    :wave: Vulnerability disclosure is a super important part of the vulnerability handling process and should not be skipped! This may be completely new to you, and that's okay, I'm here to assist!

    First question, do we need to perform vulnerability disclosure? It depends!

    1. Is the vulnerable code only in tests or example code? No disclosure required!
    2. Is the vulnerable code in code shipped to your end users? Vulnerability disclosure is probably required!

    For partial path traversal, consider if user-supplied input could ever flow to this logic. If user-supplied input could reach this conditional, it's insufficient and, as such, most likely a vulnerability.

    Vulnerability Disclosure How-To

    You have a few options options to perform vulnerability disclosure. However, I'd like to suggest the following 2 options:

    1. Request a CVE number from GitHub by creating a repository-level GitHub Security Advisory. This has the advantage that, if you provide sufficient information, GitHub will automatically generate Dependabot alerts for your downstream consumers, resolving this vulnerability more quickly.
    2. Reach out to the team at Snyk to assist with CVE issuance. They can be reached at the Snyk's Disclosure Email. Note: Please include JLLeitschuh Disclosure in the subject of your email so it is not missed.

    Detecting this and Future Vulnerabilities

    You can automatically detect future vulnerabilities like this by enabling the free (for open-source) GitHub Action.

    I'm not an employee of GitHub, I'm simply an open-source security researcher.

    Source

    This contribution was automatically generated with an OpenRewrite refactoring recipe, which was lovingly handcrafted to bring this security fix to your repository.

    The source code that generated this PR can be found here: Zip Slip

    Why didn't you disclose privately (ie. coordinated disclosure)?

    This PR was automatically generated, in-bulk, and sent to this project as well as many others, all at the same time.

    This is technically what is called a "Full Disclosure" in vulnerability disclosure, and I agree it's less than ideal. If GitHub offered a way to create private pull requests to submit pull requests, I'd leverage it, but that infrastructure, sadly, doesn't exist yet.

    The problem is that, as an open source software security researcher, I (exactly like open source maintainers), I only have so much time in a day. I'm able to find vulnerabilities impacting hundreds, or sometimes thousands of open source projects with tools like GitHub Code Search and CodeQL. The problem is that my knowledge of vulnerabilities doesn't scale very well.

    Individualized vulnerability disclosure takes time and care. It's a long and tedious process, and I have a significant amount of experience with it (I have over 50 CVEs to my name). Even tracking down the reporting channel (email, Jira, etc..) can take time and isn't automatable. Unfortunately, when facing problems of this scale, individual reporting doesn't work well either.

    Additionally, if I just spam out emails or issues, I'll just overwhelm already over-taxed maintainers, I don't want to do this either.

    By creating a pull request, I am aiming to provide maintainers something highly actionable to actually fix the identified vulnerability; a pull request.

    There's a larger discussion on this topic that can be found here: https://github.com/JLLeitschuh/security-research/discussions/12

    Opting Out

    If you'd like to opt out of future automated security vulnerability fixes like this, please consider adding a file called .github/GH-ROBOTS.txt to your repository with the line:

    User-agent: JLLeitschuh/security-research
    Disallow: *
    

    This bot will respect the ROBOTS.txt format for future contributions.

    Alternatively, if this project is no longer actively maintained, consider archiving the repository.

    CLA Requirements

    This section is only relevant if your project requires contributors to sign a Contributor License Agreement (CLA) for external contributions.

    It is unlikely that I'll be able to directly sign CLAs. However, all contributed commits are already automatically signed off.

    The meaning of a signoff depends on the project, but it typically certifies that committer has the rights to submit this work under the same license and agrees to a Developer Certificate of Origin (see https://developercertificate.org/ for more information).

    - Git Commit Signoff documentation

    If signing your organization's CLA is a strict-requirement for merging this contribution, please feel free to close this PR.

    Sponsorship & Support

    This contribution is sponsored by HUMAN Security Inc. and the new Dan Kaminsky Fellowship, a fellowship created to celebrate Dan's memory and legacy by funding open-source work that makes the world a better (and more secure) place.

    This PR was generated by Moderne, a free-for-open source SaaS offering that uses format-preserving AST transformations to fix bugs, standardize code style, apply best practices, migrate library versions, and fix common security vulnerabilities at scale.

    Tracking

    All PR's generated as part of this fix are tracked here: https://github.com/JLLeitschuh/security-research/issues/16

    opened by JLLeitschuh 0
  • Bump hibernate-validator from 5.0.1.Final to 6.0.23.Final

    Bump hibernate-validator from 5.0.1.Final to 6.0.23.Final

    Bumps hibernate-validator from 5.0.1.Final to 6.0.23.Final.

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump jetty-server from 8.1.8.v20121106 to 10.0.10 in /restx-server-jetty8

    Bump jetty-server from 8.1.8.v20121106 to 10.0.10 in /restx-server-jetty8

    Bumps jetty-server from 8.1.8.v20121106 to 10.0.10.

    Release notes

    Sourced from jetty-server's releases.

    10.0.10

    Special Thanks to the following Eclipse Jetty community members

    Changelog

    • #8136 - Cherry-pick of Improvements to PathSpec for Jetty 10.0.x
    • #8134 - Improve cleanup of deflater/inflater pools for PerMessageDeflateExtension
    • #8088 - Add option to configure exitVm on ShutdownMonitor from System properties
    • #8067 - Wall time usage in DoSFilter RateTracker results in false positive alert
    • #8057 - Support Http Response 103 (Early Hints)
    • #8014 - Review HttpRequest URI construction
    • #8008 - Add compliance mode for LEGACY multipart parser in Jetty 10+
    • #7994 - Ability to construct a detached client Request
    • #7981 - Add TRANSFER_ENCODING violation for MultiPart RFC7578 parser. (#7976)
    • #7977 - UpgradeHttpServletRequest.setAttribute & UpgradeHttpServletRequest.removeAttribute can throw NullPointerException
    • #7975 - ForwardedRequestCustomizer setters do not clear existing handlers
    • #7953 - Fix StatisticsHandler in the case a Handler throws exception.
    • #7935 - Review HTTP/2 error handling
    • #7929 - Correct requestlog formatString commented default (@​prenagha)
    • #7924 - Fix a typo in Javadoc (@​jianglai)
    • #7918 - PathMappings.asPathSpec does not allow root ServletPathSpec
    • #7891 - Better Servlet PathMappings for Regex
    • #7880 - DefaultServlet should not overwrite programmatically configured precompressed formats with defaults (@​markslater)
    • #7863 - Default servlet drops first accept-encoding header if there is more than one. (@​markslater)
    • #7858 - GZipHandler does not play nice with other handlers in HandlerCollection
    • #7818 - Modifying of HTTP headers in HttpChannel.Listener#onResponseBegin is no longer possible with Jetty 10
    • #7808 - Jetty 10.0.x 7801 duplicate set session cookie
    • #7802 - HTTP/3 QPACK - do not expect section ack for zero required insert count
    • #7754 - jetty.sh ignores JAVA_OPTIONS environment variable
    • #7748 - Allow overriding of url-pattern mapping in ServletContextHandler to allow for regex or uri-template matching
    • #7635 - QPACK decoder should fail connection if the encoder blocks more than SETTINGS_QPACK_BLOCKED_STREAMS
    • #4414 - GZipHandler not excluding inflation for specified paths
    • #1771 - Add module for SecuredRedirect support

    Dependencies

    • #8083 - Bump asciidoctorj to 2.5.4
    • #8077 - Bump asciidoctorj-diagram to 2.2.3
    • #7839 - Bump asm.version to 9.3
    • #8142 - Bump biz.aQute.bndlib to 6.3.1
    • #8075 - Bump checkstyle to 10.3
    • #8056 - Bump error_prone_annotations to 2.14.0
    • #8109 - Bump google-cloud-datastore to 2.7.0
    • #8100 - Bump grpc-core to 1.47.0
    • #7987 - Bump hawtio-default to 2.15.0

    ... (truncated)

    Commits
    • de73e94 Updating to version 10.0.10
    • 1b4f941 RegexPathSpec documentation and MatchedPath improvements (#8163)
    • 1f902f6 Disable H3 tests by default with a system property to explicitly enable them ...
    • 7cc461b Fixing javadoc build errors (#8173)
    • d63569d Migrate code from jetty-util Logger to slf4j Logger (#8162)
    • 66de7ba Improve ssl buffers handling (#8165)
    • 0699bc5 Use static exceptions for closing websocket flushers and in ContentProducer (...
    • b1c19c0 Merge pull request #8134 from eclipse/jetty-10.0.x-websocketPermessageDeflate...
    • 23948f1 no more profile IT tests runs per default (#8138)
    • 0d13cbe change-dependabot-interval-to-monthly (#8140)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
💡极致性能的企业级Java服务器框架,RPC,游戏服务器框架,web应用服务器框架。(Extreme fast enterprise Java server framework, can be RPC, game server framework, web server framework.)

?? 为性能而生的万能服务器框架 ?? Ⅰ. zfoo简介 ?? 性能炸裂,天生异步,Actor设计思想,无锁化设计,基于Spring的MVC式用法的万能RPC框架 极致序列化,原生集成的目前二进制序列化和反序列化速度最快的 zfoo protocol 作为网络通讯协议 高可拓展性,单台服务器部署,

null 1k Jan 1, 2023
Java framework for making REST clients

Pocolifo's REST Client Framework Java framework for making REST clients Here's how easy it is Here's an example for a GET request in the context of a

null 3 Jun 19, 2022
The Quotation Management application is a API REST created using Spring Boot framework.

✅ Quotation Management API - Done ✅ About • Features • Setup • Technologies • Author • License ?? About The Quotation Management application is a API

Vanessa Swerts 6 Apr 29, 2022
ESA ServiceKeeper is a lightweight service governance framework.

ServiceKeeper ServiceKeeper is a lightweight service governance framework that provides many awesome features such as rate limit, concurrent limit, ci

ESA Stack 22 Aug 11, 2022
A fast, lightweight and more productive microservices framework

A fast, lightweight and cloud-native microservices framework. Stack Overflow | Google Group | Gitter Chat | Subreddit | Youtube Channel | Documentatio

null 3.5k Jan 5, 2023
Rate limiting private REST APIs using Java Spring-boot, spring-security and bucket4j

Rate limiting REST APIs using Spring-security filter and Bucket4J Deployed Application (Swagger-ui on heroku) Inspired from: Baeldung Article Applicat

null 20 Jul 18, 2022
Desafio Alura Challenge para backend. Criando uma API REST de controle de orçamento utilizando JAVA.

Desafio Alura Challenge para backend. Criando uma API REST de controle de orçamento utilizando JAVA.

Allan Cordeiro 1 Jun 16, 2022
See how simple it is to build a REST API with a database using Java and Spring Boot

Seu primeiro projeto Java Web no Spring Boot 2022 Veja como é simples construir uma API REST com banco de dados usando Java e Spring Boot Realização D

DevSuperior 74 Dec 26, 2022
Spring REST API for financial management, developed with Java 11, JWT for authentication, JUnit for unit testing and Oracle Database

control_financial Spring REST API for financial management, developed with Java 11, JWT for authentication, JUnit for unit testing and Oracle Database

Vinicius Cassaro 1 May 27, 2022
API REST feita 100% em Java com Spring

API REST feita 100% em Java com Spring

M4TH3US17 2 May 8, 2022
Warehouse management REST API with Java & Spring Boot

Spring Warehouse Spring Warehouse is a Java Spring Boot REST API that has the purpose of managing products and articles in your warehouse. This projec

Josep Bigorra 40 Dec 15, 2022
F5 BIG-IP iControl REST vulnerability RCE exploit with Java including a testing LAB

CVE-2022-1388 F5 BIG-IP iControl REST vulnerability RCE exploit with Java and ELF. Included Scan a single target Scan many targets Exploit with a shel

Zer0verflow 10 Sep 24, 2022
Spring Boot JdbcTemplate example with SQL Server: CRUD Rest API using Spring Data JDBC, Spring Web MVC

Spring Boot JdbcTemplate example with SQL Server: Build CRUD Rest API Build a Spring Boot CRUD Rest API example that uses Spring Data Jdbc to make CRU

null 7 Dec 20, 2022
Uma API REST com funcionalidades de CRUD que simula um sistema de leilão 💰.

Leilão API REST Essa aplicação foi feita para ajudar aqueles que ainda estão com alguma dúvida, sobre o funcionamento de um API REST em Spring. Já que

Fábio Henrique 4 Feb 23, 2022
Drone - A service via REST API that allows clients to communicate with drones

Drone - A service via REST API that allows clients to communicate with drones (i.e. **dispatch controller**). The specific communication with the drone is outside the scope of this task.

Obinna Ogbonna 1 Jan 10, 2022
Spring Boot Login and Registration example with MySQL, JWT, Rest Api - Spring Boot Spring Security Login example

Spring Boot Login example with Spring Security, MySQL and JWT Appropriate Flow for User Login and Registration with JWT Spring Boot Rest Api Architect

null 58 Jan 5, 2023
Spring Boot REST API authentication best practices using JWT

Spring Boot REST API authentication best practices using JWT Token based API authentication with Spring Security and JWT (JSON web Token) Overview Thi

Prafful Lachhwani 34 Dec 22, 2022
Squadio-App is a Users-Accounts financial system. exposes Rest APIs with JWT authentication/Authorization process .

squadio-app Description Squadio-App is a Users-Accounts financial system. exposes Rest APIs with JWT authentication/Authorization process . How to Run

Bashar Othman 1 Jan 29, 2022
Currency Exchange Rate Rest Api

Spring Boot Currency Exchange Project This is a currency exchange Rest Api application which is developed using Spring Boot Framework. How to Run This

null 1 Jan 21, 2022