Various Ktor extensions and plugins.

Overview

Ktor Plugins

GitHub release (latest SemVer)

Collection of useful Ktor plugins. All plugins are hosted on Maven central and have same version that should be similar to the latest version of Ktor. The plugins can be added to your project as easy as:

implementation("dev.forst", "ktor-<plugin>", "<latest version>")

Ktor API Key Authentication Provider

Simple authentication provider for Ktor that verifies presence of the API key in the header. Useful if you want to use X-Api-Key or similar approaches for request authentication.

/**
 * Minimal Ktor application with API Key authentication.
 */
fun Application.minimalExample() {
    // key that will be used to authenticate requests
    val expectedApiKey = "this-is-expected-key"

    // principal for the app
    data class AppPrincipal(val key: String) : Principal
    // now we install authentication feature
    install(Authentication) {
        // and then api key provider
        apiKey {
            // set function that is used to verify request
            validate { keyFromHeader ->
                keyFromHeader
                    .takeIf { it == expectedApiKey }
                    ?.let { AppPrincipal(it) }
            }
        }
    }

    routing {
        authenticate {
            get {
                val p = call.principal<AppPrincipal>()!!
                call.respondText("Key: ${p.key}")
            }
        }
    }
}

Ktor Content Security Policy

Plugin that allows setting Content-Security-Policy headers.

/**
 * Minimal Ktor application using Content Security Policy.
 */
fun Application.minimalExample() {
    install(ContentSecurityPolicy) {
        skipWhen { call ->
            call.request.path().startsWith("/some-ignored-route")
        }
        policy(
            "default-src" to "'none'"
        )
    }
}

Ktor OpenAPI Generator & Swagger UI

Ktor OpenAPI plugin (with support for Ktor 2.x.y) that generates OpenAPI from your routes definition and allows you to host Swagger UI. Hosted on different repository: LukasForst/ktor-openapi-generator as it is a fork of popular papsign/Ktor-OpenAPI-Generator with some refactoring and support for Ktor 2.x.y.

It supports most of the stuff from Ktor including JWT and Session auth.

/**
 * Minimal example of OpenAPI plugin for Ktor.
 */
fun Application.minimalExample() {
    // install OpenAPI plugin
    install(OpenAPIGen) {
        // this automatically servers Swagger UI on /swagger-ui
        serveSwaggerUi = true
        info {
            title = "Minimal Example API"
        }
    }
    // install JSON support
    install(ContentNegotiation) {
        jackson()
    }
    // add basic routes for openapi.json and redirect to UI
    routing {
        // serve openapi.json
        get("/openapi.json") {
            call.respond(this@routing.application.openAPIGen.api.serialize())
        }
        // and do redirect to make it easier to remember
        get("/swagger-ui") {
            call.respondRedirect("/swagger-ui/index.html?url=/openapi.json", true)
        }
    }
    // and now example routing
    apiRouting {
        route("/example/{name}") {
            // SomeParams are parameters (query or path), SomeResponse is what the backend returns and SomeRequest
            // is what was passed in the body of the request
            post<SomeParams, SomeResponse, SomeRequest> { params, someRequest ->
                respond(SomeResponse(bar = "Hello ${params.name}! From body: ${someRequest.foo}."))
            }
        }
    }
}

data class SomeParams(@PathParam("who to say hello") val name: String)
data class SomeRequest(val foo: String)
data class SomeResponse(val bar: String)

Ktor Rate Limiting

A simple library that enables Rate Limiting in Ktor.

/**
 * Minimal Ktor application with Rate Limiting enabled.
 */
fun Application.minimalExample() {
    // install feature
    install(RateLimiting) {
        registerLimit(
            // allow 10 requests
            limit = 10,
            // each 1 minute
            window = Duration.ofMinutes(1)
        ) {
            // use host as a key to determine who is who
            call.request.origin.host
        }
        // and exclude path which ends with "excluded"
        excludeRequestWhen {
            call.request.path().endsWith("excluded")
        }
    }
    // now add some routes
    routing {
        get {
            call.respondText("Hello ${call.request.origin.host}")
        }
        get("excluded") {
            call.respondText("Hello ${call.request.origin.host}")
        }
    }
}
Comments
  • Bump net.nemerosa.versioning from 2.15.1 to 3.0.0

    Bump net.nemerosa.versioning from 2.15.1 to 3.0.0

    Bumps net.nemerosa.versioning from 2.15.1 to 3.0.0.

    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)
    dependencies java 
    opened by dependabot[bot] 2
  • Bump actions/setup-java from 1 to 3

    Bump actions/setup-java from 1 to 3

    Bumps actions/setup-java from 1 to 3.

    Release notes

    Sourced from actions/setup-java's releases.

    v3.0.0

    In scope of this release we changed version of the runtime Node.js for the setup-java action and updated package-lock.json file to v2.

    Breaking Changes

    With the update to Node 16 in #290, all scripts will now be run with Node 16 rather than Node 12.

    v2.5.0

    In scope of this pull request we add support for Microsoft Build of OpenJDK (actions/setup-java#252).

    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Setup-java
        uses: actions/setup-java@v2
        with:
          distribution: microsoft
          java-version: 11
    

    Supported distributions

    Currently, the following distributions are supported:

    Keyword Distribution Official site License
    temurin Eclipse Temurin Link Link
    zulu Zulu OpenJDK Link Link
    adopt or adopt-hotspot Adopt OpenJDK Hotspot Link Link
    adopt-openj9 Adopt OpenJDK OpenJ9 Link Link
    liberica Liberica JDK Link Link
    microsoft Microsoft Build of OpenJDK Link Link

    v2.4.0

    In scope of this pull request we add support for Liberica JDK (actions/setup-java#225).

    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Setup-java
        uses: actions/setup-java@v2
        with:
          distribution: liberica
          java-version: 11
    

    Supported distributions

    Currently, the following distributions are supported:

    Keyword Distribution Official site License
    zulu Zulu OpenJDK Link Link
    adopt or adopt-hotspot Adopt OpenJDK Hotspot Link Link
    adopt-openj9 Adopt OpenJDK OpenJ9 Link Link
    temurin Eclipse Temurin Link Link

    ... (truncated)

    Commits
    • de1bb2b feat: support Gradle version catalog (#394)
    • 2c53c1a Update actions/cache to 3.0.4 version (#392)
    • 3617c43 Default to runner architecture (#376)
    • a82e6d0 Update README.md (#391)
    • fbb2692 Merge pull request #390 from rentziass/rentziass/update-actions-core
    • dfcd06a Update @​actions/core to 1.10.0
    • e150063 Merge pull request #282 from Okeanos/maven-toolchains-support
    • eb1418a Add Maven Toolchains Declaration (#276)
    • 499ae9c Merge pull request #387 from akv-platform/v-sdolin/issue-382-docs2
    • a18c333 Add versions-manifest.json for Microsoft Build of OpenJDK (#383)
    • 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)
    dependencies github_actions 
    opened by dependabot[bot] 1
  • Bump io.gitlab.arturbosch.detekt from Versions.detekt to 1.21.0

    Bump io.gitlab.arturbosch.detekt from Versions.detekt to 1.21.0

    Bumps io.gitlab.arturbosch.detekt from Versions.detekt to 1.21.0.

    Release notes

    Sourced from io.gitlab.arturbosch.detekt's releases.

    v1.21.0

    We're delighted to announce the next upcoming stable release of Detekt: 1.21.0 🎉 This release is coming with 6 new rules, new API and functionalities and several stability improvements.

    We want to thank you very much our Sponsors for the support in those last months. The work behind Detekt is all happening on a voluntary basis, and we're more than grateful for all the support we get from the Open Source Ecosystem.

    We're also excited to announce that we're now having an Open Source Gradle Enterprise instance. When building the Detekt projects, you'll benefit from the Gradle Remote Cache that this instance is providing!

    Finally, we want to take the opportunity to thank our contributors for testing, bug reporting and helping us release this new version of Detekt. You're more than welcome to join our community on the #detekt channel on KotlinLang's Slack (you can get an invite here).

    Notable Changes

    • We enabled ~30 new rules by default which we believe are now stable enough. - #4875
    • We added 7 new Rules to Detekt
      • NullableBooleanCheck - #4872
      • CouldBeSequence - #4855
      • UnnecessaryBackticks - #4764
      • ForbiddenSuppress - #4899
      • MaxChainedCallsOnSameLine - #4985
      • CascadingCallWrapping - #4979
      • NestedScopeFunctions - #4788
    • We added support for Markdown reports - #4858
    • We now allow users and rule authors to specify a reason for every value in the config file - #4611 - Please note that this feature requires a rule to be extended to support it. If you're a rule author you can start using it right away in your rule. We're looking into using this feature in some first party rule starting from Detekt 1.22.0.
    • We now report as warnings the Strings in the config file that can be converted to be an array - #4793
    • We added a dependency on ConTester to help us verify concurrency scenarios for Detekt - #4672
    • For contributors: we restructured our build setup to be use Gradle composite build - #4751

    Migration

    We fixed a bug related to function with KDocs and how their location in the source code was calculated (see #4961 and #4887).

    Because of this, some users might have to recreate their baseline as the location of such functions are not matched anymore against the baseline. You can do so by deleting your old baseline and invoking the detektBaseline task (or the corresponding task, based on your configuration).

    Changelog

    • ReturnCount: Make configuration parameter more explicit - #5062
    • Remove redundant null check - #5061
    • Drop redundant Gradle workaround - #5057
    • Update ktlint links from website to readme - #5056
    • Improve extensions.doc format with admonitions - #5055
    • Update docusaurus monorepo to v2.0.0-beta.22 - #5050
    • Enable strict Kotlin DSL precompiled script plugins accessors generation - #5048
    • MaxChainedCallsOnSameLine: don't count package references as chained calls - #5036
    • Xml Report Merger now merges duplicate smells across input report files - #5033
    • Add ending line and column to Location.kt - #5032
    • Fix type resolution link in Contributing.md - #5027
    • #5014 Fix MaxChainedCallsOnSameLine false positives - #5020
    • Add endColumn/endLine to SARIF region - #5011
    • Removed UnnecessaryAbstractClass if it inherits from a abstract class - #5009

    ... (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)
    dependencies java 
    opened by dependabot[bot] 1
  • Bump jvm from 1.7.21 to 1.7.22

    Bump jvm from 1.7.21 to 1.7.22

    Bumps jvm from 1.7.21 to 1.7.22.

    Release notes

    Sourced from jvm's releases.

    Kotlin 1.7.22

    This is a technical release. It doesn't contain any fixes that aren't included in Kotlin 1.7.21. Version 1.7.22 of the Kotlin plugin will not be available for downloading or installing in any IDEs.

    Checksums

    File Sha256
    kotlin-compiler-1.7.22.zip 9db4b467743c1aea8a21c08e1c286bc2aeb93f14c7ba2037dbd8f48adc357d83
    kotlin-native-linux-x86_64-1.7.22.tar.gz dd004d520056aba67f2955a3bec5af75f8f2d78b179d4b5f733a77e3eef57aff
    kotlin-native-macos-x86_64-1.7.22.tar.gz 153fa411fa8c993ce2635e2504e9b102cb05362cc794b66ef9def26a78b427b5
    kotlin-native-macos-aarch64-1.7.22.tar.gz 4ffcd76c77cc824eff8addd5e2a73da4f3bbd3584fa9ef282b3f669c45426b1e
    kotlin-native-windows-x86_64-1.7.22.zip 3bccd23479848ec61c56ed5760010456d17acbe88a00a1f10fb38eae256f2e92
    Commits
    • be3c5a5 Instruction for building 1.7.21 release
    • 80eb82a Instructions for building 1.7.20 release
    • cb51803 Scripts for building Kotlin repository
    • 7784d10 Change bootstrap to 1.7.21-release-254
    • See full diff 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)
    dependencies java 
    opened by dependabot[bot] 0
  • Bump jvm from 1.7.20 to 1.7.21

    Bump jvm from 1.7.20 to 1.7.21

    Bumps jvm from 1.7.20 to 1.7.21.

    Release notes

    Sourced from jvm's releases.

    Kotlin 1.7.21

    Changelog

    Compiler

    • KT-54463 Delegating to a field with a platform type causes java.lang.NoSuchFieldError: value$delegate
    • KT-54509 Ir Interpreter: unable to evaluate string concatenation with "this" as argument
    • KT-54004 Builder type inference does not work correctly with variable assignment and breaks run-time
    • KT-54393 Change in behavior from 1.7.10 to 1.7.20 for java field override.
    • KT-54615 JVM: Internal error in file lowering: java.lang.AssertionError: Error occurred while optimizing an expression
    • KT-54581 JVM: "VerifyError: Bad type on operand stack" with generic inline function and when inside try-catch block
    • KT-53146 JVM IR: unnecessary checkcast of null leads to NoClassDefFoundError if the type isn't available at runtime
    • KT-54600 NPE on passing nullable Kotlin lambda as Java's generic SAM interface with super type bound
    • KT-54707 "VerifyError: Bad type on operand stack" in inline call chain on a nullable array value
    • KT-54650 Binary incompatible ABI change in Kotlin 1.7.20
    • KT-54802 "VerifyError: Bad type on operand stack" for inline functions on arrays

    Native. Runtime. Memory

    • KT-54498 Deprecation message of 'FreezingIsDeprecated' is not really helpful

    Tools. Gradle. Multiplatform

    • KT-54387 Remove MPP alpha stability warning
    • KT-48436 False positive "The Kotlin source set androidAndroidTestRelease was configured but not added to any Kotlin compilation"

    Tools. JPS

    • KT-45474 False positive NO_ELSE_IN_WHEN on sealed class with incremental compilation

    Checksums

    File Sha256
    kotlin-compiler-1.7.21.zip 8412b31b808755f0c0d336dbb8c8443fa239bf32ddb3cdb81b305b25f0ad279e
    kotlin-native-linux-x86_64-1.7.21.tar.gz 0f9eb04a5ee0665a195c1f1093c778f5696216660feb638b29f923f586093dd0
    kotlin-native-macos-x86_64-1.7.21.tar.gz 9530cadcf05cfd6111ef35725115009283b1a0292427261b78d43853c35ccd44
    kotlin-native-macos-aarch64-1.7.21.tar.gz f75e1a68e193b0cd9df56f15166fb4e721641b408065531b620cf204d78922e5
    kotlin-native-windows-x86_64-1.7.21.zip 5e76301f6c386ea83dc668e171887244908c18da636f7237d5371b56d8fec8da
    Changelog

    Sourced from jvm's changelog.

    1.7.21

    Compiler

    • KT-54463 Delegating to a field with a platform type causes java.lang.NoSuchFieldError: value$delegate
    • KT-54509 Ir Interpreter: unable to evaluate string concatenation with "this" as argument
    • KT-54004 Builder type inference does not work correctly with variable assignment and breaks run-time
    • KT-54393 Change in behavior from 1.7.10 to 1.7.20 for java field override.
    • KT-54615 JVM: Internal error in file lowering: java.lang.AssertionError: Error occurred while optimizing an expression
    • KT-54581 JVM: "VerifyError: Bad type on operand stack" with generic inline function and when inside try-catch block
    • KT-53146 JVM IR: unnecessary checkcast of null leads to NoClassDefFoundError if the type isn't available at runtime
    • KT-54600 NPE on passing nullable Kotlin lambda as Java's generic SAM interface with super type bound
    • KT-54707 "VerifyError: Bad type on operand stack" in inline call chain on a nullable array value
    • KT-54650 Binary incompatible ABI change in Kotlin 1.7.20
    • KT-54802 "VerifyError: Bad type on operand stack" for inline functions on arrays

    Native. Runtime. Memory

    • KT-54498 Deprecation message of 'FreezingIsDeprecated' is not really helpful

    Tools. Gradle. Multiplatform

    • KT-54387 Remove MPP alpha stability warning
    • KT-48436 False positive "The Kotlin source set androidAndroidTestRelease was configured but not added to any Kotlin compilation"

    Tools. JPS

    • KT-45474 False positive NO_ELSE_IN_WHEN on sealed class with incremental compilation
    Commits
    • e7f77e9 Keep track of array types in OptimizationBasicInterpreter
    • 7deaab9 Edit changelog for 1.7.21
    • 0b49dc2 Fix binary compatibility for inlined local delegated properies
    • 90b3e21 Advance bootstrap to 1.7.21
    • c55a197 Edit changelog for 1.7.21
    • b1b18c2 Add regression test for KT-54707
    • 7a25213 KT-53465, KT-53677 Get rid of unnecessary checkcasts to array of reified type
    • 2587f3e Edit changelog for 1.7.21
    • 62dfe43 Add changelog for 1.7.21
    • 34ae02b K1: add more tests for BI assignment checker, fix corner cases
    • 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)
    dependencies java 
    opened by dependabot[bot] 0
  • Bump actions/checkout from 2 to 3

    Bump actions/checkout from 2 to 3

    Bumps actions/checkout from 2 to 3.

    Release notes

    Sourced from actions/checkout's releases.

    v3.0.0

    • Updated to the node16 runtime by default
      • This requires a minimum Actions Runner version of v2.285.0 to run, which is by default available in GHES 3.4 or later.

    v2.5.0

    What's Changed

    Full Changelog: https://github.com/actions/checkout/compare/v2...v2.5.0

    v2.4.2

    What's Changed

    Full Changelog: https://github.com/actions/checkout/compare/v2...v2.4.2

    v2.4.1

    • Fixed an issue where checkout failed to run in container jobs due to the new git setting safe.directory

    v2.4.0

    • Convert SSH URLs like org-<ORG_ID>@github.com: to https://github.com/ - pr

    v2.3.5

    Update dependencies

    v2.3.4

    v2.3.3

    v2.3.2

    Add Third Party License Information to Dist Files

    v2.3.1

    Fix default branch resolution for .wiki and when using SSH

    v2.3.0

    Fallback to the default branch

    v2.2.0

    Fetch all history for all tags and branches when fetch-depth=0

    v2.1.1

    Changes to support GHES (here and here)

    ... (truncated)

    Changelog

    Sourced from actions/checkout's changelog.

    Changelog

    v3.1.0

    v3.0.2

    v3.0.1

    v3.0.0

    v2.3.1

    v2.3.0

    v2.2.0

    v2.1.1

    • Changes to support GHES (here and here)

    v2.1.0

    v2.0.0

    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)
    dependencies github_actions 
    opened by dependabot[bot] 0
  • Please consider remove Jackson from ktor-openapi-generator

    Please consider remove Jackson from ktor-openapi-generator

    Hi Lukas,

    Can you consider removing Jackson from your library? (Jackson is currently used in testing in the library) https://github.com/LukasForst/ktor-openapi-generator

    I think converting map to JSON in the library can be done manually like this. https://github.com/Kotlin/kotlinx.serialization/issues/296#issuecomment-1132714147.

    Removing helps users choose multiple option alternatives to Jackson. I am trying to use io.ktor:ktor-serialization-kotlinx-json instead of Jackson but the ktor-openapi-generator did not work with io.ktor:ktor-serialization-kotlinx-json.

    opened by cuong0993 0
  • Bump jvm from 1.7.22 to 1.8.0

    Bump jvm from 1.7.22 to 1.8.0

    Bumps jvm from 1.7.22 to 1.8.0.

    Release notes

    Sourced from jvm's releases.

    Kotlin 1.8.0

    Changelog

    Analysis API

    • KT-50255 Analysis API: Implement standalone mode for the Analysis API

    Analysis API. FIR

    • KT-54292 Symbol Light classes: implement PsiVariable.computeConstantValue for light field
    • KT-54293 Analysis API: fix constructor symbol creation when its accessed via type alias

    Android

    • KT-53342 TCS: New AndroidSourceSet layout for multiplatform
    • KT-53013 Increase AGP compile version in KGP to 4.1.3
    • KT-54013 Report error when using deprecated Kotlin Android Extensions compiler plugin
    • KT-53709 MPP, Android SSL2: Conflicting warnings for androidTest/kotlin source set folder

    Backend. Native. Debug

    • KT-53561 Invalid LLVM module: "inlinable function call in a function with debug info must have a !dbg location"

    Compiler

    New Features

    • KT-52817 Add @JvmSerializableLambda annotation to keep old behavior of non-invokedynamic lambdas
    • KT-54460 Implementation of non-local break and continue
    • KT-53916 Support Xcode 14 and new Objective-C frameworks in Kotlin/Native compiler
    • KT-32208 Generate method annotations into bytecode for suspend lambdas (on invokeSuspend)
    • KT-53438 Introduce a way to get SourceDebugExtension attribute value via JVMTI for profiler and coverage

    Performance Improvements

    • KT-53347 Get rid of excess allocations in parser
    • KT-53689 JVM: Optimize equality on class literals
    • KT-53119 Improve String Concatenation Lowering

    Fixes

    • KT-53465 Unnecessary checkcast to array of reified type is not optimized since Kotlin 1.6.20
    • KT-49658 NI: False negative TYPE_MISMATCH on nullable type with when
    • KT-48162 NON_VARARG_SPREAD isn't reported on *toTypedArray() call
    • KT-43493 NI: False negative: no compilation error "Operator '==' cannot be applied to 'Long' and 'Int'" is reported in builder inference lambdas
    • KT-54393 Change in behavior from 1.7.10 to 1.7.20 for java field override.
    • KT-55357 IllegalStateException when reading a class that delegates to a Java class with a definitely-not-null type with a flexible upper bound
    • KT-55068 Kotlin Gradle DSL: No mapping for symbol: VALUE_PARAMETER SCRIPT_IMPLICIT_RECEIVER on JVM IR backend
    • KT-51284 SAM conversion doesn't work if method has context receivers
    • KT-48532 Remove old JVM backend

    ... (truncated)

    Changelog

    Sourced from jvm's changelog.

    1.8.0

    Analysis API

    • KT-50255 Analysis API: Implement standalone mode for the Analysis API

    Analysis API. FIR

    • KT-54292 Symbol Light classes: implement PsiVariable.computeConstantValue for light field
    • KT-54293 Analysis API: fix constructor symbol creation when its accessed via type alias

    Android

    • KT-53342 TCS: New AndroidSourceSet layout for multiplatform
    • KT-53013 Increase AGP compile version in KGP to 4.1.3
    • KT-54013 Report error when using deprecated Kotlin Android Extensions compiler plugin
    • KT-53709 MPP, Android SSL2: Conflicting warnings for androidTest/kotlin source set folder

    Backend. Native. Debug

    • KT-53561 Invalid LLVM module: "inlinable function call in a function with debug info must have a !dbg location"

    Compiler

    New Features

    • KT-52817 Add @JvmSerializableLambda annotation to keep old behavior of non-invokedynamic lambdas
    • KT-54460 Implementation of non-local break and continue
    • KT-53916 Support Xcode 14 and new Objective-C frameworks in Kotlin/Native compiler
    • KT-32208 Generate method annotations into bytecode for suspend lambdas (on invokeSuspend)
    • KT-53438 Introduce a way to get SourceDebugExtension attribute value via JVMTI for profiler and coverage

    Performance Improvements

    • KT-53347 Get rid of excess allocations in parser
    • KT-53689 JVM: Optimize equality on class literals
    • KT-53119 Improve String Concatenation Lowering

    Fixes

    • KT-53465 Unnecessary checkcast to array of reified type is not optimized since Kotlin 1.6.20
    • KT-49658 NI: False negative TYPE_MISMATCH on nullable type with when
    • KT-48162 NON_VARARG_SPREAD isn't reported on *toTypedArray() call
    • KT-43493 NI: False negative: no compilation error "Operator '==' cannot be applied to 'Long' and 'Int'" is reported in builder inference lambdas
    • KT-54393 Change in behavior from 1.7.10 to 1.7.20 for java field override.
    • KT-55357 IllegalStateException when reading a class that delegates to a Java class with a definitely-not-null type with a flexible upper bound
    • KT-55068 Kotlin Gradle DSL: No mapping for symbol: VALUE_PARAMETER SCRIPT_IMPLICIT_RECEIVER on JVM IR backend
    • KT-51284 SAM conversion doesn't work if method has context receivers
    • KT-48532 Remove old JVM backend
    • KT-55065 Kotlin Gradle DSL: Reflection cannot find class data for lambda, produced by JVM IR backend

    ... (truncated)

    Commits
    • da1a843 Add ChangeLog for 1.8.0-RC2
    • d325cf8 Call additional publishToMavenLocal in maven build scripts and enable info
    • 0403d70 Don't leave Gradle daemons after build scripts
    • 52b225d Fix task module-name is not propagated to compiler arguments
    • d40ebc3 Specify versions-maven-plugin version explicitly
    • 2e829ed Fix version parsing crash on Gradle rich version string
    • f603c0e Scripting, IR: fix capturing of implicit receiver
    • 06cbf8f Scripting, tests: enable custom script tests with IR
    • d61cef0 Fix deserialization exception for DNN types from Java
    • ea33e72 JVM IR: script is a valid container for local delegated properties
    • 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)
    dependencies java 
    opened by dependabot[bot] 0
  • Ktor Client

    Ktor Client

    Do you think you might make a similiar feature working for Ktor Client ? I need to limit the number of request per second to a host, but every single extension is limited to Ktor server.

    opened by Pouidesbois 0
  • Bump io.gitlab.arturbosch.detekt from 1.21.0 to 1.22.0

    Bump io.gitlab.arturbosch.detekt from 1.21.0 to 1.22.0

    Bumps io.gitlab.arturbosch.detekt from 1.21.0 to 1.22.0.

    Release notes

    Sourced from io.gitlab.arturbosch.detekt's releases.

    v1.22.0

    We're extremely excited to announce the next upcoming stable release of Detekt: 1.22.0 🚀 This release is coming with 16 new rules, 2 new rulesets and several new functionalities & APIs.

    We've also introduced the Detekt Marketplace, a place for users to share their 3rd party rules and extensions.

    We want to take the opportunity to thank our Sponsors and our Contributors for testing, bug reporting and helping us release this new version of Detekt. You're more than welcome to join our community on the #detekt channel on KotlinLang's Slack (you can get an invite here).

    Notable Changes
    • We're introducing the Detekt Marketplace, a place where you can add your own 3rd party extension such as rule, plugins, custom reporter, etc. - #5191
    • Our website is now versioned. You can find the changes for each version using the dropdown menu on the top bar. Documentation for the upcoming version (next) can be found here.
    • We added 16 new Rules to Detekt
      • AlsoCouldBeApply - #5333
      • MultilineRawStringIndentation - #5058
      • TrimMultilineRawString - #5051
      • UnnecessaryNotNullCheck - #5218
      • UnnecessaryPartOfBinaryExpression - #5203
      • UseSumOfInsteadOfFlatMapSize - #5405
      • FunctionReturnTypeSpacing from KtLint - #5256
      • FunctionSignature from KtLint - #5256
      • FunctionStartOfBodySpacing from KtLint - #5256
      • NullableTypeSpacing from KtLint - #5256
      • ParameterListSpacing from KtLint - #5256
      • SpacingBetweenFunctionNameAndOpeningParenthesis from KtLint - #5256
      • TrailingCommaOnCallSite from KtLint - #5312
      • TrailingCommaOnDeclarationSite from KtLint - #5312
      • TypeParameterListSpacing from KtLint - #5256
    • We added a new ruleset called detekt-rules-ruleauthors containing rules for Rule Authors to enforce best practices on Detekt rules such as the new ViolatesTypeResolutionRequirements - #5129 #5182
    • We added a new ruleset called detekt-rules-libraries containing rules mostly useful for Library Authors - We moved the following rules inside ForbiddenPublicDataClass, LibraryCodeMustSpecifyReturnType, LibraryEntitiesShouldNotBePublic this new ruleset - See Migration below on how to migrate #5360
    • We added support for JVM toolchain. This means that Detekt will now respect the JDK toolchain you specify on your Gradle configuration. You will also be able to specify a custom JDK home with the --jdk-home CLI parameter - #5269
    • Improvement for Type Resolution
      • We will now skip rules annotated with @RequiresTypeResolution when without Type Resolution - #5176
      • We will warn users if they run rules requiring Type Resolution when Type Resolution is disabled, so they're not silently skipped - #5226
    • Improvement for Config Management
      • We added exhaustiveness check during config validation. You can enable it checkExhaustiveness: true in your config file. This is disabled by default. - #5089
      • We added support for generating custom configuration for rule authors - #5080
    • Deprecations & Removals
      • We deprecated the MultiRule class as it was overly complicated. The suggested approach is to just provide separated rules. - #5161
      • The --fail-fast CLI flag (and failFast Gradle property) has been removed. It was deprecated since 1.16.x - #5290
      • We deprecated the following rules DuplicateCaseInWhenExpression, MissingWhenCase, RedundantElseInWhen as the Kotlin Compiler is already reporting errors for those scenarios - #5309
      • We removed the --print-ast CLI flag as PsiViewer provides the same features - #5418
    • Notable changes to existing rules
      • ArrayPrimitive is now working only with Type Resolution - #5175
      • WildcardImport is now running also on tests by default - #5121
      • ForbiddenImport allows now to specify a reason for every forbidden import - #4909
      • IgnoredReturnValue: option restrictToAnnotatedMethods is now deprecated in favor of restrictToConfig - #4922
    • This version of Detekt is built with Gradle v7.5.1, AGP 7.3.1, Kotlin 1.7.21 and KtLint 0.47.1 (see #5363 #5189 #5411 #5312 #5519)
    • The minimum supported Gradle version is now v6.7.1 - #4964

    ... (truncated)

    Commits
    • 4b1da0d Prepare Detekt 1.22.0 (#5544)
    • c97b8ef Update dependency io.gitlab.arturbosch.detekt:detekt-formatting to v1.22.0 (#...
    • a80cf88 Update plugin io.gitlab.arturbosch.detekt to v1.22.0 (#5546)
    • e04e111 Stale waiting for feedback issues after 30 days (#5543)
    • ab1c3c0 Update documentation for TrailingComma rules (#5513)
    • 7e31f88 Update kotlin monorepo to v1.7.21 (#5519)
    • 7fd9987 ReturnCount: correctly count assignment expressions with elvis return as guar...
    • 411ef80 Update dependency danger to v11.2.0 (#5530)
    • ae52de0 Update github/codeql-action digest to 678fc3a (#5538)
    • 35ba768 Update github/codeql-action digest to 4238421 (#5532)
    • 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)
    dependencies java 
    opened by dependabot[bot] 0
Releases(2.2.1)
  • 2.2.1(Dec 12, 2022)

    What's Changed

    • Bump actions/checkout from 2 to 3 by @dependabot in https://github.com/LukasForst/ktor-plugins/pull/10
    • Update dependencies to latest versions by @LukasForst in https://github.com/LukasForst/ktor-plugins/pull/13
    • Bump jvm from 1.7.20 to 1.7.21 by @dependabot in https://github.com/LukasForst/ktor-plugins/pull/14
    • Update ktor to latest version by @LukasForst in https://github.com/LukasForst/ktor-plugins/pull/18
    • Bump jvm from 1.7.21 to 1.7.22 by @dependabot in https://github.com/LukasForst/ktor-plugins/pull/19

    New Contributors

    • @dependabot made their first contribution in https://github.com/LukasForst/ktor-plugins/pull/10

    Full Changelog: https://github.com/LukasForst/ktor-plugins/compare/2.1.3...2.2.1

    Source code(tar.gz)
    Source code(zip)
  • 2.1.3(Oct 31, 2022)

    What's Changed

    • Update to latest ktor version by @LukasForst in https://github.com/LukasForst/ktor-plugins/pull/8

    Full Changelog: https://github.com/LukasForst/ktor-plugins/compare/2.1.2...2.1.3

    Source code(tar.gz)
    Source code(zip)
  • 2.1.2(Sep 30, 2022)

    What's Changed

    • Allow setting CSP per specific request by @LukasForst in https://github.com/LukasForst/ktor-plugins/pull/5
    • Do not exclude anything in rate limiting plugin by default by @LukasForst in https://github.com/LukasForst/ktor-plugins/pull/6
    • Update deps by @LukasForst in https://github.com/LukasForst/ktor-plugins/pull/7

    Full Changelog: https://github.com/LukasForst/ktor-plugins/compare/2.1.1...2.1.2

    Source code(tar.gz)
    Source code(zip)
  • 2.1.1-1(Sep 19, 2022)

    • includes fix for CSP Headers plugin

    What's Changed

    • Allow setting CSP per specific request by @LukasForst in https://github.com/LukasForst/ktor-plugins/pull/5

    Full Changelog: https://github.com/LukasForst/ktor-plugins/compare/2.1.1...2.1.1-1

    Source code(tar.gz)
    Source code(zip)
  • 2.1.1(Sep 7, 2022)

    What's Changed

    • Update ktor version by @LukasForst in https://github.com/LukasForst/ktor-plugins/pull/4

    Full Changelog: https://github.com/LukasForst/ktor-plugins/compare/2.1.0...2.1.1

    Source code(tar.gz)
    Source code(zip)
  • 2.1.0(Aug 12, 2022)

    What's Changed

    • Update ktor to latest version by @LukasForst in https://github.com/LukasForst/ktor-plugins/pull/3

    Full Changelog: https://github.com/LukasForst/ktor-plugins/compare/2.0.3...2.1.0

    Source code(tar.gz)
    Source code(zip)
  • 0.0.1-ALPHA-2(Aug 9, 2022)

  • 0.0.1-ALPHA-1(Aug 9, 2022)

Owner
Lukas Forst
I push around electrons that trick rocks into doing math.
Lukas Forst
Integration Testing Kotlin Multiplatform Kata for Kotlin Developers. The main goal is to practice integration testing using Ktor and Ktor Client Mock

This kata is a Kotlin multiplatform version of the kata KataTODOApiClientKotlin of Karumi. We are here to practice integration testing using HTTP stub

Jorge Sánchez Fernández 29 Oct 3, 2022
KTor-Client---Android - The essence of KTor Client for network calls

KTor Client - Android This project encompasses the essence of KTor Client for ne

Mansoor Nisar 2 Jan 18, 2022
A POC for spring app using testng, cucumber, findbugs, and jacoco framework with failsafe and surefire plugins.

A POC for spring app using testng, cucumber, findbugs, and jacoco framework with failsafe and surefire plugins.

null 0 Feb 1, 2022
Create libraries for all types of Kotlin projects: android, JVM, Multiplatform, Gradle plugins, and so on.

JavierSC Kotlin template Create libraries for all types of Kotlin projects: android, JVM, Multiplatform, Gradle plugins, and so on. Features Easy to p

Javier Segovia Córdoba 2 Dec 14, 2022
My plugins for Aliucord

Plugins for Aliucord Click on a plugin name to download, and then move the downloaded file to the Aliucord/plugins folder CustomStatusPresets Adds pre

Nicholas Owens 43 Jan 8, 2023
External plugins for use with OpenOSRS, this is a seperate entity, not OpenOSRS

ExternalPlugins External plugins for use with OpenOSRS, this is a seperate entity, not OpenOSRS. Add this repo to your external plugins manager by cli

null 0 Nov 18, 2021
FlowExt is a Kotlin Multiplatform library, that provides many operators and extensions to Kotlin Coroutines Flow

FlowExt | Kotlinx Coroutines Flow Extensions | Kotlinx Coroutines Flow Extensions. Extensions to the Kotlin Flow library | kotlin-flow-extensions | Coroutines Flow Extensions | Kotlin Flow extensions | kotlin flow extensions | Flow extensions

Petrus Nguyễn Thái Học 151 Jan 1, 2023
A learning project which focuses on designing an OTP flow and use of various components of Android efficiently

Otp Demo A learning project which focuses on designing an OTP flow using Firebase. Article: https://saurabhpant.medium.com/otp-login-using-firebase-hi

Saurabh Pant 27 Dec 22, 2022
A Gradle plugin providing various utility methods and common code required to set up multi-version Minecraft mods.

Essential Gradle Toolkit A Gradle plugin providing various utility methods and common code required to set up multi-version Minecraft mods via archite

Essential 29 Nov 1, 2022
Kotlin extensions, BindingAdapters, Composable functions for Android CameraX

Setup dependencies { implementation "com.github.skgmn:cameraxx:0.6.0" } Features CameraXX provides extensions methods for CameraX to use functions

null 12 Aug 9, 2022
Set of extensions for Kotlin that provides Discrete math functionalities

DiscreteMathToolkit Set of extensions for Kotlin that provides Discrete Math functionalities as an Kotlin extension functions. To stay current with ne

Marcin Moskała 177 Dec 15, 2022
Flowbius provides interoperability extensions for using Kotlin Flows with Mobius

Flowbius Flowbius provides interoperability extensions for using Kotlin Flows with Mobius. They allow conversion from Flows to Mobius types and vice v

Atlassian Labs 54 Jul 19, 2022
A simple (and naive) RESTful API made with Ktor, jasync-sql and JWT.

A simple (and naive) RESTful API made with Ktor, jasync-sql and JWT. Route Method Description /account POST Create a new account /account DELETE Delet

null 2 Nov 4, 2021
Learn-kotlin - Learning more about Kotlin in various content

Kotlin study roadmap https://kotlinlang.org/docs/reference/ Getting Started Basi

Danilo Silva 0 Jan 7, 2022
An e-commerce app which provide a new platform to order food items from various restaurants

Food_App_Internshala An e-commerce app which provide a new platform to order food items from various restaurants. Splash and Login Page Opening of the

Partha Sarathi Sahu 0 Apr 26, 2022
Collection of various algorithms in mathematics, computer science etc implemented in Kotlin for educational purposes.

The Kotlin Algorithms Implementation of different algorithms and data structures using Kotlin lang Overview The repository is a collection of open-sou

Oleksii Shtanko 9 Aug 1, 2022
SSU u-saint parser with Kotlin-Multiplatform and Ktor.

kusaint Soongsil University(SSU) u-Saint Parser with Kotlin Multiplatform. Prerequisites JVM !!IMPORTANT!! To run kusaint as a library in JVM environm

Hyomin Koo 3 Mar 23, 2022
A Modern Kotlin-Ktor RESTful API example. Connects to a PostgreSQL database and uses Exposed framework for database operations.

kotlin-ktor-rest-api A Modern Kotlin-Ktor RESTful API example. Connects to a PostgreSQL database and uses Exposed framework for database operations. F

Selim Atasoy 32 Dec 20, 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