A minimalist web framework for building REST APIs in Kotlin/Java.

Overview

Kanary

alt text License Download ktlint Code Climate

A minimalist Kotlin web framework for building expressive REST APIs

fun main(args: Array<String>) {

    val app = KanaryApp()
    val server = Server()
    val userRouter = KanaryRouter()
    val userController = UserController()

    userRouter on "users/" use userController
    userRouter.post("new/", userController::createUser)
    userRouter.get("details/", userController::retrieveUser)

    app.mount(userRouter)
    server.handler = AppHandler(app)
    server.listen(8080)
    
}

Installation

Framework resources are contained in the package com.iyanuadelekan.kanary and can be included in your application via Maven, Gradle and Ivy. Include the necessary out of the following in your application:

Maven

Include Jcenter as a plugin repository

<repositories>
   <repository>
     <id>jcenter</id>
     <name>JCenter</name>
     <url>https://jcenter.bintray.com/</url>
   </repository>
</repositories>

Add Kanary as a project dependency

<dependencies>
  ...
  <dependency>
    <groupId>com.iyanuadelekan</groupId>
    <artifactId>kanary</artifactId>
    <version>0.9.2</version>
  </dependency>
  ...
</dependencies>

Gradle

repositories {
    jcenter()
}

dependencies {
    compile 'com.iyanuadelekan:kanary:0.9.2'
}

Ivy

<dependency org='com.iyanuadelekan' name='kanary' rev='0.9.2'>
  <artifact name='kanary'></artifact>
</dependency>

Others

For other use cases, you can download jars from bintray

Features

  • Expressive routing
  • Focus on code clarity
  • Support for controllers
  • Inclusion of HTTP helpers
  • Full support for asynchronous middleware
  • Presence of concise English like 'one liners'
  • Availability of action lifecycle callback methods

Quick start

A breakdown of project packages is here.

Creating a Kanary app and starting a server

A simple Kanary app that listens on a port is created by initializing an istance of KanaryApp, creating a Server object, creating an AppHandler instance, setting that instance as the server's handler and starting the server to listen on a specified port.

fun main(args: Array<String>) {
  val app = KanaryApp()
  val server = Server()

  server.handler = AppHandler(app)
  server.listen(8080)
}

Creating controllers

A controller is any instance of a class that extends KanaryController. The class below is a simple controller class that does nothing.

class DummyController : KanaryController()

Creating controller actions

Though the fact that the above class is a controller is correct, generally you'll want to specify actions within your controller to route requests to. An action is a controller function that takes three parameters as its arguments:

  • An instance of Request (a mutable request object)
  • An instance of HttpServletRequest (an immutable request object)
  • An instance of HttpServletResponse (a response object)

A valid action is shown within the controller below

class UserController : KanaryController() {

    fun createUser(baseRequest: Request, request: HttpServletRequest, response: HttpServletResponse) {
        // action code goes here
    }
    
}

Controller action lifecycle callbacks

There are two distinct action lifecycle callbacks that can be declared within a KanaryController. These are:

  • beforeAction - if declared, executes immediately before an action is executed
  • afterAction - if declared, executes immediately after an action is executed

Declaring these two callbacks is as easy as declaring a function within a controller:

class UserController : KanaryController() {

    override fun beforeAction(request: HttpServletRequest, response: HttpServletResponse?) {
        println("I execute before anything else!")
    }
    
    override fun afterAction(request: HttpServletRequest, response: HttpServletResponse?) {
        println("I execute once an action is completed!")
    }

    fun createUser(baseRequest: Request, request: HttpServletRequest, response: HttpServletResponse) {
        // action code goes here
    }
    
}

Routing

All routing is done by one or more specified routers. A router is an instance of KanaryRouter:

val userRouter = KanaryRouter()

Declaring route paths

userRouter on "users/" use userController //router uses userController to cater for all routes prefixed by '/users'
userRouter.post("new/", userController::createUser) //maps POST '/users/new' to the createUser action in userController

The above can also be done with:

userRouter.post("users/new/", userController::createUser, userController)

Mounting routers to application

A single router can be mounted to a KanaryApp instance as follows:

app.mount(userRouter)

Numerous routers can be mounted at a go:

app.mount(routerA, routerB, routerC, ..., routerN)

Middleware

All middleware take the form of a lambda. A single nullable instance of HttpServletRequest is passed to every middleware added to the application.

app.use { println("I'm middleware!") }
app.use { println("Request path info: ${it.pathInfo}") }

Multiple middleware can be added at a go:

app.use({ println("I'm middleware!") }, { println("Request path info: ${it.pathInfo}") } )

It is important to note that all middleware execute in a non blocking fashion parrallel to the main application thread.

Bundled middleware

The sole middleware bundled with Kanary is 'simpleConsoleRequestLogger'. It prints out succinct information about each request received to the console.

app.use(simpleConsoleRequestLogger)

Working with requests and responses

Handling requests

In most cases, request handling should be done by the use of the immutable HttpServletRequest instance passed to your controller actions. This instance is an object of Java's HttpServletRequest with Kanary specific helper functions. These additional functions provided are:

Function Description Return type
getBody() Used to retrieve HTTP request body content JsonNode?
getBodyAsJson() Used to retrieve HTTP request body content in the form of a JSON string String

A mutable request object is exposed in the form of a Request instance. Request implements HttpServletRequest and as such has behaviours and characteristics similar to those possessed by the HttpServletRequest instance passed to an action. In addition to the functions shown in the table above, the Request instance passed has:

Function Description Return type
done() Used to specify that a request has been successfully handled Unit

Responding to a request

Responses are sent to a client with the use of an HttpServletResponse passed to an action. In addition to all characteristics and behaviours exposed by this instance, the following Kanary specific helper functions are available:

Function Description Return type
withStatus(status: Int) Sets the response status code Unit
send(message: String) Sends a plain text message to a client Unit
sendJson(responseNode: JsonNode?) Sends a json response to a client Unit
end() Ends the HTTP response process Unit
sendStatus(status: Int) Sends the response status code as plain text Unit
sendFile(file: File, contentType: String="", contentLength: Int=0) Sends a file to a client Unit
redirect(url: String) Redirects the request to the specified URL Unit
sendHtml(html: String) Sends HTML content to a client Unit

All functions above except 'sendFile' can be written in infix notation (the recommended way of writing code in Kanary). This permits the writing of beautiful, clear and expressive code for responding to clients. Thus to send a plain text message to a client:

class UserController : KanaryController() {

    fun createUser(baseRequest: Request, request: HttpServletRequest, response: HttpServletResponse) {
        response withStatus 201 send "User successfully created!"
        baseRequest.done()
    }
    
}

Packages

class package
KanaryApp com.iyanuadelekan.kanary.app
KanaryController com.iyanuadelekan.kanary.core
KanaryRouter com.iyanuadelekan.kanary.core
AppHandler com.iyanuadelekan.kanary.handlers
Server com.iyanuadelekan.kanary.server

Dependencies

Philosophy

Kanary was created in order to facilitate the quick implementation of stable and non verbose RESTful APIs with the Kotlin programming language.

Convention versus Configuration

Kanary was designed to utilise a respectful approach in aiding engineers and developers to create micro-service based applications. As a consequence of this approach, no conventions are forced upon developers. The means by which an application is implemented is at the sole discretion of the implementer.

Road map

  • Addition of tests
  • Creation of a vast array of sample applications demonstrating the use of Kanary
  • Creation of cli utilities to support the rapid creation of Kanary applications
  • Addition of hot reloading capabilities on change and save of app program files
  • Implementation of a mailer
  • Implementation of a template engine system for those who wish to use Kanary in an MVC oriented way
  • Adding support for other popular application servers like Tomcat and Netty

Contributing

Contributions are welcome from all corners of the world! Read the CONTRIBUTIONS.rst file to get started. Create an issue for bug reports and feature requests.

People

Kanary was created by Iyanu Adelekan.

License

Apache 2.0

Comments
  • Confusing routes definition

    Confusing routes definition

    The Kanary router system forces one to append a '/' at the end of every router declaration even when the resulting url will end without '/'

    For example: userRouter.get("details/", userController::retrieveUser) will result in '/user/details' and it can be confusing when reading or writing code, there should be a way to do this instead: userRouter.get("details", userController::retrieveUser) That's clearer and easier to wrap one's head around.

    opened by olucurious 2
  • Bump jetty-server from 9.4.17.v20190418 to 9.4.41.v20210516

    Bump jetty-server from 9.4.17.v20190418 to 9.4.41.v20210516

    Bumps jetty-server from 9.4.17.v20190418 to 9.4.41.v20210516.

    Release notes

    Sourced from jetty-server's releases.

    9.4.41.v20210516

    Changelog

    • This release resolves CVE-2021-28169
    • #6099 Cipher preference may break SNI if certificates have different key types
    • #6186 Add Null Protection on Log / Logger
    • #6205 OpenIdAuthenticator may use incorrect redirect
    • #6208 HTTP/2 max local stream count exceeded
    • #6227 Better resolve race between AsyncListener.onTimeout and AsyncContext.dispatch
    • #6254 Total timeout not enforced for queued requests
    • #6263 Review URI encoding in ConcatServlet & WelcomeFilter
    • #6277 Better handle exceptions thrown from session destroy listener
    • #6280 Copy ServletHolder class/instance properly during startWebapp

    9.4.40.v20210413

    Notable Bug Fixes

    Users of GzipHandler should upgrade. (#6168) Users of SSL/TLS on the jetty-server or jetty-client should upgrade. (#6082)

    Changelog

    • #6168 - Improve handling of unconsumed content
    • #6148 - Jetty start.jar always reports jetty.tag.version as master
    • #6105 - HttpConnection.getBytesIn() incorrect for requests with chunked content
    • #6082 - SslConnection compacting

    9.4.39.v20210325

    Changelog

    :warning: Important Security related Changes

    Other Changes

    • #6034 - SslContextFactory may select a wildcard certificate during SNI selection when a more specific SSL certificate is present
    • #6050 - Websocket: NotUtf8Exception after upgrade 9.4.35 -> 9.4.36 or newer
    • #6052 - Cleanup TypeUtil and ModuleLocation to allow jetty-client/hybrid to work on Android
    • #6063 - Allow override of hazelcast version when using module
    • #6085 - Jetty keeps Sessions in use after "Duplicate valid session cookies" Message

    9.4.38.v20210224

    Changelog

    • #6001 - Ambiguous URI legacy compliance mode

    ... (truncated)

    Commits
    • 98607f9 Updating to version 9.4.41.v20210516
    • 087f486 Issue #6277 Better handling of exceptions thrown in sessionDestroyed (#6278) ...
    • edcaf70 Copy ServletHolder class/instance properly during startWebapp (#6214)
    • 1c05b0b Fixes #6263 - Review URI encoding in ConcatServlet & WelcomeFilter.
    • 9cb9343 Issue #6205 - Fix serialization issues in OpenIdAuthenticator
    • 2e7f5eb Issue #6205 - Fix issues with OpenID redirecting to wrong URI (#6211)
    • 88ac104 Issue #6254 - Total timeout not enforced for queued requests.
    • da50e06 Fixes #6254 - Total timeout not enforced for queued requests.
    • 5f23689 Issue #6254 - Total timeout not enforced for queued requests.
    • 003c313 upgrade h2spec-maven-plugin 1.0.5 (#6247)
    • 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] 1
  • Bump jetty-server from 9.4.17.v20190418 to 9.4.38.v20210224

    Bump jetty-server from 9.4.17.v20190418 to 9.4.38.v20210224

    Bumps jetty-server from 9.4.17.v20190418 to 9.4.38.v20210224.

    Release notes

    Sourced from jetty-server's releases.

    9.4.38.v20210224

    Changelog

    • #6001 - Ambiguous URI legacy compliance mode
    • #5999 - HttpURI ArrayIndexOutOfBounds
    • #5994 - QueuedThreadPool "free" threads
    • #5977 - Cache-Control header set by a filter is override by the value from DefaultServlet configuration

    9.4.37.v20210219

    Changelog

    • This release addresses and resolves CVE-2020-27223
    • #5979 - Configurable gzip Etag extension
    • #5977 - Cache-Control header set by a filter is override by the value from DefaultServlet configuration
    • #5976 - Adding requested Rewrite Rule to force request header values
    • #5973 - Proxy client TLS authentication example
    • #5963 - Improve QuotedQualityCSV
    • #5950 - Deadlock due to logging inside classloaders
    • #5937 - Unnecessary blocking in ResourceService
    • #5909 - Cannot disable HTTP OPTIONS Method
    • #5894 - Jetty 9.4.x 5859 classloader leak queuedthreadpool
    • #5851 - org.eclipse.jetty.websocket.servlet.WebSocketServlet cleanup
    • #5787 - Make ManagedSelector report better JMX data
    • #5492 - Add ability to manage start modules by java feature
    • #4275 - Path Normalization/Traversal - Context Matching

    9.4.36.v20210114

    Special Thanks to the following Eclipse Jetty community members

    Changelog

    • #5870 - jetty-maven-plugin fails to run ServletContainerInitializer on Windows due to URI case comparison bug
    • #5855 - HttpClient may not send queued requests
    • #5845 - Use UTF-8 encoding for client basic auth if requested
    • #5830 - Jetty-util contains wrong Import-Package
    • #5825 - Revisit Statistics classes (@​rk1165)
    • #5824 - Build up of ConstraintMappings when stopping and starting WebAppContext
    • #5821 - JMX-ify Scheduler implementations (@​rk1165)
    • #5820 - backport fix for ArithmeticException in Pool
    • #5804 - Jetty 9.4.x spotbug issue map iteration using entrySet(), diamond list creation
    • #5801 - Implement max duration of HTTP ConnectionPools
    • #5794 - ServerConnector leaks closed sockets which can lead to file descriptor exhaustion (@​joewitt)
    • #5785 - Reduce log level for WebSocket connections closed by clients
    • #5783 - Fix ConnectionStatistics.*Rate() methods
    • #5778 - fix ByteBufferPool race condition
    • #5755 - Cannot configure maxDynamicTableSize on HTTP2Client

    ... (truncated)

    Commits
    • 288f3cc Updating to version 9.4.38.v20210224
    • 0603b13 Merge pull request #6005 from eclipse/jetty-9.4.x-6001-default-accept-ambiguo...
    • e68293e Addressing copy/paste mistakes
    • f9b5974 Fix #4275 separate compliance modes for ambiguous URI segments and separators
    • 49e73df Fix #4275 #6001 separate compliance modes for ambiguous URI segments and se… ...
    • c9cd1e4 Merge pull request #5995 from eclipse/jetty-9.4.x-5994-qtp_free_threads
    • 8bd4a9f Fix #5999 ArrayIndexOutOfBounds for unicode in HttpURI segment (#6000)
    • 530c14e Issue #5994 - QueuedThreadPool "free" threads
    • 16241d7 Efficiency improvements for #5977
    • fdb54fa Efficiency improvements for #5977
    • 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] 1
  • Bump jetty-server from 9.4.17.v20190418 to 9.4.35.v20201120

    Bump jetty-server from 9.4.17.v20190418 to 9.4.35.v20201120

    Bumps jetty-server from 9.4.17.v20190418 to 9.4.35.v20201120.

    Release notes

    Sourced from jetty-server's releases.

    9.4.35.v20201120

    Important Change

    • #5605 : java.io.IOException: unconsumed input during http request parsing

    Bugs

    • #4711 : Reset trailers on recycled response
    • #5486 : PropertyFileLoginModule retains PropertyUserStores
    • #5562 : ArrayTernaryTrie consumes too much memory

    Enhancements

    • #5539 : StatisticsServlet output now available in json, xml, text, and html
    • #5575 : Add SEARCH as a known HttpMethod
    • #5633 : Allow to configure HttpClient request authority (even on HTTP/2)

    9.4.34.v20201102

    Bugs

    • #5320 : Using WebSocketClient with jetty-websocket-httpclient.xml in a Jetty web application causes ClassCastException
    • #5521 : ResourceCollection NPE in list()
    • #5555 : NPE for servlet with no mapping

    Enhancements

    • #5488 : jetty-dir.css not found when using JPMS
    • #5498 : ServletHolder lifecycle correctness
    • #5535 : Support regex in SslContextFactory include/exclude of protocols

    9.4.33.v20201020

    Changes

    • #5022 : Cleanup ServletHandler, specifically with respect to making filter chains more extensible
    • #5368 : WebSocket text event execute in same thread as running binary event and destroy Threadlocal
    • #5378 : Filter/Servlet/Listener Holders are not started if added during STARTING state.
    • #5409 : HttpClient fails intermittently with "Invalid response state TRANSIENT"
    • #5417 : Badly configured HttpConfiguration.securePort can lead to wrong port produced by ForwardedHeader
    • #5443 : Request without Host header fails with NullPointerException in ForwardedRequestCustomizer
    • #5451 : Improve Working Directory creation
    • #5454 : Request error context is not reset
    • #5475 : Update to spifly 1.3.2 and asm 9
    • #5480 : NPE from WebInfConfiguration.deconfigure during WebAppContext shutdown

    9.4.32.v20200930

    Changelog

    • #2796 : HTTP/2 max local stream count exceeded when request fails
    • #3766 : Introduce HTTP/2 API to batch frames
    • #3916 : multipart/byterange output is invalid to RFC7233
    • #4809 : Set a max number of requests per connection
    • #4824 : WebSocket server outgoing message queue memory growth
    • #4888 : Request getSession() method throws IllegalStateException when Session exists
    • #4954 : Simplify ability to get Byte Counts about requests
    • #5032 : Introduce Listeners to aid in tracking timings within ServletContext and WebApp

    ... (truncated)

    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] 1
  • HttpServletResponse needed in middlewares

    HttpServletResponse needed in middlewares

    It will be awesome, in fact it is essential to be able to write a response and send it in middlewares without handing out to any router.

    https://github.com/SeunAdelekan/Kanary/blob/master/src/main/com/iyanuadelekan/kanary/app/KanaryApp.kt#L32

    enhancement 
    opened by olucurious 1
  • Bump jetty-server from 9.4.11.v20180605 to 9.4.17.v20190418

    Bump jetty-server from 9.4.11.v20180605 to 9.4.17.v20190418

    Bumps jetty-server from 9.4.11.v20180605 to 9.4.17.v20190418.

    Commits
    • aa1c656 Updating to version 9.4.17.v20190418
    • 926a842 Updating maven-javadoc-plugin config for JDK-8212233 bug
    • 038c7ee Merged branch 'jetty-9.3.x' into 'jetty-9.4.x'.
    • 1f31f52 Merged branch 'jetty-9.2.x' into 'jetty-9.3.x'.
    • 03243eb Updated ALPN version for JDK 8u211 and 8u212.
    • 1c00de3 Fixing bad merge
    • c75136f Merge branch 'release-9.4.16' into jetty-9.4.x
    • b6809f5 Jetty 9.4.x 2140 infinispan expired sessions (#3457)
    • 3639805 fix header
    • 2995029 Merge branch jetty-9.3.x into jetty-9.4.x
    • 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
  • V1 to master

    V1 to master

    The following work has been done towards the finalisation of version 1.0.0 of Kanary:

    • Total re-architecture of code base (work in progress).
    • Addition of service infrastructure for mailers, databases and middleware.
    • Redesign of application router.
    • Addition of handlers for middleware and routers.
    • Addition of server lifecycle utilities and structures to permit maintenance of server context (work in progress).
    • Addition of on consumers for middleware and routers.
    • Framework dependency updates.
    • Update of Kotlin runtime in use.
    • Addition of ResourceRegistry to facilitate the registration of app services and resources.
    • Addition of ResourceManager for the management of app resources.
    • Made ResourceManager accessible from AppContext.
    • Documentation updates.
    opened by SeunAdelekan 0
  • Implemented Resource Manager

    Implemented Resource Manager

    The following work was done:

    • Created ResourceRegistry to facilitate the registration of app services and resources.
    • Created ResourceManager for the management of app resources.
    • Made ResourceManager accessible from AppContext.
    • Added documentation for additions made.
    opened by SeunAdelekan 0
  • V1

    V1

    Commenced work on version 1.0.0

    The following work was done on the project:

    • Total re-architecture of code base.
    • Addition of adapter infrastructure for mailers, databases and middleware.
    • Redesign of application router.
    • Addition of handlers for middleware and routers.
    • Started work on server lifecycle utilities and structures to permit maintenance of server context.
    • Worked on consumers for middleware and routes.
    • Made updates to dependencies and Kotlin version in use.
    opened by SeunAdelekan 0
  • Bump jetty-server from 9.4.17.v20190418 to 10.0.10

    Bump jetty-server from 9.4.17.v20190418 to 10.0.10

    Bumps jetty-server from 9.4.17.v20190418 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
  • Bump junit from 4.12 to 4.13.1

    Bump junit from 4.12 to 4.13.1

    Bumps junit from 4.12 to 4.13.1.

    Release notes

    Sourced from junit's releases.

    JUnit 4.13.1

    Please refer to the release notes for details.

    JUnit 4.13

    Please refer to the release notes for details.

    JUnit 4.13 RC 2

    Please refer to the release notes for details.

    JUnit 4.13 RC 1

    Please refer to the release notes for details.

    JUnit 4.13 Beta 3

    Please refer to the release notes for details.

    JUnit 4.13 Beta 2

    Please refer to the release notes for details.

    JUnit 4.13 Beta 1

    Please refer to the release notes for details.

    Commits
    • 1b683f4 [maven-release-plugin] prepare release r4.13.1
    • ce6ce3a Draft 4.13.1 release notes
    • c29dd82 Change version to 4.13.1-SNAPSHOT
    • 1d17486 Add a link to assertThrows in exception testing
    • 543905d Use separate line for annotation in Javadoc
    • 510e906 Add sub headlines to class Javadoc
    • 610155b Merge pull request from GHSA-269g-pwp5-87pp
    • b6cfd1e Explicitly wrap float parameter for consistency (#1671)
    • a5d205c Fix GitHub link in FAQ (#1672)
    • 3a5c6b4 Deprecated since jdk9 replacing constructor instance of Double and Float (#1660)
    • 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
  • Strict route requirements

    Strict route requirements

    Why do I need to have an 'on' for every controller?

    How do I define routes like

    localhost:8080/hello => print hello world

    or

    localhost:8080/api/messages => get all messages

    localhost:8080/api/users => get all users

    or

    localhost:8080/books get all books

    opened by asad-awadia 0
  • Am I scaling this wrong?

    Am I scaling this wrong?

    I have a basic application with a few classes, and I tried to benchmark with a simple

        override fun handle(baseRequest: Request, request: HttpServletRequest, response: HttpServletResponse) {
            response.withStatus(200).sendJson(JsonCreator.from(value = TestReturn("Hello, world")))
            baseRequest.done()
        }
    

    I did 10K requests at 100 requests, and it took a long time. a57de90

    Using a localhost, is that the problem? Am I doing the whole scaling thing wrong?

    question 
    opened by xJade00 3
Releases(v0.9.2)
A modular framework for building Discord bots in Kotlin using Kordex and Kord

Mik Bot A modular framework for building Discord bots in Kotlin using Kordex and Kord **If you are here for mikmusic, click here and there Deployment

Michael Rittmeister 31 Dec 24, 2022
🧚‍♀️ Java library to interact with YouTrack's REST API.

YouTrack Kotlin API ??‍ Kotlin JVM library to interact with YouTrack's REST API. Usage fun main(args: Array<String>) { val youtrack = YouTrack {

Noel 2 Oct 1, 2021
Web Container: A simple web container library for Android to help fellow developer to open WebView easily

WebContainer Description Web Container is a simple web container library for And

Achmad Ichsan Thaib 8 Nov 22, 2022
Ktor is an asynchronous framework for creating microservices, web applications and more.

ktor-sample Ktor is an asynchronous framework for creating microservices, web applications and more. Written in Kotlin from the ground up. Application

mohamed tamer 5 Jan 22, 2022
Kotlin microservices with REST, and gRPC using BFF pattern. This repository contains backend services. Everything is dockerized and ready to "Go" actually "Kotlin" :-)

Microservices Kotlin gRPC Deployed in EC2, Check it out! This repo contains microservices written in Kotlin with BFF pattern for performing CRUD opera

Oguzhan 18 Apr 21, 2022
Spring-kotlin - Learning API Rest with Kotlin, Spring and PostgreSQL

Kotlin, Spring, PostgreSQL and Liquibase Database Migrations Learning Kotlin for

Andre L S Ferreira 2 Feb 14, 2022
Demo Spting REST Service on Kotlin. Works with PostgreSQL via Spring Data. Data initialization provided by liquibase

Spring Boot REST API with Kotlin Spring Boot REST API service. Spring Data with PostgreSQL. Data initialization with Liquibase. Swagger UI Reference D

null 0 Jun 10, 2022
API Rest With Kotlin And Spring Boot

##API REST WITH KOTLIN AND SPRING BOOT GET Url: http://localhost:8080/customers Response (Status Code: 200 Ok) { "_embedded": { "customer

Felipe Baz 0 Nov 18, 2021
intera.kt is a Kotlin library for interacting with the Discord Interactions API through a gateway service or a REST API.

?? Overview ⚠️ WARNING: intera.kt is a work in progress. It is not yet ready for use. You may encounter bugs and other issues, but please report if yo

Pedro Henrique 1 Nov 30, 2021
intera.kt is a Kotlin library for interacting with the Discord Interactions API through a gateway service or a REST API.

?? Overview ⚠️ WARNING: intera.kt is a work in progress. It is not yet ready for use. You may encounter bugs and other issues, but please report if yo

Pedro Henrique 1 Nov 30, 2021
Api Rest Card Game made in Kotlin with Ktor

ApiRest-CardGame "Card Game API" is a project made in Kotlin with Ktor. The API allows you to manage a simple card game deck (shuffle, take a card, pu

null 0 Dec 4, 2021
Cargo service: REST API, Spring Boot, Kotlin, JDBC, PostgreSQL

cargo-jdbc Cargo service, training project with Spring Boot, JDBC and Kotlin. To

Valeriy Emelyanov 1 Dec 7, 2022
Kotlin Ktor REST Service

Servicio web para crear una API REST usando Kotlin y Kator así como otras tecnologías propuestas por JetBrains.

José Luis González Sánchez 3 Jan 9, 2023
Katoot - An easy-to-use (blocking) Kotlin wrapper for Kahoot's REST api

katoot An easy-to-use (blocking) Kotlin wrapper for Kahoot's REST api. Usage Qui

Subham 1 Jul 17, 2022
Kotlin SpringBoot REST Service

Kotlin SpringBoot REST Service Servicio web para API REST con Kotlin y SpringBoot. Kotlin SpringBoot REST Service Acerca de Autor Contacto Licencia Ac

José Luis González Sánchez 2 Mar 10, 2022
Ejemplo de API Rest Blog con Spring Boot + Kotlin + Gradle

Blog Ejemplo de API Rest Blog con Spring Boot 2.7.3 + Kotlin + Gradle + Java 17 El objetivo es que pueda servir como guía para el aprendizaje, lo más

Arturo López 6 Dec 18, 2022
Este es un ejemplo de como usar Kotlin en un proyecto Node.js, una api rest en Node.js con Express

Kotlin Hello Node.js Este es un ejemplo de como usar Kotlin en un proyecto Node.js, una API REST con Express Kotlin Hello Node.js Acerca de Uso Compil

José Luis González Sánchez 4 Jul 16, 2022
Ejemplo de App Android con Kotlin, Jetpack Compose, Retrofit y consumo de la API REST de Pokémon

Pokémon Jetpack Compose Ejemplo de App Android con Kotlin, Jetpack Compose, Retrofit y consumo de la API REST de Pokémon Jetpack Compose Retrofit Poké

Brais Moure 70 Jan 31, 2023
In this Repo i create public apis to serve apps, like muslim apps using Spring, kotlin, and microservices

spring-freelance-apis-kotlin In this Repo i create public apis to serve apps, like muslim apps using Spring, kotlin, and microservices This repo for l

null 6 Feb 13, 2022