├── .github
└── pull_request_template.md
├── .gitignore
├── .idea
├── copyright
│ ├── Apache_2_oneliner.xml
│ └── profiles_settings.xml
└── jsonSchemas.xml
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── build.gradle.kts
├── buildSrc
├── build.gradle.kts
├── settings.gradle.kts
└── src
│ ├── main
│ └── kotlin
│ │ └── io
│ │ └── ktor
│ │ └── plugins
│ │ └── registry
│ │ ├── Files.kt
│ │ ├── KtorVersions.kt
│ │ ├── PluginConfigurations.kt
│ │ ├── PluginModules.kt
│ │ ├── PluginResolution.kt
│ │ └── Strings.kt
│ └── test
│ ├── kotlin
│ └── io
│ │ └── ktor
│ │ └── plugins
│ │ └── registry
│ │ ├── ArtifactReferenceTest.kt
│ │ ├── FilesTest.kt
│ │ ├── KtorReleasesTest.kt
│ │ └── PluginConfigurationsTest.kt
│ └── resources
│ ├── plugins
│ ├── gradle.properties
│ └── server
│ │ ├── com.fail
│ │ ├── bad_semver
│ │ │ └── versions.ktor.yaml
│ │ ├── dupe
│ │ │ ├── 2.0
│ │ │ │ ├── install.kt
│ │ │ │ └── manifest.ktor.yaml
│ │ │ └── versions.ktor.yaml
│ │ ├── group.ktor.yaml
│ │ └── missing_prerequisite
│ │ │ ├── 2.0
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ │ └── versions.ktor.yaml
│ │ ├── io.ktor
│ │ ├── dupe
│ │ │ ├── 2.0
│ │ │ │ ├── install.kt
│ │ │ │ └── manifest.ktor.yaml
│ │ │ └── versions.ktor.yaml
│ │ └── group.ktor.yaml
│ │ └── org.missing
│ │ └── test
│ │ ├── 2.0
│ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ └── releases
│ ├── maven-metadata.xml
│ └── maven-metadata2.xml
├── detekt.yml
├── gradle.properties
├── gradle
├── libs.versions.toml
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── local.properties
├── plugins
├── client
│ ├── io.github.flaxoos
│ │ ├── group.ktor.yaml
│ │ └── ktor-client-circuit-breaker
│ │ │ ├── 2.0,3.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ │ ├── 3.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ │ └── versions.ktor.yaml
│ └── io.ktor
│ │ ├── client-auth-basic
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ │ ├── client-auth-bearer
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ │ ├── client-auth-digest
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ │ ├── client-caching
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ │ ├── client-call-logging
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ │ ├── client-content-encoding
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ │ ├── client-cookies
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ │ ├── client-default-request
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ │ ├── client-resources
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ │ ├── client-response-validation
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ │ ├── client-retry
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ │ ├── client-serialization-cbor
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ │ ├── client-serialization-json-gson
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ │ ├── client-serialization-json-jackson
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ │ ├── client-serialization-json-kotlinx
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ │ ├── client-serialization-xml
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ │ ├── client-sse
│ │ ├── 3.0.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ │ ├── client-timeout
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ │ ├── client-user-agent
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ │ └── group.ktor.yaml
├── gradle.properties
└── server
│ ├── com.asyncapi
│ ├── asyncapi
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ └── group.ktor.yaml
│ ├── com.kborowy
│ ├── firebase-auth-provider
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ └── group.ktor.yaml
│ ├── com.sksamuel.cohort
│ ├── cohort
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ └── group.ktor.yaml
│ ├── com.ucasoft
│ ├── group.ktor.yaml
│ ├── simple-cache
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ ├── simple-memory-cache
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ ├── manifest.ktor.yaml
│ │ │ └── routing.kt
│ │ └── versions.ktor.yaml
│ └── simple-redis-cache
│ │ ├── 2.0
│ │ ├── documentation.md
│ │ ├── install.kt
│ │ ├── manifest.ktor.yaml
│ │ └── routing.kt
│ │ └── versions.ktor.yaml
│ ├── dev.hayden
│ ├── group.ktor.yaml
│ └── khealth
│ │ ├── 2.0,3.0
│ │ ├── documentation.md
│ │ ├── install.kt
│ │ └── manifest.ktor.yaml
│ │ ├── 3.0
│ │ ├── documentation.md
│ │ ├── install.kt
│ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ ├── io.github.cotrin8672
│ ├── group.ktor.yaml
│ └── line-webhook
│ │ ├── 2.0
│ │ ├── documentation.md
│ │ ├── manifest.ktor.yaml
│ │ └── routing.kt
│ │ ├── logo.svg
│ │ └── versions.ktor.yaml
│ ├── io.github.damirdenis-tudor
│ ├── group.ktor.yaml
│ ├── icon.png
│ └── ktor-server-rabbitmq
│ │ ├── 3.0
│ │ ├── application.conf
│ │ ├── documentation.md
│ │ ├── install.kt
│ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ ├── io.github.flaxoos
│ ├── group.ktor.yaml
│ ├── ktor-server-kafka
│ │ ├── 2.0,3.0
│ │ │ ├── application.conf
│ │ │ ├── application.yaml
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ ├── 3.0
│ │ │ ├── application.conf
│ │ │ ├── application.yaml
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ ├── icon.svg
│ │ └── versions.ktor.yaml
│ ├── ktor-server-rate-limiting
│ │ ├── 2.0,3.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ ├── 3.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ └── ktor-server-task-scheduling
│ │ ├── 2.0,3.0
│ │ ├── documentation.md
│ │ ├── install.kt
│ │ └── manifest.ktor.yaml
│ │ ├── 3.0
│ │ ├── documentation.md
│ │ ├── install.kt
│ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ ├── io.github.smiley4
│ ├── group.ktor.yaml
│ └── ktor-swagger-ui
│ │ ├── 2.0,3.0
│ │ ├── documentation.md
│ │ ├── install.kt
│ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ ├── io.insert-koin
│ ├── group.ktor.yaml
│ ├── icon.png
│ └── koin
│ │ ├── 2.0
│ │ ├── HelloService.kt
│ │ ├── documentation.md
│ │ ├── install.kt
│ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ ├── io.ktor
│ ├── auth-basic
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ ├── manifest.ktor.yaml
│ │ │ └── routing.kt
│ │ └── versions.ktor.yaml
│ ├── auth-digest
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ ├── manifest.ktor.yaml
│ │ │ └── routing.kt
│ │ └── versions.ktor.yaml
│ ├── auth-jwt
│ │ ├── 2.0
│ │ │ ├── application.conf
│ │ │ ├── application.yaml
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ ├── auth-ldap
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ ├── auth-oauth
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ ├── manifest.ktor.yaml
│ │ │ ├── outside_app.kt
│ │ │ └── routing.kt
│ │ └── versions.ktor.yaml
│ ├── auth
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ ├── auto-head-response
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ ├── caching-headers
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ ├── call-logging
│ │ ├── 2.0,3.0.0
│ │ │ ├── call_logging.kt
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ ├── 3.0.0
│ │ │ ├── call_logging.kt
│ │ │ ├── documentation.md
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ ├── callid
│ │ ├── 2.0,3.0
│ │ │ ├── call_logging.kt
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ ├── 3.0
│ │ │ ├── call_logging.kt
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ ├── compression
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ ├── conditional-headers
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ ├── content-negotiation
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ ├── cors
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ ├── csrf
│ │ ├── 3.0.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ ├── default-headers
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ ├── double-receive
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ ├── manifest.ktor.yaml
│ │ │ └── routing.kt
│ │ └── versions.ktor.yaml
│ ├── forwarded-header-support
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ ├── freemarker
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ ├── manifest.ktor.yaml
│ │ │ ├── outside_app.kt
│ │ │ ├── routing.kt
│ │ │ └── templates
│ │ │ │ └── index.ftl
│ │ └── versions.ktor.yaml
│ ├── group.ktor.yaml
│ ├── hsts
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ ├── https-redirect
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ ├── icon.svg
│ ├── kotlinx-serialization
│ │ ├── 2.0
│ │ │ ├── content_negotiation.kt
│ │ │ ├── documentation.md
│ │ │ ├── manifest.ktor.yaml
│ │ │ └── routing.kt
│ │ └── versions.ktor.yaml
│ ├── ktor-gson
│ │ ├── 2.0
│ │ │ ├── content_negotiation.kt
│ │ │ ├── documentation.md
│ │ │ ├── manifest.ktor.yaml
│ │ │ └── routing.kt
│ │ └── versions.ktor.yaml
│ ├── ktor-jackson
│ │ ├── 2.0
│ │ │ ├── content_negotiation.kt
│ │ │ ├── documentation.md
│ │ │ ├── manifest.ktor.yaml
│ │ │ └── routing.kt
│ │ └── versions.ktor.yaml
│ ├── ktor-network-tls
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ ├── manifest.ktor.yaml
│ │ │ └── outside_app.kt
│ │ └── versions.ktor.yaml
│ ├── ktor-network
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ ├── manifest.ktor.yaml
│ │ │ └── outside_app.kt
│ │ └── versions.ktor.yaml
│ ├── ktor-sessions
│ │ ├── 2.0
│ │ │ ├── MySession.kt
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ ├── manifest.ktor.yaml
│ │ │ └── routing.kt
│ │ └── versions.ktor.yaml
│ ├── ktor-websockets
│ │ ├── 2.0,3.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ ├── manifest.ktor.yaml
│ │ │ └── routing.kt
│ │ ├── 3.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ ├── manifest.ktor.yaml
│ │ │ └── routing.kt
│ │ └── versions.ktor.yaml
│ ├── metrics-micrometer
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ ├── manifest.ktor.yaml
│ │ │ └── routing.kt
│ │ └── versions.ktor.yaml
│ ├── metrics
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ ├── mustache
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ ├── manifest.ktor.yaml
│ │ │ ├── outside_app.kt
│ │ │ └── routing.kt
│ │ └── versions.ktor.yaml
│ ├── openapi
│ │ ├── 2.2
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ ├── manifest.ktor.yaml
│ │ │ └── openapi
│ │ │ │ └── documentation.yaml
│ │ └── versions.ktor.yaml
│ ├── partial-content
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ ├── pebble
│ │ ├── 2.3
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ ├── manifest.ktor.yaml
│ │ │ ├── outside_app.kt
│ │ │ ├── routing.kt
│ │ │ └── templates
│ │ │ │ └── pebble-index.html
│ │ └── versions.ktor.yaml
│ ├── request-validation
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ ├── resources
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ ├── manifest.ktor.yaml
│ │ │ ├── outside_app.kt
│ │ │ └── routing.kt
│ │ └── versions.ktor.yaml
│ ├── routing
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── manifest.ktor.yaml
│ │ │ ├── routing.kt
│ │ │ └── test.kt
│ │ └── versions.ktor.yaml
│ ├── shutdown-url
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ ├── sse
│ │ ├── 3.0.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ ├── manifest.ktor.yaml
│ │ │ ├── routing.kt
│ │ │ └── test.kt
│ │ └── versions.ktor.yaml
│ ├── static-content
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── manifest.ktor.yaml
│ │ │ ├── routing.kt
│ │ │ └── static
│ │ │ │ └── index.html
│ │ └── versions.ktor.yaml
│ ├── status-pages
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ ├── swagger
│ │ ├── 2.2
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ ├── manifest.ktor.yaml
│ │ │ └── openapi
│ │ │ │ └── documentation.yaml
│ │ └── versions.ktor.yaml
│ ├── thymeleaf
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ ├── manifest.ktor.yaml
│ │ │ ├── outside_app.kt
│ │ │ ├── routing.kt
│ │ │ └── templates
│ │ │ │ └── thymeleaf
│ │ │ │ └── index.html
│ │ ├── thymeleaf.svg
│ │ └── versions.ktor.yaml
│ ├── velocity
│ │ ├── 2.0
│ │ │ ├── documentation.md
│ │ │ ├── install.kt
│ │ │ ├── manifest.ktor.yaml
│ │ │ ├── outside_app.kt
│ │ │ ├── routing.kt
│ │ │ └── templates
│ │ │ │ └── index.vl
│ │ └── versions.ktor.yaml
│ └── webjars
│ │ ├── 2.0
│ │ ├── documentation.md
│ │ ├── install.kt
│ │ ├── manifest.ktor.yaml
│ │ └── routing.kt
│ │ └── versions.ktor.yaml
│ └── org.jetbrains
│ ├── css-dsl
│ ├── 2.0
│ │ ├── documentation.md
│ │ ├── install.kt
│ │ ├── manifest.ktor.yaml
│ │ ├── outside_app.kt
│ │ └── routing.kt
│ └── versions.ktor.yaml
│ ├── exposed
│ ├── 2.2
│ │ ├── UsersSchema.kt
│ │ ├── documentation.md
│ │ ├── inside_app.kt
│ │ ├── install.kt
│ │ ├── manifest.ktor.yaml
│ │ └── routing.kt
│ └── versions.ktor.yaml
│ ├── group.ktor.yaml
│ ├── html-dsl
│ ├── 2.0
│ │ ├── documentation.md
│ │ ├── install.kt
│ │ ├── manifest.ktor.yaml
│ │ └── routing.kt
│ └── versions.ktor.yaml
│ ├── htmx
│ ├── 3.0
│ │ ├── documentation.md
│ │ ├── manifest.ktor.yaml
│ │ ├── server
│ │ │ ├── LeaderboardPage.kt
│ │ │ └── endpoints.kt
│ │ └── web
│ │ │ ├── import.kt
│ │ │ ├── leaderboard.css
│ │ │ └── web.kt
│ └── versions.ktor.yaml
│ ├── icon.svg
│ ├── kotlinx-rpc
│ ├── 3.0
│ │ ├── client
│ │ │ ├── Rpc.kt
│ │ │ └── client.kt
│ │ ├── core
│ │ │ └── SampleService.kt
│ │ ├── documentation.md
│ │ ├── manifest.ktor.yaml
│ │ └── server
│ │ │ ├── frameworks.kt
│ │ │ ├── install.kt
│ │ │ ├── routing.kt
│ │ │ └── test.kt
│ └── versions.ktor.yaml
│ ├── mongodb
│ ├── 2.2,3.0.0
│ │ ├── CarsSchema.kt
│ │ ├── documentation.md
│ │ ├── install.kt
│ │ ├── manifest.ktor.yaml
│ │ └── outside_app.kt
│ ├── 3.0.0
│ │ ├── CarsSchema.kt
│ │ ├── documentation.md
│ │ ├── install.kt
│ │ ├── manifest.ktor.yaml
│ │ └── outside_app.kt
│ ├── logo.svg
│ └── versions.ktor.yaml
│ └── postgres
│ ├── 2.2
│ ├── CitySchema.kt
│ ├── application.conf
│ ├── application.yaml
│ ├── documentation.md
│ ├── install.kt
│ ├── manifest.ktor.yaml
│ └── outside_app.kt
│ ├── logo.png
│ └── versions.ktor.yaml
├── renovate.json
├── settings.gradle.kts
├── shared
└── io
│ └── ktor
│ └── plugins
│ └── registry
│ ├── Constants.kt
│ ├── PluginConfiguration.kt
│ ├── PluginReference.kt
│ ├── Properties.kt
│ └── ResolvedArtifacts.kt
├── src
├── main
│ ├── kotlin
│ │ └── io
│ │ │ └── ktor
│ │ │ └── plugins
│ │ │ └── registry
│ │ │ ├── BuildRegistry.kt
│ │ │ ├── CreatePlugin.kt
│ │ │ ├── GenerateTestProject.kt
│ │ │ ├── RegistryBuilder.kt
│ │ │ └── utils
│ │ │ ├── CodeAnalysis.kt
│ │ │ ├── Documentation.kt
│ │ │ ├── Files.kt
│ │ │ ├── GitSupport.kt
│ │ │ ├── PluginGroups.kt
│ │ │ ├── PluginManifests.kt
│ │ │ ├── ProjectGeneratorClient.kt
│ │ │ ├── RegistryOutputFiles.kt
│ │ │ ├── SourceCodeMeta.kt
│ │ │ ├── Terminal.kt
│ │ │ └── Yaml.kt
│ └── resources
│ │ ├── default-icon.svg
│ │ └── logback.xml
├── mock
│ └── kotlin
│ │ └── MockApplication.kt
└── test
│ ├── kotlin
│ └── io
│ │ └── ktor
│ │ └── plugins
│ │ └── registry
│ │ ├── RegistryBuilderTest.kt
│ │ └── utils
│ │ ├── CLIUtilsTest.kt
│ │ ├── DocumentationExtractorTest.kt
│ │ ├── PluginCodeAnalyzerTest.kt
│ │ └── VersionsTest.kt
│ └── resources
│ ├── build
│ ├── ktor_releases
│ └── plugins
│ │ ├── classpaths
│ │ ├── exposed.2.3.12.yaml
│ │ └── exposed.3.0.0.yaml
│ │ └── configurations.yaml
│ └── plugins
│ ├── gradle.properties
│ └── server
│ ├── com.fail
│ ├── bad_kt
│ │ ├── 2.0
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ ├── group.ktor.yaml
│ ├── missing_import
│ │ ├── 2.0
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ ├── no_doc
│ │ ├── 2.0
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ └── no_install
│ │ ├── 2.0
│ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ ├── io.ktor
│ ├── csrf
│ │ ├── 2.0
│ │ │ ├── install.kt
│ │ │ └── manifest.ktor.yaml
│ │ └── versions.ktor.yaml
│ └── group.ktor.yaml
│ ├── org.jetbrains
│ ├── exposed
│ │ ├── 2.2
│ │ │ ├── ExposedUser.kt
│ │ │ ├── UsersSchema.kt
│ │ │ ├── documentation.md
│ │ │ ├── inside_app.kt
│ │ │ ├── install.kt
│ │ │ ├── manifest.ktor.yaml
│ │ │ └── routing.kt
│ │ └── versions.ktor.yaml
│ ├── group.ktor.yaml
│ └── icon.svg
│ └── org.missing
│ └── test
│ ├── 2.0
│ └── manifest.ktor.yaml
│ └── versions.ktor.yaml
└── templates
├── documentation.md
├── group.ktor.yaml
├── install.kt
├── manifest.ktor.yaml
├── schema
├── group-schema.json
├── manifest-schema.json
└── version-schema.json
└── versions.ktor.yaml
/.github/pull_request_template.md:
--------------------------------------------------------------------------------
1 | Thanks for contributing to Ktor's plugin registry!
2 |
3 | Before submitting your pull request, be sure to run the following:
4 |
5 | 1. `./gradlew buildRegistry`: this tests and builds the expected model for the project generator using the plugin manifests
6 | 2. `./gradlew buildTestProject`: this generates a sample project using the modified plugin files
7 |
8 | We encourage you to experiment with the different options listed [here](https://github.com/ktorio/ktor-plugin-registry/blob/main/templates/manifest.ktor.yaml)
9 | and explore the results in the generated test project.
10 |
11 | Feel free to reach out with any issues with the registry or generator in a pull request or any of the channels listed [here](https://ktor.io/support/).
12 |
--------------------------------------------------------------------------------
/.idea/copyright/Apache_2_oneliner.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | ## Code of Conduct
2 |
3 | This project and the corresponding community is governed by the [JetBrains Open Source and Community Code of Conduct](https://confluence.jetbrains.com/display/ALL/JetBrains+Open+Source+and+Community+Code+of+Conduct). Please make sure you read it.
4 |
5 |
--------------------------------------------------------------------------------
/buildSrc/settings.gradle.kts:
--------------------------------------------------------------------------------
1 | rootProject.name = "buildSrc"
2 |
3 | pluginManagement {
4 | repositories {
5 | mavenCentral()
6 | gradlePluginPortal()
7 | }
8 | }
9 |
10 | @Suppress("UnstableApiUsage")
11 | dependencyResolutionManagement {
12 | repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
13 |
14 | repositories {
15 | mavenCentral()
16 | gradlePluginPortal()
17 | }
18 |
19 | versionCatalogs {
20 | create("libs") {
21 | from(files("../gradle/libs.versions.toml"))
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/buildSrc/src/main/kotlin/io/ktor/plugins/registry/Strings.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
3 | */
4 |
5 | package io.ktor.plugins.registry
6 |
7 | fun String.stripSpecialChars() =
8 | Regex("[^a-zA-Z0-9\\-,.]").replace(this, "").trim(',')
--------------------------------------------------------------------------------
/buildSrc/src/test/kotlin/io/ktor/plugins/registry/FilesTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
3 | */
4 |
5 | package io.ktor.plugins.registry
6 |
7 | import org.gradle.internal.impldep.junit.framework.TestCase.assertTrue
8 | import kotlin.test.Test
9 |
10 | class FilesTest {
11 |
12 | @Test
13 | fun listFolders() {
14 | val result = folders("../plugins/*/io.ktor/*/2.0").map { it.toString() }
15 | assertTrue(result.isNotEmpty())
16 | assertTrue(result.contains("../plugins/server/io.ktor/resources/2.0"))
17 | }
18 |
19 | }
--------------------------------------------------------------------------------
/buildSrc/src/test/resources/plugins/gradle.properties:
--------------------------------------------------------------------------------
1 | exposed=0.53.+
2 | h2=2.2.224
--------------------------------------------------------------------------------
/buildSrc/src/test/resources/plugins/server/com.fail/bad_semver/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | $$$$: what??
--------------------------------------------------------------------------------
/buildSrc/src/test/resources/plugins/server/com.fail/dupe/2.0/install.kt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ktorio/ktor-plugin-registry/483dc0ed49b07e6022405c276a68587e11d3afcd/buildSrc/src/test/resources/plugins/server/com.fail/dupe/2.0/install.kt
--------------------------------------------------------------------------------
/buildSrc/src/test/resources/plugins/server/com.fail/dupe/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Duplicates
2 | description: A test for duplicate plugins
3 | vcsLink: https://github.com/fail/dupe
4 | license: Apache 2.0
5 | category: Templating
6 | documentation: |
7 | Here are the docs
8 | #Usage
9 | doThing()
--------------------------------------------------------------------------------
/buildSrc/src/test/resources/plugins/server/com.fail/dupe/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": []
--------------------------------------------------------------------------------
/buildSrc/src/test/resources/plugins/server/com.fail/group.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Failure Scenarios
2 | url: https://fail.com
--------------------------------------------------------------------------------
/buildSrc/src/test/resources/plugins/server/com.fail/missing_prerequisite/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 |
3 | fun Application.install() {}
--------------------------------------------------------------------------------
/buildSrc/src/test/resources/plugins/server/com.fail/missing_prerequisite/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Missing prerequisite
2 | description: Validation will fail because of missing prerequisite
3 | vcsLink: https://github.com/fail/missing_prerequisite
4 | license: Apache 2.0
5 | category: Templating
6 | documentation: |
7 | Here are the docs
8 | #Usage
9 | doThing()
10 | prerequisites:
11 | - this_does_not_exist
--------------------------------------------------------------------------------
/buildSrc/src/test/resources/plugins/server/com.fail/missing_prerequisite/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": []
--------------------------------------------------------------------------------
/buildSrc/src/test/resources/plugins/server/io.ktor/dupe/2.0/install.kt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ktorio/ktor-plugin-registry/483dc0ed49b07e6022405c276a68587e11d3afcd/buildSrc/src/test/resources/plugins/server/io.ktor/dupe/2.0/install.kt
--------------------------------------------------------------------------------
/buildSrc/src/test/resources/plugins/server/io.ktor/dupe/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Duplicates
2 | description: A test for duplicate plugins
3 | vcsLink: https://github.com/ktorio/dupe
4 | license: Apache 2.0
5 | category: Templating
6 | documentation: |
7 | Here are the docs
8 | #Usage
9 | doThing()
--------------------------------------------------------------------------------
/buildSrc/src/test/resources/plugins/server/io.ktor/dupe/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": []
--------------------------------------------------------------------------------
/buildSrc/src/test/resources/plugins/server/io.ktor/group.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Ktor
2 | url: https://ktor.io/
--------------------------------------------------------------------------------
/buildSrc/src/test/resources/plugins/server/org.missing/test/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Missing Group
2 | description: The group yaml is missing.
3 | vcsLink: https://github.com/no/group
4 | license: Apache 2.0
5 | category: Templating
6 | documentation: |
7 | Here are the docs
8 | #Usage
9 | doThing()
10 | installation:
11 | default: "fun bun(){}"
--------------------------------------------------------------------------------
/buildSrc/src/test/resources/plugins/server/org.missing/test/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": []
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | kotlin.code.style=official
2 | # Flip this when working on the registry framework
3 | # Because the plugin resolution code can cause a bit of a cyclical dependency
4 | skipPlugins=false
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ktorio/ktor-plugin-registry/483dc0ed49b07e6022405c276a68587e11d3afcd/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip
4 | networkTimeout=10000
5 | validateDistributionUrl=true
6 | zipStoreBase=GRADLE_USER_HOME
7 | zipStorePath=wrapper/dists
8 |
--------------------------------------------------------------------------------
/local.properties:
--------------------------------------------------------------------------------
1 | # Flip this when working on the registry framework
2 | # Because the plugin resolution code can cause a bit of a cyclical dependency
3 | skipPlugins=false
--------------------------------------------------------------------------------
/plugins/client/io.github.flaxoos/group.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Flaxoos
2 | url: https://flaxoos.github.io
3 | email: idoflax@gmail.com
4 |
--------------------------------------------------------------------------------
/plugins/client/io.github.flaxoos/ktor-client-circuit-breaker/2.0,3.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.github.flaxoos.ktor.client.plugins.circuitbreaker.CircuitBreakerName.Companion.toCircuitBreakerName
2 | import io.github.flaxoos.ktor.client.plugins.circuitbreaker.CircuitBreaking
3 | import io.github.flaxoos.ktor.client.plugins.circuitbreaker.global
4 | import io.github.flaxoos.ktor.client.plugins.circuitbreaker.register
5 | import io.ktor.client.*
6 | import kotlin.time.Duration.Companion.milliseconds
7 | import kotlin.time.Duration.Companion.seconds
8 |
9 | fun HttpClientConfig<*>.configure() {
10 | install(CircuitBreaking) {
11 | global {
12 | failureThreshold = 10
13 | halfOpenFailureThreshold = 5
14 | resetInterval = 100.milliseconds
15 | }
16 |
17 | register("strict".toCircuitBreakerName()) {
18 | failureThreshold = 2
19 | halfOpenFailureThreshold = 1
20 | resetInterval = 1.seconds
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/plugins/client/io.github.flaxoos/ktor-client-circuit-breaker/2.0,3.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Rate Limiting
2 | description: Enhances system resilience by halting requests to failing services once a defined error threshold is reached.
3 | vcsLink: https://github.com/Flaxoos/extra-ktor-plugins
4 | license: Apache 2.0
5 | category: Administration
6 |
7 | gradle:
8 | repositories:
9 | - url: https://packages.confluent.io/maven/
10 | maven:
11 | repositories:
12 | - id: confluence
13 | url: https://packages.confluent.io/maven/
14 |
15 | installation:
16 | default: install.kt
--------------------------------------------------------------------------------
/plugins/client/io.github.flaxoos/ktor-client-circuit-breaker/3.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.github.flaxoos.ktor.client.plugins.circuitbreaker.CircuitBreakerName.Companion.toCircuitBreakerName
2 | import io.github.flaxoos.ktor.client.plugins.circuitbreaker.CircuitBreaking
3 | import io.github.flaxoos.ktor.client.plugins.circuitbreaker.global
4 | import io.github.flaxoos.ktor.client.plugins.circuitbreaker.register
5 | import io.ktor.client.*
6 | import kotlin.time.Duration.Companion.milliseconds
7 | import kotlin.time.Duration.Companion.seconds
8 |
9 | fun HttpClientConfig<*>.configure() {
10 | install(CircuitBreaking) {
11 | global {
12 | failureThreshold = 10
13 | halfOpenFailureThreshold = 5
14 | resetInterval = 100.milliseconds
15 | }
16 |
17 | register("strict".toCircuitBreakerName()) {
18 | failureThreshold = 2
19 | halfOpenFailureThreshold = 1
20 | resetInterval = 1.seconds
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/plugins/client/io.github.flaxoos/ktor-client-circuit-breaker/3.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Rate Limiting
2 | description: Enhances system resilience by halting requests to failing services once a defined error threshold is reached.
3 | vcsLink: https://github.com/Flaxoos/extra-ktor-plugins
4 | license: Apache 2.0
5 | category: Administration
6 |
7 | gradle:
8 | repositories:
9 | - url: https://packages.confluent.io/maven/
10 | maven:
11 | repositories:
12 | - id: confluence
13 | url: https://packages.confluent.io/maven/
14 |
15 | installation:
16 | default: install.kt
--------------------------------------------------------------------------------
/plugins/client/io.github.flaxoos/ktor-client-circuit-breaker/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,3.0)": io.github.flaxoos:ktor-client-circuit-breaker:1.+
2 | "[3.0,)": io.github.flaxoos:ktor-client-circuit-breaker:2.+
3 |
4 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-auth-basic/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.client.*
2 | import io.ktor.client.plugins.auth.*
3 | import io.ktor.client.plugins.auth.providers.*
4 |
5 | public fun HttpClientConfig<*>.configure() {
6 | install(Auth) {
7 | basic {
8 | credentials {
9 | BasicAuthCredentials(username = "jetbrains", password = "foobar")
10 | }
11 | realm = "Access to the '/' path"
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-auth-basic/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Authentication Basic
2 | description: Can be used for logging in users
3 | vcsLink: https://github.com/ktorio/ktor-documentation/tree/main/codeSnippets/snippets/client-auth-basic
4 | license: Apache 2.0
5 | category: HTTP
6 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-auth-basic/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": ktor-client-auth:==
2 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-auth-bearer/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.client.*
2 | import io.ktor.client.plugins.auth.*
3 | import io.ktor.client.plugins.auth.providers.*
4 |
5 | public fun HttpClientConfig<*>.configure() {
6 | install(Auth) {
7 | bearer {
8 | loadTokens {
9 | BearerTokens("abc123", "xyz111")
10 | }
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-auth-bearer/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Authentication Bearer
2 | description: Authentication with a hash function applied to username and password
3 | vcsLink: https://github.com/ktorio/ktor/blob/main/ktor-client/ktor-client-plugins/ktor-client-auth/common/src/io/ktor/client/plugins/auth/providers/BearerAuthProvider.kt
4 | license: Apache 2.0
5 | category: HTTP
6 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-auth-bearer/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": ktor-client-auth:==
2 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-auth-digest/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.client.*
2 | import io.ktor.client.plugins.auth.*
3 | import io.ktor.client.plugins.auth.providers.*
4 |
5 | public fun HttpClientConfig<*>.configure() {
6 | install(Auth) {
7 | digest {
8 | credentials {
9 | DigestAuthCredentials(username = "jetbrains", password = "foobar")
10 | }
11 | realm = "Access to the '/' path"
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-auth-digest/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Authentication Digest
2 | description: Authentication with a hash function applied to username and password
3 | vcsLink: https://github.com/ktorio/ktor-documentation/tree/main/codeSnippets/snippets/client-auth-digest
4 | license: Apache 2.0
5 | category: HTTP
6 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-auth-digest/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": ktor-client-auth:==
2 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-caching/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.client.*
2 | import io.ktor.client.plugins.cache.*
3 |
4 | public fun HttpClientConfig<*>.configure() {
5 | install(HttpCache)
6 | }
7 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-caching/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Caching
2 | description: Allows you to save previously fetched resources in cache
3 | vcsLink: https://github.com/ktorio/ktor-documentation/tree/main/codeSnippets/snippets/client-caching
4 | license: Apache 2.0
5 | category: HTTP
6 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-caching/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": []
2 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-call-logging/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.client.*
2 | import io.ktor.client.plugins.logging.*
3 |
4 | public fun HttpClientConfig<*>.configure() {
5 | install(Logging) {
6 | logger = Logger.DEFAULT
7 | level = LogLevel.HEADERS
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-call-logging/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Logging
2 | description: Logs HTTP calls
3 | vcsLink: https://github.com/ktorio/ktor/blob/f028b0ca428335b6545b81afef803e236242b3a5/ktor-server/ktor-server-core/jvm/src/io/ktor/features/CallLogging.kt
4 | license: Apache 2.0
5 | category: Monitoring
6 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-call-logging/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": ktor-client-logging:==
2 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-content-encoding/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.client.*
2 | import io.ktor.client.plugins.compression.*
3 |
4 | public fun HttpClientConfig<*>.configure() {
5 | install(ContentEncoding) {
6 | deflate(1.0F)
7 | gzip(0.9F)
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-content-encoding/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: ContentEncoding
2 | description: Enables specified compression algorithms and configures their settings
3 | vcsLink: https://github.com/ktorio/ktor-documentation/tree/main/codeSnippets/snippets/client-content-encoding
4 | license: Apache 2.0
5 | category: HTTP
6 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-content-encoding/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": ktor-client-encoding:==
2 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-cookies/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.client.*
2 | import io.ktor.client.plugins.cookies.*
3 |
4 | public fun HttpClientConfig<*>.configure() {
5 | install(HttpCookies)
6 | }
7 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-cookies/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Cookies
2 | description: Handles cookies manually
3 | vcsLink: https://github.com/ktorio/ktor-documentation/tree/main/codeSnippets/snippets/client-caching
4 | license: Apache 2.0
5 | category: HTTP
6 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-cookies/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": []
2 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-default-request/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.client.*
2 | import io.ktor.client.plugins.*
3 |
4 | public fun HttpClientConfig<*>.configure() {
5 | defaultRequest {
6 | url("https://ktor.io/docs/")
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-default-request/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: DefaultRequest
2 | description: Allows you to configure default parameters for all requests.
3 | vcsLink: https://github.com/ktorio/ktor/blob/main/ktor-client/ktor-client-core/common/src/io/ktor/client/plugins/DefaultRequest.kt
4 | license: Apache 2.0
5 | category: HTTP
6 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-default-request/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": []
2 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-resources/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.client.*
2 | import io.ktor.client.plugins.resources.*
3 | import io.ktor.client.plugins.resources.Resources
4 | import io.ktor.resources.*
5 |
6 | public fun HttpClientConfig<*>.configure() {
7 | install(Resources)
8 | }
9 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-resources/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Resources
2 | description: Allows you to implement type-safe requests
3 | vcsLink: https://github.com/ktorio/ktor/blob/main/ktor-client/ktor-client-plugins/ktor-client-resources/common/src/io/ktor/client/plugins/resources/Resources.kt
4 | license: Apache 2.0
5 | category: HTTP
6 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-resources/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": ktor-client-resources:==
2 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-response-validation/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.client.*
2 | import io.ktor.client.call.*
3 | import io.ktor.client.plugins.*
4 |
5 | data class Error(val code: Int, val message: String)
6 |
7 | class CustomResponseException(message: String): Exception(message)
8 |
9 | public fun HttpClientConfig<*>.configure() {
10 | HttpResponseValidator {
11 | validateResponse { response ->
12 | val error: Error = response.body()
13 | if (error.code != 0) {
14 | throw CustomResponseException("Code: ${error.code}, message: ${error.message}")
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-response-validation/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Response Validation
2 | description: Validates responses depending on their status codes
3 | vcsLink: https://github.com/ktorio/ktor-documentation/tree/main/codeSnippets/snippets/client-retry
4 | license: Apache 2.0
5 | category: HTTP
6 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-response-validation/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": []
2 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-retry/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.client.*
2 | import io.ktor.client.plugins.*
3 |
4 | public fun HttpClientConfig<*>.configure() {
5 | install(HttpRequestRetry) {
6 | retryOnServerErrors(maxRetries = 5)
7 | exponentialDelay()
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-retry/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: HttpRequestRetry
2 | description: Configures the retry policy for failed requests
3 | vcsLink: https://github.com/ktorio/ktor-documentation/tree/main/codeSnippets/snippets/client-retry
4 | license: Apache 2.0
5 | category: HTTP
6 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-retry/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": []
2 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-serialization-cbor/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.client.*
2 | import io.ktor.client.plugins.contentnegotiation.*
3 | import io.ktor.serialization.kotlinx.cbor.*
4 | import kotlinx.serialization.cbor.*
5 |
6 | public fun HttpClientConfig<*>.configure() {
7 | install(ContentNegotiation) {
8 | cbor(Cbor {
9 | ignoreUnknownKeys = true
10 | })
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-serialization-cbor/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: CBOR Serialization
2 | description: Serializes request bodies to CBOR format
3 | vcsLink: https://github.com/ktorio/ktor
4 | license: Apache 2.0
5 | category: Serialization
6 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-serialization-cbor/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)":
2 | - io.ktor:ktor-client-content-negotiation:==
3 | - io.ktor:ktor-serialization-kotlinx-cbor:==
4 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-serialization-json-gson/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.client.*
2 | import io.ktor.client.plugins.contentnegotiation.*
3 | import io.ktor.serialization.gson.*
4 |
5 | public fun HttpClientConfig<*>.configure() {
6 | install(ContentNegotiation) {
7 | gson()
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-serialization-json-gson/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: GSON Serialization
2 | description: Serializes request bodies to json using Gson
3 | vcsLink: https://github.com/ktorio/ktor/blob/main/ktor-client/ktor-client-plugins/ktor-client-json/ktor-client-gson/jvm/src/io/ktor/client/plugins/gson/GsonSerializer.kt
4 | license: Apache 2.0
5 | category: Serialization
6 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-serialization-json-gson/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)":
2 | - io.ktor:ktor-client-content-negotiation:==
3 | - io.ktor:ktor-serialization-gson:==
4 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-serialization-json-jackson/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.client.*
2 | import io.ktor.client.plugins.contentnegotiation.*
3 | import io.ktor.serialization.jackson.*
4 |
5 | public fun HttpClientConfig<*>.configure() {
6 | install(ContentNegotiation) {
7 | jackson()
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-serialization-json-jackson/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Jackson Serialization
2 | description: Serializes request bodies to json using Jackson
3 | vcsLink: https://github.com/ktorio/ktor/blob/main/ktor-client/ktor-client-plugins/ktor-client-json/ktor-client-jackson/jvm/src/io/ktor/client/plugins/jackson/JacksonSerializer.kt
4 | license: Apache 2.0
5 | category: Serialization
6 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-serialization-json-jackson/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)":
2 | - io.ktor:ktor-client-content-negotiation:==
3 | - io.ktor:ktor-serialization-jackson:==
4 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-serialization-json-kotlinx/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.client.*
2 | import io.ktor.client.plugins.contentnegotiation.*
3 | import io.ktor.serialization.kotlinx.json.*
4 |
5 | public fun HttpClientConfig<*>.configure() {
6 | install(ContentNegotiation) {
7 | json()
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-serialization-json-kotlinx/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)":
2 | - io.ktor:ktor-client-content-negotiation:==
3 | - io.ktor:ktor-serialization-kotlinx-json:==
4 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-serialization-xml/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.client.*
2 | import io.ktor.client.plugins.contentnegotiation.*
3 | import io.ktor.serialization.kotlinx.xml.*
4 |
5 | public fun HttpClientConfig<*>.configure() {
6 | install(ContentNegotiation) {
7 | xml()
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-serialization-xml/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: XML Serialization
2 | description: Serializes request bodies to XML format
3 | vcsLink: https://github.com/ktorio/ktor
4 | license: Apache 2.0
5 | category: Serialization
6 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-serialization-xml/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)":
2 | - io.ktor:ktor-client-content-negotiation:==
3 | - io.ktor:ktor-serialization-kotlinx-xml:==
4 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-sse/3.0.0/documentation.md:
--------------------------------------------------------------------------------
1 | Server-Sent Events (SSE) plugin for the Ktor client, using the [SSE specification](https://html.spec.whatwg.org/multipage/server-sent-events.html).
2 |
3 | For more information, please refer to the [documentation](https://ktor.io/docs/3.0.0-beta-1/sse-client.html).
4 |
5 | ## Usage
6 |
7 | ```kotlin
8 | val client = HttpClient {
9 | install(SSE)
10 | }
11 | client.sse {
12 | val event = incoming.receive()
13 | }
14 | ```
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-sse/3.0.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.client.*
2 | import io.ktor.client.plugins.sse.*
3 |
4 | fun HttpClientConfig<*>.install() {
5 | install(SSE)
6 | }
7 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-sse/3.0.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Server-Sent Events (SSE)
2 | description: Support for server push events
3 | vcsLink: https://github.com/ktorio/ktor/blob/main/ktor-client/ktor-client-core/common/src/io/ktor/client/plugins/sse/SSE.kt
4 | license: Apache 2.0
5 | category: HTTP
6 | installation:
7 | default: install.kt
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-sse/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[3.0.0,)": []
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-timeout/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.client.*
2 | import io.ktor.client.plugins.*
3 |
4 | public fun HttpClientConfig<*>.configure() {
5 | install(HttpTimeout) {
6 | requestTimeoutMillis = 1000
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-timeout/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: HttpTimeout
2 | description: Configures HTTP timeouts
3 | vcsLink: https://github.com/ktorio/ktor-documentation/tree/main/codeSnippets/snippets/client-timeout
4 | license: Apache 2.0
5 | category: HTTP
6 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-timeout/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": []
2 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-user-agent/2.0/documentation.md:
--------------------------------------------------------------------------------
1 |
2 | The [UserAgent](https://api.ktor.io/ktor-client/ktor-client-core/io.ktor.client.plugins/-user-agent/index.html) plugin adds a `User-Agent` header to all requests.
3 |
4 | ## Usage
5 |
6 | To install `UserAgent`, pass it to the `install` function inside a [client configuration block](create-client.md#configure-client). Then, use the `agent` property to specify the `User-Agent` value:
7 |
8 | ```kotlin
9 | import io.ktor.client.*
10 | import io.ktor.client.engine.cio.*
11 | import io.ktor.client.plugins.*
12 | // ...
13 | val client = HttpClient(CIO) {
14 | install(UserAgent) {
15 | agent = "Ktor client"
16 | }
17 | }
18 | ```
19 |
20 | Ktor also allows you to add a browser- or curl-like `User-Agent` value using corresponding functions:
21 |
22 | ```kotlin
23 | val client = HttpClient(CIO) {
24 | BrowserUserAgent()
25 | // ... or
26 | CurlUserAgent()
27 | }
28 |
29 | ```
30 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-user-agent/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.client.*
2 | import io.ktor.client.plugins.*
3 |
4 | public fun HttpClientConfig<*>.configure() {
5 | install(UserAgent) {
6 | agent = "Ktor client"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-user-agent/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: UserAgent
2 | description: Adds a User-Agent header to all requests
3 | vcsLink: https://github.com/ktorio/ktor/blob/main/ktor-client/ktor-client-core/common/src/io/ktor/client/plugins/UserAgent.kt
4 | license: Apache 2.0
5 | category: HTTP
6 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/client-user-agent/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": []
2 |
--------------------------------------------------------------------------------
/plugins/client/io.ktor/group.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Ktor
2 | url: https://jetbrains.com/
3 | email: ktor@jetbrains.com
--------------------------------------------------------------------------------
/plugins/gradle.properties:
--------------------------------------------------------------------------------
1 | # Global version properties
2 | exposed=0.+
3 | h2=2.3.+
4 | koin=3.5.+
5 | kotlinx-rpc=0.6.0
6 | kotlinx-html=0.+
7 | mongo=4.10.+
8 | postgres=42.7.+
9 | prometheus=1.6.+
10 | kotlinx-browser=0.3
11 |
12 | # Determined by options during project creation
13 | ktor_version=3.0.2
14 | kotlin_version=2.1.0
15 |
--------------------------------------------------------------------------------
/plugins/server/com.asyncapi/asyncapi/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import com.asyncapi.kotlinasyncapi.ktor.AsyncApiPlugin
3 | import com.asyncapi.kotlinasyncapi.context.service.AsyncApiExtension
4 |
5 | public fun Application.install() {
6 | install(AsyncApiPlugin) {
7 | extension = AsyncApiExtension.builder {
8 | info {
9 | title("Sample API")
10 | version("1.0.0")
11 | }
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/plugins/server/com.asyncapi/asyncapi/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: AsyncAPI
2 | description: Generates and serves AsyncAPI documentation
3 | vcsLink: https://github.com/asyncapi/kotlin-asyncapi
4 | license: Apache 2.0
5 | category: HTTP
--------------------------------------------------------------------------------
/plugins/server/com.asyncapi/asyncapi/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": org.openfolder:kotlin-asyncapi-ktor:3.1.+
--------------------------------------------------------------------------------
/plugins/server/com.asyncapi/group.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: AsyncAPI
2 | url: https://www.asyncapi.com
3 | email: info@asyncapi.io
--------------------------------------------------------------------------------
/plugins/server/com.kborowy/firebase-auth-provider/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.auth.*
3 | import java.io.File
4 | import com.kborowy.authprovider.firebase.firebase
5 |
6 | data class MyAuthenticatedUser(val id: String) : Principal
7 |
8 | public fun Application.install() {
9 | install(Authentication) {
10 | firebase {
11 | adminFile = File("path/to/admin/file.json")
12 | realm = "My Server"
13 | validate { token ->
14 | MyAuthenticatedUser(id = token.uid)
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/plugins/server/com.kborowy/firebase-auth-provider/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Firebase authentication
2 | description: Handles Firebase bearer authentication
3 | vcsLink: https://github.com/krizzu/firebase-auth-provider
4 | license: Apache 2.0
5 | category: Security
6 | prerequisites:
7 | - auth
--------------------------------------------------------------------------------
/plugins/server/com.kborowy/firebase-auth-provider/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": com.kborowy:firebase-auth-provider:1+
--------------------------------------------------------------------------------
/plugins/server/com.kborowy/group.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Krzysztof Borowy
2 | url: https://kborowy.com
3 | email: contact@kborowy.com
--------------------------------------------------------------------------------
/plugins/server/com.sksamuel.cohort/cohort/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | # This file contains all the information needed for including your plugin.
2 | # See templates/manifest.ktor.yaml for more details
3 | name: Cohort
4 | description: Spring Actuator style implementation for Ktor
5 | vcsLink: https://github.com/sksamuel/cohort
6 | license: Apache 2.0
7 | category: Monitoring
--------------------------------------------------------------------------------
/plugins/server/com.sksamuel.cohort/cohort/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | # This file maps ktor versions to the required artifacts
2 | # See templates/versions.ktor.yaml for more details
3 | "[2.0,)": com.sksamuel.cohort:cohort-ktor:2.7.+
--------------------------------------------------------------------------------
/plugins/server/com.sksamuel.cohort/group.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Cohort
2 | url: https://github.com/sksamuel/cohort
3 | email: sam@sksamuel.com
--------------------------------------------------------------------------------
/plugins/server/com.ucasoft/group.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: UCASoft
2 | url: https://ucasoft.com
3 | email: santonov@ucasoft.com
--------------------------------------------------------------------------------
/plugins/server/com.ucasoft/simple-cache/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Simple Cache
2 | description: Provides API for cache management
3 | vcsLink: https://github.com/Scogun/ktor-simple-cache/tree/main/ktor-simple-cache
4 | license: Apache 2.0
5 | category: HTTP
6 | prerequisites:
7 | - routing
8 | installation: {}
--------------------------------------------------------------------------------
/plugins/server/com.ucasoft/simple-cache/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": com.ucasoft.ktor:ktor-simple-cache:0.+
--------------------------------------------------------------------------------
/plugins/server/com.ucasoft/simple-memory-cache/2.0/documentation.md:
--------------------------------------------------------------------------------
1 |
2 | Memory cache provider for Ktor Simple Cache plugin
3 |
4 | ## Usage
5 | ```kotlin
6 | install(SimpleCache) {
7 | memoryCache {
8 | invalidateAt = 10.seconds
9 | }
10 | }
11 |
12 | routing {
13 | cacheOutput(2.seconds) {
14 | get("short-cache") {
15 | call.respond(Random.nextInt().toString())
16 | }
17 | }
18 | cacheOutput {
19 | get("default-cache") {
20 | call.respond(Random.nextInt().toString())
21 | }
22 | }
23 | }
24 | ```
--------------------------------------------------------------------------------
/plugins/server/com.ucasoft/simple-memory-cache/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import com.ucasoft.ktor.simpleCache.SimpleCache
3 | import com.ucasoft.ktor.simpleMemoryCache.*
4 | import kotlin.time.Duration.Companion.seconds
5 |
6 | public fun Application.configureCache() {
7 | install(SimpleCache) {
8 | memoryCache {
9 | invalidateAt = 10.seconds
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/plugins/server/com.ucasoft/simple-memory-cache/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Simple Memory Cache
2 | description: Provides memory cache for Simple Cache plugin
3 | vcsLink: https://github.com/Scogun/ktor-simple-cache/tree/main/ktor-simple-memory-cache
4 | license: Apache 2.0
5 | category: HTTP
6 | prerequisites:
7 | - simple-cache
8 | installation:
9 | default: install.kt
10 | in_routing: routing.kt
--------------------------------------------------------------------------------
/plugins/server/com.ucasoft/simple-memory-cache/2.0/routing.kt:
--------------------------------------------------------------------------------
1 | import com.ucasoft.ktor.simpleCache.cacheOutput
2 | import io.ktor.server.application.*
3 | import io.ktor.server.response.*
4 | import io.ktor.server.routing.*
5 | import kotlin.random.Random
6 | import kotlin.time.Duration.Companion.seconds
7 |
8 | public fun Route.cachedEndpoints() {
9 | cacheOutput(2.seconds) {
10 | get("/short") {
11 | call.respond(Random.nextInt().toString())
12 | }
13 | }
14 | cacheOutput {
15 | get("/default") {
16 | call.respond(Random.nextInt().toString())
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/plugins/server/com.ucasoft/simple-memory-cache/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": com.ucasoft.ktor:ktor-simple-memory-cache:0.+
--------------------------------------------------------------------------------
/plugins/server/com.ucasoft/simple-redis-cache/2.0/documentation.md:
--------------------------------------------------------------------------------
1 |
2 | Redis cache provider for Ktor Simple Cache plugin
3 |
4 | ## Usage
5 | ```kotlin
6 | install(SimpleCache) {
7 | redisCache {
8 | invalidateAt = 10.seconds
9 | host = redis.host
10 | port = redis.firstMappedPort
11 | }
12 | }
13 |
14 | routing {
15 | cacheOutput(2.seconds) {
16 | get("short-cache") {
17 | call.respond(Random.nextInt().toString())
18 | }
19 | }
20 | cacheOutput {
21 | get("default-cache") {
22 | call.respond(Random.nextInt().toString())
23 | }
24 | }
25 | }
26 | ```
--------------------------------------------------------------------------------
/plugins/server/com.ucasoft/simple-redis-cache/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import com.ucasoft.ktor.simpleCache.SimpleCache
3 | import com.ucasoft.ktor.simpleRedisCache.*
4 | import kotlin.time.Duration.Companion.seconds
5 |
6 | public fun Application.configureCache() {
7 | install(SimpleCache) {
8 | redisCache {
9 | invalidateAt = 10.seconds
10 | host = "localhost"
11 | port = 6379
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/plugins/server/com.ucasoft/simple-redis-cache/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Simple Redis Cache
2 | description: Provides Redis cache for Simple Cache plugin
3 | vcsLink: https://github.com/Scogun/ktor-simple-cache/tree/main/ktor-simple-redis-cache
4 | license: Apache 2.0
5 | category: HTTP
6 | prerequisites:
7 | - simple-cache
8 | installation:
9 | default: install.kt
10 | in_routing: routing.kt
--------------------------------------------------------------------------------
/plugins/server/com.ucasoft/simple-redis-cache/2.0/routing.kt:
--------------------------------------------------------------------------------
1 | import com.ucasoft.ktor.simpleCache.cacheOutput
2 | import io.ktor.server.application.*
3 | import io.ktor.server.response.*
4 | import io.ktor.server.routing.*
5 | import kotlin.random.Random
6 | import kotlin.time.Duration.Companion.seconds
7 |
8 | public fun Route.cachedEndpoints() {
9 | cacheOutput(2.seconds) {
10 | get("/short") {
11 | call.respond(Random.nextInt().toString())
12 | }
13 | }
14 | cacheOutput {
15 | get("/default") {
16 | call.respond(Random.nextInt().toString())
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/plugins/server/com.ucasoft/simple-redis-cache/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": com.ucasoft.ktor:ktor-simple-redis-cache:0.+
--------------------------------------------------------------------------------
/plugins/server/dev.hayden/group.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Hayden Meloche
2 | url: https://hayden.dev
3 | email: meloche.hayden@gmail.com
--------------------------------------------------------------------------------
/plugins/server/dev.hayden/khealth/2.0,3.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import dev.hayden.KHealth
3 |
4 | // The contents of the `install` function will be used for the project template
5 | public fun Application.install() {
6 | install(KHealth)
7 | }
8 |
--------------------------------------------------------------------------------
/plugins/server/dev.hayden/khealth/2.0,3.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: KHealth
2 | description: A simple and customizable health plugin
3 | vcsLink: https://github.com/HaydenMeloche/khealth
4 | license: MIT
5 | category: Monitoring
6 | gradle:
7 | repositories:
8 | - url: https://jitpack.io
9 | maven:
10 | repositories:
11 | - id: jitpack
12 | url: https://jitpack.io
--------------------------------------------------------------------------------
/plugins/server/dev.hayden/khealth/3.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import dev.hayden.KHealth
3 |
4 | // The contents of the `install` function will be used for the project template
5 | public fun Application.install() {
6 | install(KHealth)
7 | }
8 |
--------------------------------------------------------------------------------
/plugins/server/dev.hayden/khealth/3.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: KHealth
2 | description: A simple and customizable health plugin
3 | vcsLink: https://github.com/HaydenMeloche/khealth
4 | license: MIT
5 | category: Monitoring
6 | gradle:
7 | repositories:
8 | - url: https://jitpack.io
9 | maven:
10 | repositories:
11 | - id: jitpack
12 | url: https://jitpack.io
--------------------------------------------------------------------------------
/plugins/server/dev.hayden/khealth/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,3.0)": dev.hayden:khealth:2.1.+
2 | "[3.0,)": dev.hayden:khealth:3.0.+
3 |
--------------------------------------------------------------------------------
/plugins/server/io.github.cotrin8672/group.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Cotrin
2 | url: https://github.com/cotrin8672
3 | email: gummy8672@gmail.com
--------------------------------------------------------------------------------
/plugins/server/io.github.cotrin8672/line-webhook/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: LineWebhook
2 | description: Validates the signature of LineBot webhooks
3 | vcsLink: https://github.com/cotrin8672/ktor-line-webhook-plugin
4 | license: Apache 2.0
5 | category: Security
6 | prerequisites:
7 | - double-receive
8 | installation:
9 | in_routing: routing.kt
10 |
--------------------------------------------------------------------------------
/plugins/server/io.github.cotrin8672/line-webhook/2.0/routing.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.http.*
2 | import io.ktor.server.application.*
3 | import io.ktor.server.plugins.doublereceive.*
4 | import io.ktor.server.response.*
5 | import io.ktor.server.routing.*
6 | import io.github.cotrin8672.LineWebhook
7 |
8 | public fun Route.configureWebhook() {
9 | route("/callback") {
10 | install(DoubleReceive)
11 | install(LineWebhook) {
12 | channelSecret = System.getenv("CHANNEL_SECRET")
13 | }
14 | post {
15 | call.respond(HttpStatusCode.OK)
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/plugins/server/io.github.cotrin8672/line-webhook/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": ktor-line-webhook-plugin:1.5.+
2 |
--------------------------------------------------------------------------------
/plugins/server/io.github.damirdenis-tudor/group.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Damir Denis-Tudor
2 | url: https://github.com/DamirDenis-Tudor
3 | email: denis-tudor.damir@student.tuiasi.ro
4 | logo: icon.png
--------------------------------------------------------------------------------
/plugins/server/io.github.damirdenis-tudor/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ktorio/ktor-plugin-registry/483dc0ed49b07e6022405c276a68587e11d3afcd/plugins/server/io.github.damirdenis-tudor/icon.png
--------------------------------------------------------------------------------
/plugins/server/io.github.damirdenis-tudor/ktor-server-rabbitmq/3.0/application.conf:
--------------------------------------------------------------------------------
1 | ktor {
2 | rabbitmq {
3 | uri = "amqp://guest:guest@localhost:5672"
4 | defaultConnectionName = "default_connection"
5 | dispatcherThreadPollSize = 4
6 | connectionAttempts = 10
7 | attemptDelay = 5
8 | tls {
9 | enabled = false
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/plugins/server/io.github.damirdenis-tudor/ktor-server-rabbitmq/3.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: RabbitMQ
2 | description: Adds RabbitMQ support to your application
3 | vcsLink: https://github.com/DamirDenis-Tudor/ktor-server-rabbitmq
4 | license: Apache 2.0
5 |
6 | category: Frameworks
7 |
8 | installation:
9 | default: install.kt
10 | application_conf: application.conf
--------------------------------------------------------------------------------
/plugins/server/io.github.damirdenis-tudor/ktor-server-rabbitmq/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[3.0,)": io.github.damirdenis-tudor:ktor-server-rabbitmq:1.3.6+
--------------------------------------------------------------------------------
/plugins/server/io.github.flaxoos/group.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Flaxoos
2 | url: https://flaxoos.github.io
3 | email: idoflax@gmail.com
4 |
--------------------------------------------------------------------------------
/plugins/server/io.github.flaxoos/ktor-server-kafka/2.0,3.0/application.conf:
--------------------------------------------------------------------------------
1 | ktor {
2 | kafka {
3 | schema.registry.url = ["SCHEMA_REGISTRY_URL"]
4 | common {
5 | "bootstrap.servers" = ["BOOTSTRAP_SERVERS"]
6 | # Additional attributes
7 | }
8 | admin {
9 | # Additional attributes
10 | }
11 | consumer {
12 | "group.id" = "my-group-id"
13 | # Additional attributes
14 | }
15 | producer {
16 | "client.id" = "my-client-id"
17 | # Additional attributes
18 | }
19 | topics = [
20 | {
21 | name = my-topic
22 | partitions = 1
23 | configs {
24 | "message.timestamp.type" = CreateTime
25 | # Additional attributes
26 | }
27 | }
28 | ]
29 | }
30 | }
--------------------------------------------------------------------------------
/plugins/server/io.github.flaxoos/ktor-server-kafka/2.0,3.0/application.yaml:
--------------------------------------------------------------------------------
1 | ktor:
2 | kafka:
3 | schema.registry.url:
4 | - "SCHEMA_REGISTRY_URL"
5 | common:
6 | bootstrap.servers:
7 | - "BOOTSTRAP_SERVERS"
8 | # Additional attributes
9 | admin:
10 | # Additional attributes
11 | consumer:
12 | group.id: "my-group-id"
13 | # Additional attributes
14 | producer:
15 | client.id: "my-client-id"
16 | # Additional attributes
17 | topics:
18 | - name: my-topic
19 | partitions: 1
20 | configs:
21 | message.timestamp.type: CreateTime
22 | # Additional attributes
23 |
--------------------------------------------------------------------------------
/plugins/server/io.github.flaxoos/ktor-server-kafka/2.0,3.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Kafka
2 | description: Adds Kafka support to your application
3 | vcsLink: https://github.com/Flaxoos/extra-ktor-plugins/tree/main/ktor-server-kafka
4 | license: MIT License
5 | category: Databases
6 | gradle:
7 | repositories:
8 | - url: https://packages.confluent.io/maven/
9 | maven:
10 | repositories:
11 | - id: confluence
12 | url: https://packages.confluent.io/maven/
13 |
14 | installation:
15 | default: install.kt
16 | application_conf: application.conf
17 | application_yaml: application.yaml
--------------------------------------------------------------------------------
/plugins/server/io.github.flaxoos/ktor-server-kafka/3.0/application.conf:
--------------------------------------------------------------------------------
1 | ktor {
2 | kafka {
3 | schema.registry.url = ["SCHEMA_REGISTRY_URL"]
4 | common {
5 | "bootstrap.servers" = ["BOOTSTRAP_SERVERS"]
6 | # Additional attributes
7 | }
8 | admin {
9 | # Additional attributes
10 | }
11 | consumer {
12 | "group.id" = "my-group-id"
13 | # Additional attributes
14 | }
15 | producer {
16 | "client.id" = "my-client-id"
17 | # Additional attributes
18 | }
19 | topics = [
20 | {
21 | name = my-topic
22 | partitions = 1
23 | configs {
24 | "message.timestamp.type" = CreateTime
25 | # Additional attributes
26 | }
27 | }
28 | ]
29 | }
30 | }
--------------------------------------------------------------------------------
/plugins/server/io.github.flaxoos/ktor-server-kafka/3.0/application.yaml:
--------------------------------------------------------------------------------
1 | ktor:
2 | kafka:
3 | schema.registry.url:
4 | - "SCHEMA_REGISTRY_URL"
5 | common:
6 | bootstrap.servers:
7 | - "BOOTSTRAP_SERVERS"
8 | # Additional attributes
9 | admin:
10 | # Additional attributes
11 | consumer:
12 | group.id: "my-group-id"
13 | # Additional attributes
14 | producer:
15 | client.id: "my-client-id"
16 | # Additional attributes
17 | topics:
18 | - name: my-topic
19 | partitions: 1
20 | configs:
21 | message.timestamp.type: CreateTime
22 | # Additional attributes
23 |
--------------------------------------------------------------------------------
/plugins/server/io.github.flaxoos/ktor-server-kafka/3.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Kafka
2 | description: Adds Kafka support to your application
3 | vcsLink: https://github.com/Flaxoos/extra-ktor-plugins/tree/main/ktor-server-kafka
4 | license: MIT License
5 | category: Databases
6 | gradle:
7 | repositories:
8 | - url: https://packages.confluent.io/maven/
9 | maven:
10 | repositories:
11 | - id: confluence
12 | url: https://packages.confluent.io/maven/
13 |
14 | installation:
15 | default: install.kt
16 | application_conf: application.conf
17 | application_yaml: application.yaml
--------------------------------------------------------------------------------
/plugins/server/io.github.flaxoos/ktor-server-kafka/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,3.0)": io.github.flaxoos:ktor-server-kafka:1.2.10
2 | "[3.0,)": io.github.flaxoos:ktor-server-kafka:2.+
3 |
--------------------------------------------------------------------------------
/plugins/server/io.github.flaxoos/ktor-server-rate-limiting/2.0,3.0/install.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
3 | */
4 | // The contents of the `install` function will be used for the project template
5 | import io.github.flaxoos.ktor.server.plugins.ratelimiter.*
6 | import io.github.flaxoos.ktor.server.plugins.ratelimiter.implementations.*
7 | import io.ktor.server.application.*
8 | import io.ktor.server.routing.*
9 | import kotlin.time.Duration.Companion.seconds
10 | public fun Application.install() {
11 | routing {
12 | route("/"){
13 | install(RateLimiting) {
14 | rateLimiter {
15 | type = TokenBucket::class
16 | capacity = 100
17 | rate = 10.seconds
18 | }
19 | }
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/plugins/server/io.github.flaxoos/ktor-server-rate-limiting/2.0,3.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Rate Limiting
2 | description: Manage request rate limiting as you see fit
3 | vcsLink: https://github.com/Flaxoos/extra-ktor-plugins
4 | license: Apache 2.0
5 | category: Administration
6 |
7 | gradle:
8 | repositories:
9 | - url: https://packages.confluent.io/maven/
10 | maven:
11 | repositories:
12 | - id: confluence
13 | url: https://packages.confluent.io/maven/
14 |
15 | installation:
16 | default: install.kt
--------------------------------------------------------------------------------
/plugins/server/io.github.flaxoos/ktor-server-rate-limiting/3.0/install.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
3 | */
4 | // The contents of the `install` function will be used for the project template
5 | import io.github.flaxoos.ktor.server.plugins.ratelimiter.*
6 | import io.github.flaxoos.ktor.server.plugins.ratelimiter.implementations.*
7 | import io.ktor.server.application.*
8 | import io.ktor.server.routing.*
9 | import kotlin.time.Duration.Companion.seconds
10 | public fun Application.install() {
11 | routing {
12 | route("/"){
13 | install(RateLimiting) {
14 | rateLimiter {
15 | type = TokenBucket::class
16 | capacity = 100
17 | rate = 10.seconds
18 | }
19 | }
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/plugins/server/io.github.flaxoos/ktor-server-rate-limiting/3.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Rate Limiting
2 | description: Manage request rate limiting as you see fit
3 | vcsLink: https://github.com/Flaxoos/extra-ktor-plugins
4 | license: Apache 2.0
5 | category: Administration
6 |
7 | gradle:
8 | repositories:
9 | - url: https://packages.confluent.io/maven/
10 | maven:
11 | repositories:
12 | - id: confluence
13 | url: https://packages.confluent.io/maven/
14 |
15 | installation:
16 | default: install.kt
--------------------------------------------------------------------------------
/plugins/server/io.github.flaxoos/ktor-server-rate-limiting/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,3.0)": io.github.flaxoos:ktor-server-rate-limiting:1.2.10
2 | "[3.0,)": io.github.flaxoos:ktor-server-rate-limiting:2.+
3 |
--------------------------------------------------------------------------------
/plugins/server/io.github.flaxoos/ktor-server-task-scheduling/2.0,3.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Task Scheduling
2 | description: Manages scheduled tasks across instances of your distributed Ktor server
3 | vcsLink: https://github.com/Flaxoos/extra-ktor-plugins
4 | license: Apache 2.0
5 | category: Administration
6 |
7 | gradle:
8 | repositories:
9 | - url: https://packages.confluent.io/maven/
10 | maven:
11 | repositories:
12 | - id: confluence
13 | url: https://packages.confluent.io/maven/
14 |
15 | installation:
16 | default: install.kt
--------------------------------------------------------------------------------
/plugins/server/io.github.flaxoos/ktor-server-task-scheduling/3.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Task Scheduling
2 | description: Manages scheduled tasks across instances of your distributed Ktor server
3 | vcsLink: https://github.com/Flaxoos/extra-ktor-plugins
4 | license: Apache 2.0
5 | category: Administration
6 |
7 | gradle:
8 | repositories:
9 | - url: https://packages.confluent.io/maven/
10 | maven:
11 | repositories:
12 | - id: confluence
13 | url: https://packages.confluent.io/maven/
14 |
15 | installation:
16 | default: install.kt
--------------------------------------------------------------------------------
/plugins/server/io.github.flaxoos/ktor-server-task-scheduling/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,3.0)":
2 | - io.github.flaxoos:ktor-server-task-scheduling-core:1.2.10
3 | - io.github.flaxoos:ktor-server-task-scheduling-redis:1.2.10
4 | - io.github.flaxoos:ktor-server-task-scheduling-mongodb:1.2.10
5 | - io.github.flaxoos:ktor-server-task-scheduling-jdbc:1.2.10
6 | "[3.0,)":
7 | - io.github.flaxoos:ktor-server-task-scheduling-core:2.+
8 | - io.github.flaxoos:ktor-server-task-scheduling-redis:2.+
9 | - io.github.flaxoos:ktor-server-task-scheduling-mongodb:2.+
10 | - io.github.flaxoos:ktor-server-task-scheduling-jdbc:2.+
11 |
--------------------------------------------------------------------------------
/plugins/server/io.github.smiley4/group.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Smiley4
2 | url: https://github.com/SMILEY4/ktor-swagger-ui
3 | email: ruegnerlukas@gmail.com
4 |
--------------------------------------------------------------------------------
/plugins/server/io.github.smiley4/ktor-swagger-ui/2.0,3.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.Application
2 | import io.ktor.server.application.install
3 | import io.github.smiley4.ktorswaggerui.SwaggerUI
4 |
5 | public fun Application.install() {
6 | install(SwaggerUI) {
7 | swagger {
8 | swaggerUrl = "swagger-ui"
9 | forwardRoot = true
10 | }
11 | info {
12 | title = "Example API"
13 | version = "latest"
14 | description = "Example API for testing and demonstration purposes."
15 | }
16 | server {
17 | url = "http://localhost:8080"
18 | description = "Development Server"
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/plugins/server/io.github.smiley4/ktor-swagger-ui/2.0,3.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Ktor-swagger-ui
2 | description: Generates OpenAPI specification and Swagger UI
3 | vcsLink: https://github.com/SMILEY4/ktor-swagger-ui
4 | license: Apache 2.0
5 | category: Routing
6 | prerequisites:
7 | - routing
8 | - webjars
--------------------------------------------------------------------------------
/plugins/server/io.github.smiley4/ktor-swagger-ui/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,3.0)": io.github.smiley4:ktor-swagger-ui:2.+
2 |
--------------------------------------------------------------------------------
/plugins/server/io.insert-koin/group.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Kotzilla
2 | url: https://insert-koin.io
3 | email: contact@kotzilla.io
4 | logo: icon.png
--------------------------------------------------------------------------------
/plugins/server/io.insert-koin/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ktorio/ktor-plugin-registry/483dc0ed49b07e6022405c276a68587e11d3afcd/plugins/server/io.insert-koin/icon.png
--------------------------------------------------------------------------------
/plugins/server/io.insert-koin/koin/2.0/HelloService.kt:
--------------------------------------------------------------------------------
1 | fun interface HelloService {
2 | fun sayHello()
3 | }
--------------------------------------------------------------------------------
/plugins/server/io.insert-koin/koin/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 |
3 | import io.ktor.server.application.*
4 | import org.koin.dsl.module
5 | import org.koin.ktor.plugin.Koin
6 | import org.koin.logger.slf4jLogger
7 |
8 | public fun Application.install() {
9 | install(Koin) {
10 | slf4jLogger()
11 | modules(module {
12 | single {
13 | HelloService {
14 | println(environment.log.info("Hello, World!"))
15 | }
16 | }
17 | })
18 | }
19 | }
--------------------------------------------------------------------------------
/plugins/server/io.insert-koin/koin/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Koin
2 | description: Provides dependency injection
3 | vcsLink: https://github.com/InsertKoinIO/koin
4 | license: Apache 2.0
5 | category: Frameworks
6 | installation:
7 | default: install.kt
8 | sources:
9 | - HelloService.kt
--------------------------------------------------------------------------------
/plugins/server/io.insert-koin/koin/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)":
2 | - io.insert-koin:koin-ktor:$koin
3 | - io.insert-koin:koin-logger-slf4j:$koin
4 |
5 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/auth-basic/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.auth.*
3 | import io.ktor.server.response.*
4 |
5 | public fun Application.configureSecurity() {
6 | authentication {
7 | basic(name = "myauth1") {
8 | realm = "Ktor Server"
9 | validate { credentials ->
10 | if (credentials.name == credentials.password) {
11 | UserIdPrincipal(credentials.name)
12 | } else {
13 | null
14 | }
15 | }
16 | }
17 |
18 | form(name = "myauth2") {
19 | userParamName = "user"
20 | passwordParamName = "password"
21 | challenge {
22 | /**/
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/auth-basic/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Authentication Basic
2 | description: Handles 'Basic' username / password authentication scheme
3 | vcsLink: https://github.com/ktorio/ktor/blob/4a50c76c3264b0121b91a203d38473bb4aafbace/ktor-features/ktor-auth/jvm/src/io/ktor/auth/BasicAuth.kt
4 | license: Apache 2.0
5 | category: Security
6 | prerequisites:
7 | - auth
8 | installation:
9 | default: install.kt
10 | in_routing: routing.kt
11 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/auth-basic/2.0/routing.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.auth.*
3 | import io.ktor.server.response.*
4 | import io.ktor.server.routing.*
5 |
6 | public fun Routing.configureRouting() {
7 | authenticate("myauth1") {
8 | get("/protected/route/basic") {
9 | val principal = call.principal()!!
10 | call.respondText("Hello ${principal.name}")
11 | }
12 | }
13 | authenticate("myauth2") {
14 | get("/protected/route/form") {
15 | val principal = call.principal()!!
16 | call.respondText("Hello ${principal.name}")
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/auth-basic/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": []
2 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/auth-digest/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.auth.*
3 | import io.ktor.server.response.*
4 | import io.ktor.util.*
5 |
6 | public fun Application.configureSecurity() {
7 | authentication {
8 | val myRealm = "MyRealm"
9 | val usersInMyRealmToHA1: Map = mapOf(
10 | // pass="test", HA1=MD5("test:MyRealm:pass")="fb12475e62dedc5c2744d98eb73b8877"
11 | "test" to hex("fb12475e62dedc5c2744d98eb73b8877")
12 | )
13 |
14 | digest("myDigestAuth") {
15 | digestProvider { userName, realm ->
16 | usersInMyRealmToHA1[userName]
17 | }
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/auth-digest/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Authentication Digest
2 | description: Handles 'Digest' authentication scheme
3 | vcsLink: https://github.com/ktorio/ktor/blob/e03bafda3b3d72fcac166e46cf55e5d2d9383660/ktor-client/ktor-client-features/ktor-client-auth/common/src/io/ktor/client/features/auth/providers/DigestAuthProvider.kt
4 | license: Apache 2.0
5 | category: Security
6 | prerequisites:
7 | - auth
8 | installation:
9 | default: install.kt
10 | in_routing: routing.kt
11 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/auth-digest/2.0/routing.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.auth.*
3 | import io.ktor.server.response.*
4 | import io.ktor.server.routing.*
5 | import io.ktor.util.*
6 |
7 | public fun Routing.configureRouting() {
8 | authenticate("myDigestAuth") {
9 | get("/protected/route/digest") {
10 | val principal = call.principal()!!
11 | call.respondText("Hello ${principal.name}")
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/auth-digest/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": []
2 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/auth-jwt/2.0/application.conf:
--------------------------------------------------------------------------------
1 | jwt {
2 | domain = "https://jwt-provider-domain/"
3 | audience = "jwt-audience"
4 | realm = "ktor sample app"
5 | }
6 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/auth-jwt/2.0/application.yaml:
--------------------------------------------------------------------------------
1 | jwt:
2 | domain: "https://jwt-provider-domain/"
3 | audience: "jwt-audience"
4 | realm: "ktor sample app"
5 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/auth-jwt/2.0/documentation.md:
--------------------------------------------------------------------------------
1 |
2 | JSON Web Token is an open standard that defines a way for securely transmitting information between parties as a JSON object. This information can be verified and trusted since it is signed using a shared secret (with the `HS256` algorithm) or a public/private key pair (for example, `RS256`).
3 |
4 | Ktor handles JWTs passed in the `Authorization` header using the `Bearer` schema and allows you to:
5 | * verify the signature of a JSON web token;
6 | * perform additional validations on the JWT payload.
7 |
8 | ## Usage
9 |
10 | To learn how to use JSON web tokens in a server Ktor application, see [JSON Web Tokens](https://ktor.io/docs/jwt.html).
11 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/auth-jwt/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Authentication JWT
2 | description: Handles JSON Web Token (JWT) bearer authentication scheme
3 | vcsLink: https://github.com/ktorio/ktor/blob/7e78e715cec3ff039cd628f8ff8ce875c35cde4c/ktor-features/ktor-auth-jwt/jvm/src/io/ktor/auth/jwt/JWTAuth.kt
4 | license: Apache 2.0
5 | category: Security
6 | prerequisites:
7 | - auth
8 | installation:
9 | default: install.kt
10 | application_conf: application.conf
11 | application_yaml: application.yaml
12 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/auth-jwt/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": ktor-server-auth-jwt:==
2 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/auth-ldap/2.0/documentation.md:
--------------------------------------------------------------------------------
1 |
2 | [LDAP](https://ktor.io/docs/ldap.html) is a protocol for working with various directory services that can store information about users. Ktor allows you to authenticate LDAP users using the Basic, Digest, or Form-based authentications schemes.
3 |
4 | ## Usage
5 |
6 | To authenticate an LDAP user, you need to call the `ldapAuthenticate` function. Configuration with the Basic provider might look as follows:
7 | ```kotlin
8 | install(Authentication) {
9 | basic("auth-ldap") {
10 | validate { credentials ->
11 | ldapAuthenticate(credentials, "ldap://0.0.0.0:389", "cn=%s,dc=ktor,dc=io")
12 | }
13 | }
14 | }
15 | ```
16 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/auth-ldap/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.auth.*
3 | import io.ktor.server.auth.ldap.*
4 | import io.ktor.server.response.*
5 |
6 | public fun Application.configureSecurity() {
7 | val localhost = "http://0.0.0.0"
8 | val ldapServerPort = 6998 // TODO: change to real value!
9 | authentication {
10 | basic("authName") {
11 | realm = "realm"
12 | validate { credential ->
13 | ldapAuthenticate(credential, "ldap://$localhost:${ldapServerPort}", "uid=%s,ou=system")
14 | }
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/auth-ldap/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Authentication LDAP
2 | description: Handles Lightweight Directory Access Protocol (LDAP) authentication
3 | vcsLink: https://github.com/ktorio/ktor/blob/4a50c76c3264b0121b91a203d38473bb4aafbace/ktor-features/ktor-auth-ldap/jvm/src/io/ktor/auth/ldap/Ldap.kt
4 | license: Apache 2.0
5 | category: Security
6 | prerequisites:
7 | - auth
8 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/auth-ldap/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": ktor-server-auth-ldap:==
2 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/auth-oauth/2.0/documentation.md:
--------------------------------------------------------------------------------
1 |
2 | [OAuth](https://ktor.io/docs/oauth.html) is an open standard for access delegation. OAuth can be used to authorize users of your application by using external providers, such as Google, Facebook, Twitter, and so on.
3 |
4 | The `oauth` provider supports the authorization code flow. You can configure OAuth parameters in one place, and Ktor will automatically make a request to a specified authorization server with the necessary parameters.
5 |
6 | ## Usage
7 |
8 | To learn how to configure the `oauth` provider for authorizing users of your application using an external provider, see [OAuth](https://ktor.io/docs/oauth.html).
9 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/auth-oauth/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Authentication OAuth
2 | description: Handles OAuth Bearer authentication scheme
3 | vcsLink: https://github.com/ktorio/ktor/blob/4a50c76c3264b0121b91a203d38473bb4aafbace/ktor-features/ktor-auth/jvm/src/io/ktor/auth/OAuth.kt
4 | license: Apache 2.0
5 | category: Security
6 | prerequisites:
7 | - auth
8 | installation:
9 | default: install.kt
10 | in_routing: routing.kt
11 | outside_app: outside_app.kt
12 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/auth-oauth/2.0/outside_app.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.client.*
2 | import io.ktor.client.engine.apache.*
3 | import io.ktor.http.*
4 | import io.ktor.server.application.*
5 | import io.ktor.server.auth.*
6 | import io.ktor.server.response.*
7 | import io.ktor.server.sessions.*
8 |
9 | class UserSession(accessToken: String)
10 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/auth-oauth/2.0/routing.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.auth.*
2 | import io.ktor.server.response.*
3 | import io.ktor.server.routing.*
4 | import io.ktor.server.sessions.*
5 |
6 | public fun Routing.configureRouting() {
7 | authenticate("auth-oauth-google") {
8 | get("login") {
9 | call.respondRedirect("/callback")
10 | }
11 |
12 | get("/callback") {
13 | val principal: OAuthAccessTokenResponse.OAuth2? = call.authentication.principal()
14 | call.sessions.set(UserSession(principal?.accessToken.toString()))
15 | call.respondRedirect("/hello")
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/auth-oauth/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)":
2 | - io.ktor:ktor-client-core:==
3 | - io.ktor:ktor-client-apache:==
4 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/auth/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Authentication
2 | description: Provides extension point for handling the Authorization header
3 | vcsLink: https://github.com/ktorio/ktor/blob/4a50c76c3264b0121b91a203d38473bb4aafbace/ktor-features/ktor-auth/jvm/src/io/ktor/auth/Authentication.kt
4 | license: Apache 2.0
5 | category: Security
6 | prerequisites:
7 | - routing
8 | installation: {}
--------------------------------------------------------------------------------
/plugins/server/io.ktor/auth/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": ktor-server-auth:==
2 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/auto-head-response/2.0/documentation.md:
--------------------------------------------------------------------------------
1 |
2 | The [AutoHeadResponse](https://ktor.io/docs/autoheadresponse.html) plugin provides us with the ability to automatically respond to `HEAD` requests for every route that has a `GET` defined. You can use `AutoHeadResponse` to avoid creating a separate `head` handler if you need to somehow process a response on the client before getting the actual content.
3 |
4 | ## Usage
5 |
6 | In order to take advantage of this functionality, we need to install the `AutoHeadResponse` plugin in our application:
7 | ```kotlin
8 | install(AutoHeadResponse)
9 | routing {
10 | get("/home") {
11 | call.respondText("This is a response to a GET, but HEAD also works")
12 | }
13 | }
14 | ```
15 | In our case, the `/home` route will now respond to `HEAD` requests even though there is no explicit definition for this verb.
16 | ## Options
17 |
18 | `AutoHeadResponse` does not provide any additional configuration options.
19 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/auto-head-response/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.plugins.autohead.*
3 | import io.ktor.server.response.*
4 |
5 | public fun Application.configureRouting() {
6 | install(AutoHeadResponse)
7 | }
8 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/auto-head-response/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: AutoHeadResponse
2 | description: Provides automatic responses for HEAD requests
3 | vcsLink: https://github.com/ktorio/ktor/blob/4517e3856a3cae8f157d2f6966635217827d2abd/ktor-server/ktor-server-core/jvm/src/io/ktor/features/AutoHeadResponse.kt
4 | license: Apache 2.0
5 | category: Routing
6 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/auto-head-response/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": ktor-server-auto-head-response:==
2 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/caching-headers/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.http.*
2 | import io.ktor.http.content.*
3 | import io.ktor.server.application.*
4 | import io.ktor.server.plugins.cachingheaders.*
5 | import io.ktor.server.response.*
6 |
7 | public fun Application.configureHTTP() {
8 | install(CachingHeaders) {
9 | options { call, outgoingContent ->
10 | when (outgoingContent.contentType?.withoutParameters()) {
11 | ContentType.Text.CSS -> CachingOptions(CacheControl.MaxAge(maxAgeSeconds = 24 * 60 * 60))
12 | else -> null
13 | }
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/caching-headers/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Caching Headers
2 | description: Provides options for responding with standard cache-control headers
3 | vcsLink: https://github.com/ktorio/ktor/blob/419744383223899e69746b2afe50d873d442e568/ktor-server/ktor-server-core/jvm/src/io/ktor/features/CachingHeaders.kt
4 | license: Apache 2.0
5 | category: HTTP
6 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/caching-headers/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": ktor-server-caching-headers:==
2 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/call-logging/2.0,3.0.0/call_logging.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.plugins.callloging.*
2 | import io.ktor.server.request.*
3 | import io.ktor.server.routing.*
4 | import org.slf4j.event.*
5 |
6 | public fun CallLoggingConfig.configureLogging() {
7 | level = Level.INFO
8 | filter { call -> call.request.path().startsWith("/") }
9 | }
10 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/call-logging/2.0,3.0.0/documentation.md:
--------------------------------------------------------------------------------
1 |
2 | Ktor provides the capability to log application events using the `SLF4J` library. The [CallLogging](https://ktor.io/docs/call-logging.html) plugin allows you to log incoming client requests.
3 |
4 | ## Usage
5 |
6 | The example below shows how to add conditions for filtering requests:
7 |
8 | ```kotlin
9 | install(CallLogging) {
10 | filter { call ->
11 | call.request.path().startsWith("/api/v1")
12 | }
13 | }
14 | ```
15 |
16 | You can learn more about other configuration capabilities from [CallLogging](https://ktor.io/docs/call-logging.html).
17 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/call-logging/2.0,3.0.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.plugins.callloging.*
3 | import io.ktor.server.request.*
4 | import io.ktor.server.response.*
5 | import org.slf4j.event.*
6 |
7 | public fun Application.configureMonitoring() {
8 | install(CallLogging) {
9 | level = Level.INFO
10 | filter { call -> call.request.path().startsWith("/") }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/call-logging/2.0,3.0.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Call Logging
2 | description: Logs client requests
3 | vcsLink: https://github.com/ktorio/ktor/blob/f028b0ca428335b6545b81afef803e236242b3a5/ktor-server/ktor-server-core/jvm/src/io/ktor/features/CallLogging.kt
4 | license: Apache 2.0
5 | category: Monitoring
6 | installation:
7 | default: install.kt
8 | call_logging_config: call_logging.kt
9 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/call-logging/3.0.0/call_logging.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.plugins.calllogging.*
2 | import io.ktor.server.request.*
3 | import io.ktor.server.routing.*
4 | import org.slf4j.event.*
5 |
6 | public fun CallLoggingConfig.configureLogging() {
7 | level = Level.INFO
8 | filter { call -> call.request.path().startsWith("/") }
9 | }
10 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/call-logging/3.0.0/documentation.md:
--------------------------------------------------------------------------------
1 |
2 | Ktor provides the capability to log application events using the `SLF4J` library. The [CallLogging](https://ktor.io/docs/call-logging.html) plugin allows you to log incoming client requests.
3 |
4 | ## Usage
5 |
6 | The example below shows how to add conditions for filtering requests:
7 |
8 | ```kotlin
9 | install(CallLogging) {
10 | filter { call ->
11 | call.request.path().startsWith("/api/v1")
12 | }
13 | }
14 | ```
15 |
16 | You can learn more about other configuration capabilities from [CallLogging](https://ktor.io/docs/call-logging.html).
17 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/call-logging/3.0.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Call Logging
2 | description: Logs client requests
3 | vcsLink: https://github.com/ktorio/ktor/blob/f028b0ca428335b6545b81afef803e236242b3a5/ktor-server/ktor-server-core/jvm/src/io/ktor/features/CallLogging.kt
4 | license: Apache 2.0
5 | category: Monitoring
6 | installation:
7 | call_logging_config: call_logging.kt
8 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/call-logging/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,3.0.0)": ktor-server-call-logging:==
2 | "[3.0.0,)": ktor-server-call-logging:==
3 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/callid/2.0,3.0/call_logging.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.http.*
2 | import io.ktor.server.plugins.callid.*
3 | import io.ktor.server.plugins.callloging.*
4 | import io.ktor.server.routing.*
5 |
6 | public fun CallLoggingConfig.configureLogging() {
7 | callIdMdc("call-id")
8 | }
9 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/callid/2.0,3.0/documentation.md:
--------------------------------------------------------------------------------
1 |
2 | The `CallId` plugin allows you to trace client requests end-to-end by using unique request IDs or call IDs. Using `CallId` along with `CallLogging` helps you troubleshoot calls by putting a call ID in the MDC context and configuring a logger to show a call ID for each request.
3 |
4 | ## Usage
5 |
6 | The example below shows how to:
7 | - retrieve a call ID and send it in the same header using the `header` function
8 | - use the `verify` function to verify the retrieved call ID
9 |
10 | ```kotlin
11 | install(CallId) {
12 | header(HttpHeaders.XRequestId)
13 | verify { callId: String ->
14 | callId.isNotEmpty()
15 | }
16 | }
17 | ```
18 |
19 | You can learn more about other configuration capabilities from [CallId](https://ktor.io/docs/call-id.html).
20 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/callid/2.0,3.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.http.*
2 | import io.ktor.server.application.*
3 | import io.ktor.server.plugins.callid.*
4 | import io.ktor.server.response.*
5 |
6 | public fun Application.configureMonitoring() {
7 | install(CallId) {
8 | header(HttpHeaders.XRequestId)
9 | verify { callId: String ->
10 | callId.isNotEmpty()
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/callid/2.0,3.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Call ID
2 | description: Allows to identify a request/call.
3 | vcsLink: https://github.com/ktorio/ktor/blob/f028b0ca428335b6545b81afef803e236242b3a5/ktor-server/ktor-server-core/jvm/src/io/ktor/features/CallId.kt
4 | license: Apache 2.0
5 | category: Monitoring
6 | prerequisites:
7 | - call-logging
8 | installation:
9 | default: install.kt
10 | call_logging_config: call_logging.kt
11 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/callid/3.0/call_logging.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.http.*
2 | import io.ktor.server.plugins.callid.*
3 | import io.ktor.server.plugins.calllogging.*
4 | import io.ktor.server.routing.*
5 |
6 | public fun CallLoggingConfig.configureLogging() {
7 | callIdMdc("call-id")
8 | }
9 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/callid/3.0/documentation.md:
--------------------------------------------------------------------------------
1 |
2 | The `CallId` plugin allows you to trace client requests end-to-end by using unique request IDs or call IDs. Using `CallId` along with `CallLogging` helps you troubleshoot calls by putting a call ID in the MDC context and configuring a logger to show a call ID for each request.
3 |
4 | ## Usage
5 |
6 | The example below shows how to:
7 | - retrieve a call ID and send it in the same header using the `header` function
8 | - use the `verify` function to verify the retrieved call ID
9 |
10 | ```kotlin
11 | install(CallId) {
12 | header(HttpHeaders.XRequestId)
13 | verify { callId: String ->
14 | callId.isNotEmpty()
15 | }
16 | }
17 | ```
18 |
19 | You can learn more about other configuration capabilities from [CallId](https://ktor.io/docs/call-id.html).
20 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/callid/3.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.http.*
2 | import io.ktor.server.application.*
3 | import io.ktor.server.plugins.callid.*
4 | import io.ktor.server.response.*
5 |
6 | public fun Application.configureMonitoring() {
7 | install(CallId) {
8 | header(HttpHeaders.XRequestId)
9 | verify { callId: String ->
10 | callId.isNotEmpty()
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/callid/3.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Call ID
2 | description: Allows to identify a request/call.
3 | vcsLink: https://github.com/ktorio/ktor/blob/f028b0ca428335b6545b81afef803e236242b3a5/ktor-server/ktor-server-core/jvm/src/io/ktor/features/CallId.kt
4 | license: Apache 2.0
5 | category: Monitoring
6 | prerequisites:
7 | - call-logging
8 | installation:
9 | default: install.kt
10 | call_logging_config: call_logging.kt
11 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/callid/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,3.0)": ktor-server-call-id:==
2 | "[3.0,)": ktor-server-call-id:==
3 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/compression/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.plugins.compression.*
3 | import io.ktor.server.response.*
4 |
5 | public fun Application.configureHTTP() {
6 | install(Compression)
7 | }
8 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/compression/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Compression
2 | description: Compresses responses using encoding algorithms like GZIP
3 | vcsLink: https://github.com/ktorio/ktor/blob/4517e3856a3cae8f157d2f6966635217827d2abd/ktor-server/ktor-server-core/jvm/src/io/ktor/features/Compression.kt
4 | license: Apache 2.0
5 | category: HTTP
6 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/compression/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": ktor-server-compression:==
2 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/conditional-headers/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.plugins.conditionalheaders.*
3 | import io.ktor.server.response.*
4 |
5 | public fun Application.configureHTTP() {
6 | install(ConditionalHeaders)
7 | }
8 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/conditional-headers/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Conditional Headers
2 | description: Skips response body, depending on ETag and LastModified headers
3 | vcsLink: https://github.com/ktorio/ktor/blob/4517e3856a3cae8f157d2f6966635217827d2abd/ktor-server/ktor-server-core/jvm/src/io/ktor/features/ConditionalHeaders.kt
4 | license: Apache 2.0
5 | category: HTTP
6 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/conditional-headers/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": ktor-server-conditional-headers:==
2 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/content-negotiation/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Content Negotiation
2 | description: Provides automatic content conversion according to Content-Type and Accept headers
3 | vcsLink: https://github.com/ktorio/ktor/blob/4517e3856a3cae8f157d2f6966635217827d2abd/ktor-server/ktor-server-core/jvm/src/io/ktor/features/ContentNegotiation.kt
4 | license: Apache 2.0
5 | category: Serialization
6 | prerequisites:
7 | - routing
8 | installation: {}
--------------------------------------------------------------------------------
/plugins/server/io.ktor/content-negotiation/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": ktor-server-content-negotiation:==
2 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/cors/2.0/documentation.md:
--------------------------------------------------------------------------------
1 |
2 | If your server supposes to handle cross-origin requests, you need to install and configure the [CORS](https://ktor.io/docs/cors.html) Ktor plugin. This plugin allows you to configure allowed hosts, HTTP methods, headers set by the client, and so on.
3 |
4 | ## Usage
5 |
6 | Typical CORS configuration might look as follows:
7 | ```kotlin
8 | install(CORS) {
9 | allowHost("0.0.0.0:5000")
10 | allowHeader(HttpHeaders.ContentType)
11 | }
12 | ```
13 | To learn more, see [CORS](https://ktor.io/docs/cors.html).
14 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/cors/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.http.*
2 | import io.ktor.server.application.*
3 | import io.ktor.server.plugins.cors.routing.*
4 | import io.ktor.server.response.*
5 |
6 | public fun Application.configureHTTP() {
7 | install(CORS) {
8 | allowMethod(HttpMethod.Options)
9 | allowMethod(HttpMethod.Put)
10 | allowMethod(HttpMethod.Delete)
11 | allowMethod(HttpMethod.Patch)
12 | allowHeader(HttpHeaders.Authorization)
13 | allowHeader("MyCustomHeader")
14 | anyHost() // @TODO: Don't do this in production if possible. Try to limit it.
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/cors/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: CORS
2 | description: Enables Cross-Origin Resource Sharing (CORS)
3 | vcsLink: https://github.com/ktorio/ktor/blob/31dedb3bdaeb1e5f63ba0bfd566e63742ea7a209/ktor-server/ktor-server-core/jvm/src/io/ktor/features/CORS.kt
4 | license: Apache 2.0
5 | category: HTTP
6 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/cors/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": ktor-server-cors:==
2 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/csrf/3.0.0/documentation.md:
--------------------------------------------------------------------------------
1 | This plugin provides mitigations for cross-site request forgery (CSRF).
2 |
3 | There are several ways to prevent CSRF attacks, each with different pros / cons depending on how
4 | your website is structured. The [OWASP cheatsheet](https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html)
5 | enumerates the mitigations provided here.
6 |
7 | ## Usage
8 |
9 | ```kotlin
10 | install(CSRF) {
11 | // tests Origin is an expected value
12 | allowOrigin("http://localhost:8080")
13 |
14 | // tests Origin matches Host header
15 | originMatchesHost()
16 |
17 | // custom header checks
18 | checkHeader("X-CSRF-Token")
19 | }
20 | ```
--------------------------------------------------------------------------------
/plugins/server/io.ktor/csrf/3.0.0/install.kt:
--------------------------------------------------------------------------------
1 | package io.ktor.csrf
2 |
3 | import io.ktor.server.application.*
4 | import io.ktor.server.plugins.csrf.*
5 |
6 | public fun Application.install() {
7 | install(CSRF) {
8 | // tests Origin is an expected value
9 | allowOrigin("http://localhost:8080")
10 |
11 | // tests Origin matches Host header
12 | originMatchesHost()
13 |
14 | // custom header checks
15 | checkHeader("X-CSRF-Token")
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/csrf/3.0.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: CSRF
2 | description: Cross-site request forgery mitigation
3 | vcsLink: https://github.com/ktorio/ktor/blob/main/ktor-server/ktor-server-plugins/ktor-server-csrf/jvmAndNix/src/io/ktor/server/plugins/csrf/CSRF.kt
4 | license: Apache 2.0
5 | category: Security
6 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/csrf/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[3.0.0,)": ktor-server-csrf:==
2 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/default-headers/2.0/documentation.md:
--------------------------------------------------------------------------------
1 |
2 | The [DefaultHeaders](https://ktor.io/docs/default-headers.html) plugin adds the standard `Server` and `Date` headers into each response. Moreover, you can provide additional default headers and override the `Server` header.
3 |
4 | ## Usage
5 |
6 | You can install `DefaultHeaders` as follows:
7 | ```kotlin
8 | install(DefaultHeaders)
9 | ```
10 | To learn how to add additional headers or override the `Server` header, see [DefaultHeaders](https://ktor.io/docs/default-headers.html).
11 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/default-headers/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.plugins.defaultheaders.*
3 | import io.ktor.server.response.*
4 |
5 | public fun Application.configureHTTP() {
6 | install(DefaultHeaders) {
7 | header("X-Engine", "Ktor") // will send this header with each response
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/default-headers/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Default Headers
2 | description: Adds a default set of headers to HTTP responses
3 | vcsLink: https://github.com/ktorio/ktor/blob/962677f73f0900cae32e90519fa1e850dd0acfa8/ktor-server/ktor-server-core/jvm/src/io/ktor/features/DefaultHeaders.kt
4 | license: Apache 2.0
5 | category: HTTP
6 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/default-headers/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": ktor-server-default-headers:==
2 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/double-receive/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.plugins.doublereceive.*
3 | import io.ktor.server.request.*
4 | import io.ktor.server.response.*
5 |
6 | public fun Application.configureRouting() {
7 | install(DoubleReceive)
8 | }
9 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/double-receive/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: DoubleReceive
2 | description: Allows ApplicationCall.receive several times
3 | vcsLink: https://github.com/ktorio/ktor/blob/962677f73f0900cae32e90519fa1e850dd0acfa8/ktor-server/ktor-server-core/jvm/src/io/ktor/features/DoubleReceive.kt
4 | license: Apache 2.0
5 | category: Routing
6 | prerequisites:
7 | - routing
8 | installation:
9 | default: install.kt
10 | in_routing: routing.kt
11 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/double-receive/2.0/routing.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.plugins.doublereceive.*
3 | import io.ktor.server.request.*
4 | import io.ktor.server.response.*
5 | import io.ktor.server.routing.*
6 |
7 | public fun Routing.configureRouting() {
8 | post("/double-receive") {
9 | val first = call.receiveText()
10 | val theSame = call.receiveText()
11 | call.respondText(first + " " + theSame)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/double-receive/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": ktor-server-double-receive:==
2 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/forwarded-header-support/2.0/documentation.md:
--------------------------------------------------------------------------------
1 |
2 | The [ForwardedHeaders](https://ktor.io/docs/forward-headers.html) plugin allows you to handle reverse proxy headers to get information about the original request when it's behind a proxy.
3 | * `ForwardedHeaders` handles the standard `Forwarded` header.
4 | * `XForwardedHeaders` handles `X-Forwarded-Host`/`X-Forwarded-Server`, `X-Forwarded-For`, `X-Forwarded-By`, `X-Forwarded-Proto`/`X-Forwarded-Protocol`, and `X-Forwarded-SSL`/ `Front-End-Https`.
5 |
6 | ## Usage
7 |
8 | You can install `ForwardedHeaders` as follows:
9 | ```kotlin
10 | install(ForwardedHeaders)
11 | ```
12 | To learn how to get information about the original request, see [ForwardedHeaders](https://ktor.io/docs/forward-headers.html).
13 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/forwarded-header-support/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.plugins.forwardedheaders.*
3 | import io.ktor.server.response.*
4 |
5 | public fun Application.configureHTTP() {
6 | install(ForwardedHeaders) // WARNING: for security, do not include this if not behind a reverse proxy
7 | install(XForwardedHeaders) // WARNING: for security, do not include this if not behind a reverse proxy
8 | }
9 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/forwarded-header-support/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Forwarded Headers
2 | description: Allows handling proxied headers (X-Forwarded-*)
3 | vcsLink: https://github.com/ktorio/ktor/blob/4517e3856a3cae8f157d2f6966635217827d2abd/ktor-server/ktor-server-core/jvm/src/io/ktor/features/OriginConnectionPoint.kt
4 | license: Apache 2.0
5 | category: HTTP
6 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/forwarded-header-support/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": ktor-server-forwarded-header:==
2 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/freemarker/2.0/documentation.md:
--------------------------------------------------------------------------------
1 |
2 | Ktor allows you to use FreeMarker templates as views within your application by installing the [Freemarker](https://ktor.io/docs/freemarker.html) plugin.
3 |
4 | ## Usage
5 |
6 | To load templates, you need to assign the desired `TemplateLoader` type to the `templateLoader` property. For example, the code snippet below enables Ktor to look up templates in the `templates` package relative to the current classpath:
7 | ```kotlin
8 | install(FreeMarker) {
9 | templateLoader = ClassTemplateLoader(this::class.java.classLoader, "templates")
10 | }
11 | ```
12 | To learn more, see [Freemarker](https://ktor.io/docs/freemarker.html).
13 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/freemarker/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import freemarker.cache.*
2 | import io.ktor.server.application.*
3 | import io.ktor.server.freemarker.*
4 | import io.ktor.server.response.*
5 |
6 | public fun Application.configureTemplating() {
7 | install(FreeMarker) {
8 | templateLoader = ClassTemplateLoader(this::class.java.classLoader, "templates")
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/freemarker/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Freemarker
2 | description: Serves HTML content using Apache's FreeMarker template engine
3 | vcsLink: https://github.com/ktorio/ktor/blob/4a50c76c3264b0121b91a203d38473bb4aafbace/ktor-features/ktor-freemarker/jvm/src/io/ktor/freemarker/FreeMarker.kt
4 | license: Apache 2.0
5 | category: Templating
6 | prerequisites:
7 | - routing
8 | installation:
9 | default: install.kt
10 | resources: templates/index.ftl
11 | in_routing: routing.kt
12 | outside_app: outside_app.kt
13 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/freemarker/2.0/outside_app.kt:
--------------------------------------------------------------------------------
1 | import freemarker.cache.*
2 | import io.ktor.server.application.*
3 | import io.ktor.server.freemarker.*
4 | import io.ktor.server.response.*
5 |
6 | data class IndexData(val items: List)
7 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/freemarker/2.0/routing.kt:
--------------------------------------------------------------------------------
1 | import freemarker.cache.*
2 | import io.ktor.server.application.*
3 | import io.ktor.server.freemarker.*
4 | import io.ktor.server.response.*
5 | import io.ktor.server.routing.*
6 |
7 | public fun Routing.configureRouting() {
8 | get("/html-freemarker") {
9 | call.respond(FreeMarkerContent("index.ftl", mapOf("data" to IndexData(listOf(1, 2, 3))), ""))
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/freemarker/2.0/templates/index.ftl:
--------------------------------------------------------------------------------
1 |
2 |
3 | Items:
4 | <#list data.items as item>
5 | The item at index ${item?index} is ${item}
6 | #list>
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/freemarker/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": ktor-server-freemarker:==
2 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/group.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: JetBrains
2 | url: https://ktor.io/
3 | email: ktor@jetbrains.com
4 | logo: icon.svg
--------------------------------------------------------------------------------
/plugins/server/io.ktor/hsts/2.0/documentation.md:
--------------------------------------------------------------------------------
1 |
2 | The [HSTS](https://ktor.io/docs/hsts.html) plugin adds the required _HTTP Strict Transport Security_ headers to a request. When the browser receives HSTS policy headers, it will no longer attempt to connect to the server with insecure connections for the given period of time.
3 |
4 | ## Usage
5 |
6 | To install `HSTS`, pass it to the `install` function:
7 | ```kotlin
8 | install(HSTS)
9 | ```
10 | ## Options
11 |
12 | * `maxAge` (default is one year): duration to tell the client to keep the host in a list of known HSTS hosts.
13 | * `includeSubDomains` (default is `true`): adds `includeSubDomains` directive, which applies this policy to this domain and any subdomains.
14 | * `preload` (default is `false`): consents that the policy allows including the domain into the web browser's preloading list.
15 | * `customDirectives` (default is empty): any custom directives supported by a specific user-agent.
16 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/hsts/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.plugins.hsts.*
3 | import io.ktor.server.response.*
4 |
5 | public fun Application.configureHTTP() {
6 | install(HSTS) {
7 | includeSubDomains = true
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/hsts/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: HSTS
2 | description: Enables HTTP Strict Transport Security (HSTS)
3 | vcsLink: https://github.com/ktorio/ktor/blob/7e78e715cec3ff039cd628f8ff8ce875c35cde4c/ktor-server/ktor-server-core/jvm/src/io/ktor/features/HSTS.kt
4 | license: Apache 2.0
5 | category: HTTP
6 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/hsts/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": ktor-server-hsts:==
2 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/https-redirect/2.0/documentation.md:
--------------------------------------------------------------------------------
1 |
2 | The [HttpsRedirect](https://ktor.io/docs/https-redirect.html) plugin makes all affected HTTP calls perform a redirect to their HTTPS counterpart before processing the call. By default, the redirection is a `301 Moved Permanently`, but it can be configured to be a `302 Found` redirect.
3 |
4 | ## Usage
5 |
6 | Typical `HttpsRedirect` configuration might look as follows:
7 | ```kotlin
8 | install(HttpsRedirect) {
9 | sslPort = 443
10 | permanentRedirect = true
11 | }
12 | ```
13 | To learn more, see [HttpsRedirect](https://ktor.io/docs/https-redirect.html).
14 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/https-redirect/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.plugins.httpsredirect.*
3 | import io.ktor.server.response.*
4 |
5 | public fun Application.configureHTTP() {
6 | install(HttpsRedirect) {
7 | // The port to redirect to. By default 443, the default HTTPS port.
8 | sslPort = 443
9 | // 301 Moved Permanently, or 302 Found redirect.
10 | permanentRedirect = true
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/https-redirect/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: HttpsRedirect
2 | description: Redirects insecure HTTP requests to the respective HTTPS endpoint
3 | vcsLink: https://github.com/ktorio/ktor/blob/7e78e715cec3ff039cd628f8ff8ce875c35cde4c/ktor-server/ktor-server-core/jvm/src/io/ktor/features/HttpsRedirect.kt
4 | license: Apache 2.0
5 | category: HTTP
6 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/https-redirect/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": ktor-server-http-redirect:==
2 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/icon.svg:
--------------------------------------------------------------------------------
1 |
10 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/kotlinx-serialization/2.0/content_negotiation.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.serialization.kotlinx.json.*
2 | import io.ktor.server.plugins.contentnegotiation.*
3 | import io.ktor.server.response.*
4 |
5 | public fun ContentNegotiationConfig.configureContentNegotiation() {
6 | json()
7 | }
8 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/kotlinx-serialization/2.0/routing.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.serialization.kotlinx.json.*
2 | import io.ktor.server.application.*
3 | import io.ktor.server.plugins.contentnegotiation.*
4 | import io.ktor.server.response.*
5 | import io.ktor.server.routing.*
6 |
7 | public fun Routing.configureRouting() {
8 | get("/json/kotlinx-serialization") {
9 | call.respond(mapOf("hello" to "world"))
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/kotlinx-serialization/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": ktor-serialization-kotlinx-json:==
2 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/ktor-gson/2.0/content_negotiation.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.serialization.gson.*
2 | import io.ktor.server.plugins.contentnegotiation.*
3 | import io.ktor.server.response.*
4 |
5 | public fun ContentNegotiationConfig.configureContentNegotiation() {
6 | gson {
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/ktor-gson/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: GSON
2 | description: Handles JSON serialization using GSON library
3 | vcsLink: https://github.com/ktorio/ktor/blob/192286740d912cc4767cbbf43d3951ba86eb7a41/ktor-features/ktor-gson/jvm/src/io/ktor/gson/GsonSupport.kt
4 | license: Apache 2.0
5 | category: Serialization
6 | prerequisites:
7 | - content-negotiation
8 | installation:
9 | in_routing: routing.kt
10 | serialization_config: content_negotiation.kt
11 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/ktor-gson/2.0/routing.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.serialization.gson.*
2 | import io.ktor.server.application.*
3 | import io.ktor.server.plugins.contentnegotiation.*
4 | import io.ktor.server.response.*
5 | import io.ktor.server.routing.*
6 |
7 | public fun Routing.configureRouting() {
8 | get("/json/gson") {
9 | call.respond(mapOf("hello" to "world"))
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/ktor-gson/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": ktor-serialization-gson:==
2 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/ktor-jackson/2.0/content_negotiation.kt:
--------------------------------------------------------------------------------
1 | import com.fasterxml.jackson.databind.*
2 | import io.ktor.serialization.jackson.*
3 | import io.ktor.server.plugins.contentnegotiation.*
4 | import io.ktor.server.response.*
5 |
6 | public fun ContentNegotiationConfig.configureContentNegotiation() {
7 | jackson {
8 | enable(SerializationFeature.INDENT_OUTPUT)
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/ktor-jackson/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Jackson
2 | description: Handles JSON serialization using Jackson library
3 | vcsLink: https://github.com/ktorio/ktor/blob/e03bafda3b3d72fcac166e46cf55e5d2d9383660/ktor-client/ktor-client-features/ktor-client-json/ktor-client-jackson/jvm/src/io/ktor/client/features/json/JacksonSerializer.kt
4 | license: Apache 2.0
5 | category: Serialization
6 | prerequisites:
7 | - content-negotiation
8 | installation:
9 | in_routing: routing.kt
10 | serialization_config: content_negotiation.kt
11 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/ktor-jackson/2.0/routing.kt:
--------------------------------------------------------------------------------
1 | import com.fasterxml.jackson.databind.*
2 | import io.ktor.serialization.jackson.*
3 | import io.ktor.server.application.*
4 | import io.ktor.server.plugins.contentnegotiation.*
5 | import io.ktor.server.response.*
6 | import io.ktor.server.routing.*
7 |
8 | public fun Routing.configureRouting() {
9 | get("/json/jackson") {
10 | call.respond(mapOf("hello" to "world"))
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/ktor-jackson/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": ktor-serialization-jackson:==
2 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/ktor-network-tls/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.network.selector.*
2 | import io.ktor.network.sockets.*
3 | import io.ktor.network.tls.*
4 | import io.ktor.server.application.*
5 | import io.ktor.server.response.*
6 | import io.ktor.utils.io.*
7 | import io.ktor.utils.io.core.*
8 | import kotlinx.coroutines.Dispatchers
9 | import kotlinx.coroutines.runBlocking
10 |
11 | public fun Application.configureSockets() {
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/ktor-network-tls/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Raw Secure SSL/TLS Sockets
2 | description: Adds secure socket support for TCP and UDP
3 | vcsLink: https://github.com/ktorio/ktor/tree/465b7573fba8ef2293b1d8866b3842504418d6f1/ktor-network/ktor-network-tls/jvm/src/io/ktor/network/tls
4 | license: Apache 2.0
5 | category: Sockets
6 | prerequisites:
7 | - ktor-network
8 | installation:
9 | default: install.kt
10 | outside_app: outside_app.kt
11 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/ktor-network-tls/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": ktor-network-tls:==
2 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/ktor-network/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.network.selector.*
2 | import io.ktor.network.sockets.*
3 | import io.ktor.server.application.*
4 | import io.ktor.server.response.*
5 | import io.ktor.utils.io.*
6 | import java.io.InputStream
7 | import java.util.*
8 | import kotlinx.coroutines.Dispatchers
9 | import kotlinx.coroutines.launch
10 | import kotlinx.coroutines.runBlocking
11 |
12 | public fun Application.configureSockets() {
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/ktor-network/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Raw Sockets
2 | description: Adds raw socket support for TCP and UDP
3 | vcsLink: https://github.com/ktorio/ktor/tree/d05996269def3ae106eb9779ac85ee448da609de/ktor-network/common/src/io/ktor/network/sockets
4 | license: Apache 2.0
5 | category: Sockets
6 | installation:
7 | default: install.kt
8 | outside_app: outside_app.kt
9 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/ktor-network/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": []
2 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/ktor-sessions/2.0/MySession.kt:
--------------------------------------------------------------------------------
1 | import kotlinx.serialization.Serializable
2 |
3 | @Serializable
4 | data class MySession(val count: Int = 0)
--------------------------------------------------------------------------------
/plugins/server/io.ktor/ktor-sessions/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.sessions.*
3 |
4 | public fun Application.configureSecurity() {
5 | install(Sessions) {
6 | cookie("MY_SESSION") {
7 | cookie.extensions["SameSite"] = "lax"
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/ktor-sessions/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Sessions
2 | description: Adds support for persistent sessions through cookies or headers
3 | vcsLink: https://github.com/ktorio/ktor/blob/8c5ed12666b535d88277f5307b3eb286151b18af/ktor-server/ktor-server-core/jvm/src/io/ktor/sessions/Sessions.kt
4 | license: Apache 2.0
5 | category: Security
6 | prerequisites:
7 | - kotlinx-serialization
8 | installation:
9 | default: install.kt
10 | in_routing: routing.kt
11 | outside_app: MySession.kt
12 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/ktor-sessions/2.0/routing.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.response.*
2 | import io.ktor.server.routing.*
3 | import io.ktor.server.sessions.*
4 |
5 | public fun Routing.configureRouting() {
6 | get("/session/increment") {
7 | val session = call.sessions.get() ?: MySession()
8 | call.sessions.set(session.copy(count = session.count + 1))
9 | call.respondText("Counter is ${session.count}. Refresh to increment.")
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/ktor-sessions/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": ktor-server-sessions:==
2 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/ktor-websockets/2.0,3.0/documentation.md:
--------------------------------------------------------------------------------
1 |
2 | Ktor supports the [WebSocket](https://ktor.io/docs/websocket.html) protocol and allows you to create applications that require real-time data transfer from and to the server. For example, WebSockets can be used to create a chat application.
3 |
4 | ## Usage
5 |
6 | To install `WebSockets`, pass it to the `install` function:
7 |
8 | ```kotlin
9 | install(WebSockets)
10 | ```
11 |
12 | Optionally, you can configure various `WebSockets` options:
13 |
14 | ```kotlin
15 | install(WebSockets) {
16 | pingPeriod = Duration.ofSeconds(15)
17 | timeout = Duration.ofSeconds(15)
18 | maxFrameSize = Long.MAX_VALUE
19 | masking = false
20 | }
21 | ```
22 |
23 | To learn how to handle WebSockets sessions, see [WebSocket](https://ktor.io/docs/websocket.html).
24 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/ktor-websockets/2.0,3.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.response.*
3 | import io.ktor.server.websocket.*
4 | import io.ktor.websocket.*
5 | import java.time.Duration
6 |
7 | public fun Application.configureSockets() {
8 | install(WebSockets) {
9 | pingPeriod = Duration.ofSeconds(15)
10 | timeout = Duration.ofSeconds(15)
11 | maxFrameSize = Long.MAX_VALUE
12 | masking = false
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/ktor-websockets/2.0,3.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: WebSockets
2 | description: Adds WebSocket protocol support for bidirectional client connections
3 | vcsLink: https://github.com/ktorio/ktor/blob/4a50c76c3264b0121b91a203d38473bb4aafbace/ktor-features/ktor-websockets/jvm/src/io/ktor/websocket/WebSockets.kt
4 | license: Apache 2.0
5 | category: Sockets
6 | prerequisites:
7 | - routing
8 | installation:
9 | default: install.kt
10 | in_routing: routing.kt
11 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/ktor-websockets/2.0,3.0/routing.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.response.*
3 | import io.ktor.server.routing.*
4 | import io.ktor.server.websocket.*
5 | import io.ktor.websocket.*
6 | import java.time.Duration
7 |
8 | public fun Routing.configureRouting() {
9 | webSocket("/ws") { // websocketSession
10 | for (frame in incoming) {
11 | if (frame is Frame.Text) {
12 | val text = frame.readText()
13 | outgoing.send(Frame.Text("YOU SAID: $text"))
14 | if (text.equals("bye", ignoreCase = true)) {
15 | close(CloseReason(CloseReason.Codes.NORMAL, "Client said BYE"))
16 | }
17 | }
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/ktor-websockets/3.0/documentation.md:
--------------------------------------------------------------------------------
1 |
2 | Ktor supports the [WebSocket](https://ktor.io/docs/websocket.html) protocol and allows you to create applications that require real-time data transfer from and to the server. For example, WebSockets can be used to create a chat application.
3 |
4 | ## Usage
5 |
6 | To install `WebSockets`, pass it to the `install` function:
7 |
8 | ```kotlin
9 | install(WebSockets)
10 | ```
11 |
12 | Optionally, you can configure various `WebSockets` options:
13 |
14 | ```kotlin
15 | install(WebSockets) {
16 | pingPeriod = Duration.ofSeconds(15)
17 | timeout = Duration.ofSeconds(15)
18 | maxFrameSize = Long.MAX_VALUE
19 | masking = false
20 | }
21 | ```
22 |
23 | To learn how to handle WebSockets sessions, see [WebSocket](https://ktor.io/docs/websocket.html).
24 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/ktor-websockets/3.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.response.*
3 | import io.ktor.server.websocket.*
4 | import io.ktor.websocket.*
5 | import kotlin.time.Duration.Companion.seconds
6 |
7 | public fun Application.configureSockets() {
8 | install(WebSockets) {
9 | pingPeriod = 15.seconds
10 | timeout = 15.seconds
11 | maxFrameSize = Long.MAX_VALUE
12 | masking = false
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/ktor-websockets/3.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: WebSockets
2 | description: Adds WebSocket protocol support for bidirectional client connections
3 | vcsLink: https://github.com/ktorio/ktor/blob/3.0.0/ktor-server/ktor-server-plugins/ktor-server-websockets/common/src/io/ktor/server/websocket/WebSockets.kt
4 | license: Apache 2.0
5 | category: Sockets
6 | prerequisites:
7 | - routing
8 | installation:
9 | default: install.kt
10 | in_routing: routing.kt
11 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/ktor-websockets/3.0/routing.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.response.*
3 | import io.ktor.server.routing.*
4 | import io.ktor.server.websocket.*
5 | import io.ktor.websocket.*
6 | import java.time.Duration
7 |
8 | public fun Routing.configureRouting() {
9 | webSocket("/ws") { // websocketSession
10 | for (frame in incoming) {
11 | if (frame is Frame.Text) {
12 | val text = frame.readText()
13 | outgoing.send(Frame.Text("YOU SAID: $text"))
14 | if (text.equals("bye", ignoreCase = true)) {
15 | close(CloseReason(CloseReason.Codes.NORMAL, "Client said BYE"))
16 | }
17 | }
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/ktor-websockets/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,3.0)": ktor-server-websockets:==
2 | "[3.0,)": ktor-server-websockets:==
3 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/metrics-micrometer/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.metrics.micrometer.*
3 | import io.ktor.server.response.*
4 | import io.micrometer.prometheus.*
5 |
6 | public fun Application.configureMonitoring() {
7 | val appMicrometerRegistry = PrometheusMeterRegistry(PrometheusConfig.DEFAULT)
8 |
9 | install(MicrometerMetrics) {
10 | registry = appMicrometerRegistry
11 | // ...
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/metrics-micrometer/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Micrometer Metrics
2 | description: Enables Micrometer metrics in your Ktor server application.
3 | vcsLink: https://github.com/ktorio/ktor/blob/4a50c76c3264b0121b91a203d38473bb4aafbace/ktor-features/ktor-metrics-micrometer/jvm/src/io/ktor/metrics/micrometer/MicrometerMetrics.kt
4 | license: Apache 2.0
5 | category: Monitoring
6 | prerequisites:
7 | - routing
8 | installation:
9 | default: install.kt
10 | in_routing: routing.kt
11 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/metrics-micrometer/2.0/routing.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.metrics.micrometer.*
3 | import io.ktor.server.response.*
4 | import io.ktor.server.routing.*
5 | import io.micrometer.prometheus.*
6 |
7 | public fun Routing.configureRouting(appMicrometerRegistry: PrometheusMeterRegistry) {
8 | get("/metrics-micrometer") {
9 | call.respond(appMicrometerRegistry.scrape())
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/metrics-micrometer/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)":
2 | - io.ktor:ktor-server-metrics-micrometer:==
3 | - io.micrometer:micrometer-registry-prometheus:$prometheus
4 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/metrics/2.0/documentation.md:
--------------------------------------------------------------------------------
1 |
2 | The [Metrics](https://ktor.io/docs/dropwizard-metrics.html) plugin allows you to configure the Metrics to get useful information about the server and incoming requests.
3 |
4 | ## Usage
5 |
6 | The example below shows how to use the SLF4J Reporter to periodically emit reports to any output supported by SLF4J. For example, to output the metrics every 10 seconds, you would:
7 | ```kotlin
8 | install(DropwizardMetrics) {
9 | Slf4jReporter.forRegistry(registry)
10 | .outputTo(log)
11 | .convertRatesTo(TimeUnit.SECONDS)
12 | .convertDurationsTo(TimeUnit.MILLISECONDS)
13 | .build()
14 | .start(10, TimeUnit.SECONDS)
15 | }
16 | ```
17 | To learn more, see the [Dropwizard metrics](https://ktor.io/docs/dropwizard-metrics.html) topic.
18 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/metrics/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import com.codahale.metrics.*
2 | import io.ktor.server.application.*
3 | import io.ktor.server.metrics.dropwizard.*
4 | import io.ktor.server.response.*
5 | import java.util.concurrent.TimeUnit
6 |
7 | public fun Application.configureMonitoring() {
8 | install(DropwizardMetrics) {
9 | Slf4jReporter.forRegistry(registry)
10 | .outputTo(this@configureMonitoring.log)
11 | .convertRatesTo(TimeUnit.SECONDS)
12 | .convertDurationsTo(TimeUnit.MILLISECONDS)
13 | .build()
14 | .start(10, TimeUnit.SECONDS)
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/metrics/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Metrics
2 | description: Adds supports for monitoring several metrics
3 | vcsLink: https://github.com/ktorio/ktor/tree/4a50c76c3264b0121b91a203d38473bb4aafbace/ktor-features/ktor-metrics/jvm/src/io/ktor/metrics
4 | license: Apache 2.0
5 | category: Monitoring
6 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/metrics/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": ktor-server-metrics:==
2 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/mustache/2.0/documentation.md:
--------------------------------------------------------------------------------
1 |
2 | Ktor allows you to use Mustache templates as views within your application by installing the [Mustache](https://ktor.io/docs/mustache.html) plugin.
3 |
4 | ## Usage
5 |
6 | To load templates, you need to assign the `MustacheFactory` to the `mustacheFactory` property. For example, the code snippet below enables Ktor to look up templates in the `templates` package relative to the current classpath:
7 | ```kotlin
8 | install(Mustache) {
9 | mustacheFactory = DefaultMustacheFactory("templates")
10 | }
11 | ```
12 | To learn more, see [Mustache](https://ktor.io/docs/mustache.html).
13 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/mustache/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import com.github.mustachejava.DefaultMustacheFactory
2 | import io.ktor.server.application.*
3 | import io.ktor.server.mustache.Mustache
4 | import io.ktor.server.mustache.MustacheContent
5 | import io.ktor.server.response.*
6 |
7 | public fun Application.configureTemplating() {
8 | install(Mustache) {
9 | mustacheFactory = DefaultMustacheFactory("templates/mustache")
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/mustache/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Mustache
2 | description: Serves HTML content using Mustache template engine
3 | vcsLink: https://github.com/ktorio/ktor/blob/4a50c76c3264b0121b91a203d38473bb4aafbace/ktor-features/ktor-mustache/jvm/src/io/ktor/mustache/Mustache.kt
4 | license: Apache 2.0
5 | category: Templating
6 | prerequisites:
7 | - routing
8 | installation:
9 | default: install.kt
10 | in_routing: routing.kt
11 | outside_app: outside_app.kt
12 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/mustache/2.0/outside_app.kt:
--------------------------------------------------------------------------------
1 | import com.github.mustachejava.DefaultMustacheFactory
2 | import io.ktor.server.application.*
3 | import io.ktor.server.mustache.Mustache
4 | import io.ktor.server.mustache.MustacheContent
5 | import io.ktor.server.response.*
6 |
7 | data class MustacheUser(val id: Int, val name: String)
8 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/mustache/2.0/routing.kt:
--------------------------------------------------------------------------------
1 | import com.github.mustachejava.DefaultMustacheFactory
2 | import io.ktor.server.application.*
3 | import io.ktor.server.mustache.Mustache
4 | import io.ktor.server.mustache.MustacheContent
5 | import io.ktor.server.response.*
6 | import io.ktor.server.routing.*
7 |
8 | public fun Routing.configureRouting() {
9 | get("/html-mustache") {
10 | call.respond(MustacheContent("index.hbs", mapOf("user" to MustacheUser(1, "user1"))))
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/mustache/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": ktor-server-mustache:==
2 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/openapi/2.2/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.plugins.openapi.*
3 | import io.ktor.server.response.*
4 | import io.ktor.server.routing.*
5 |
6 | public fun Application.configureHTTP() {
7 | routing {
8 | openAPI(path = "openapi")
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/openapi/2.2/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: OpenAPI
2 | description: Serves OpenAPI documentation
3 | vcsLink: https://github.com/ktorio/ktor/blob/main/ktor-server/ktor-server-plugins/ktor-server-openapi/jvm/src/io/ktor/server/plugins/openapi/OpenAPI.kt
4 | license: Apache 2.0
5 | category: HTTP
6 | prerequisites:
7 | - routing
8 | installation:
9 | default: install.kt
10 | resources: openapi/documentation.yaml
--------------------------------------------------------------------------------
/plugins/server/io.ktor/openapi/2.2/openapi/documentation.yaml:
--------------------------------------------------------------------------------
1 | openapi: "3.0.3"
2 | info:
3 | title: "Application API"
4 | description: "Application API"
5 | version: "1.0.0"
6 | servers:
7 | - url: "http://0.0.0.0:8080"
8 | paths:
9 | /:
10 | get:
11 | description: "Hello World!"
12 | responses:
13 | "200":
14 | description: "OK"
15 | content:
16 | text/plain:
17 | schema:
18 | type: "string"
19 | examples:
20 | Example#1:
21 | value: "Hello World!"
22 | components:
23 | schemas: {}
--------------------------------------------------------------------------------
/plugins/server/io.ktor/openapi/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.2,)": ktor-server-openapi:==
2 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/partial-content/2.0/documentation.md:
--------------------------------------------------------------------------------
1 |
2 | The [PartialContent](https://ktor.io/docs/partial-content.html) plugin adds support for handling requests with the `Range` header. It intercepts the generated response adding the `Accept-Ranges` and the `Content-Range` header and slicing the served content when required. `PartialContent` is well-suited for streaming content or resuming partial downloads with download managers or in unreliable networks.
3 |
4 | ## Usage
5 |
6 | The configuration below allows you to specify the maximum number of ranges that will be accepted from an HTTP request. If an HTTP request specifies more ranges, they will be merged into a single range.
7 | ```kotlin
8 | install(PartialContent) {
9 | maxRangeCount = 10
10 | }
11 | ```
12 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/partial-content/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.plugins.partialcontent.*
3 | import io.ktor.server.response.*
4 |
5 | public fun Application.configureHTTP() {
6 | install(PartialContent) {
7 | // Maximum number of ranges that will be accepted from a HTTP request.
8 | // If the HTTP request specifies more ranges, they will all be merged into a single range.
9 | maxRangeCount = 10
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/partial-content/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Partial Content
2 | description: Handles requests with the Range header
3 | vcsLink: https://github.com/ktorio/ktor/blob/4517e3856a3cae8f157d2f6966635217827d2abd/ktor-server/ktor-server-core/jvm/src/io/ktor/features/PartialContent.kt
4 | license: Apache 2.0
5 | category: HTTP
6 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/partial-content/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": ktor-server-partial-content:==
2 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/pebble/2.3/documentation.md:
--------------------------------------------------------------------------------
1 |
2 | Ktor allows you to use Pebble templates as views within your application by installing the [Pebble](https://ktor.io/docs/pebble.html) plugin.
3 |
4 | ## Usage
5 |
6 | To load templates, you need to configure how to load templates using `PebbleEngine.Builder`. For example, the code snippet below enables Ktor to look up templates in the `templates` package relative to the current classpath:
7 | ```kotlin
8 | install(Pebble) {
9 | loader(ClasspathLoader().apply {
10 | prefix = "templates"
11 | })
12 | }
13 | ```
14 |
15 | To learn more, see [Pebble](https://ktor.io/docs/pebble.html).
16 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/pebble/2.3/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.pebble.*
3 | import io.ktor.server.response.*
4 | import io.pebbletemplates.pebble.loader.ClasspathLoader
5 |
6 | public fun Application.configureTemplating() {
7 | install(Pebble) {
8 | loader(ClasspathLoader().apply {
9 | prefix = "templates"
10 | })
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/pebble/2.3/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Pebble
2 | description: Allows you to use Pebble templates as views within your application
3 | vcsLink: https://github.com/ktorio/ktor/blob/7e78e715cec3ff039cd628f8ff8ce875c35cde4c/ktor-features/ktor-pebble/jvm/src/io/ktor/pebble/Pebble.kt
4 | license: Apache 2.0
5 | category: Templating
6 | prerequisites:
7 | - routing
8 | installation:
9 | default: install.kt
10 | resources: templates/pebble-index.html
11 | outside_app: outside_app.kt
12 | in_routing: routing.kt
13 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/pebble/2.3/outside_app.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.pebble.*
3 | import io.ktor.server.response.*
4 | import io.pebbletemplates.pebble.loader.ClasspathLoader
5 |
6 | data class PebbleUser(val id: Int, val name: String)
7 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/pebble/2.3/routing.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.pebble.*
3 | import io.ktor.server.response.*
4 | import io.ktor.server.routing.*
5 | import io.pebbletemplates.pebble.loader.ClasspathLoader
6 |
7 | public fun Routing.configureRouting() {
8 | get("/pebble-index") {
9 | val sampleUser = PebbleUser(1, "John")
10 | call.respond(PebbleContent("pebble-index.html", mapOf("user" to sampleUser)))
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/pebble/2.3/templates/pebble-index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Hello, {{user.name}}
4 |
5 |
6 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/pebble/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.3,)": ktor-server-pebble:==
2 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/request-validation/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.plugins.requestvalidation.RequestValidation
3 | import io.ktor.server.plugins.requestvalidation.ValidationResult
4 |
5 | fun Application.install() {
6 | install(RequestValidation) {
7 | validate { bodyText ->
8 | if (!bodyText.startsWith("Hello"))
9 | ValidationResult.Invalid("Body text should start with 'Hello'")
10 | else ValidationResult.Valid
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/request-validation/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Request Validation
2 | description: Adds validation for incoming requests
3 | vcsLink: https://github.com/ktorio/ktor/tree/3.0.0/ktor-server/ktor-server-plugins/ktor-server-request-validation
4 | license: Apache 2.0
5 | category: Routing
6 | installation:
7 | default: install.kt
8 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/request-validation/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": io.ktor:ktor-server-request-validation:==
--------------------------------------------------------------------------------
/plugins/server/io.ktor/resources/2.0/documentation.md:
--------------------------------------------------------------------------------
1 |
2 | Ktor provides a mechanism to create routes in a typed way for both constructing URLs and reading the parameters. This functionality is provided by the [Resources](https://ktor.io/docs/type-safe-routing.html) plugin.
3 |
4 | ## Usage
5 |
6 | You can install the `Resources` plugin in the following way:
7 | ```kotlin
8 | install(Resources)
9 | ```
10 | For each typed route you want to handle, you need to create a class containing the parameters that you want to handle. To accomplish this, you need to annotate this class using the `@Resource` keyword. Such classes should also have the `@Serializable` annotation provided by the kotlinx.serialization library. For example:
11 | ```kotlin
12 | @Serializable
13 | @Resource("/articles")
14 | class Articles(val sort: String? = "new")
15 | ```
16 | To learn more about how to define route classes and route handlers, see the [Type-safe routing](https://ktor.io/docs/type-safe-routing.html) section.
17 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/resources/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.resources.*
2 | import io.ktor.server.application.*
3 | import io.ktor.server.resources.*
4 | import io.ktor.server.resources.Resources
5 | import io.ktor.server.response.*
6 | import kotlinx.serialization.Serializable
7 |
8 | public fun Application.configureRouting() {
9 | install(Resources)
10 | }
11 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/resources/2.0/outside_app.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.resources.*
2 | import io.ktor.server.application.*
3 | import io.ktor.server.resources.*
4 | import io.ktor.server.resources.Resources
5 | import kotlinx.serialization.Serializable
6 |
7 | @Serializable
8 | @Resource("/articles")
9 | class Articles(val sort: String? = "new")
10 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/resources/2.0/routing.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.resources.*
2 | import io.ktor.server.application.*
3 | import io.ktor.server.resources.*
4 | import io.ktor.server.resources.Resources
5 | import io.ktor.server.response.*
6 | import io.ktor.server.routing.*
7 | import kotlinx.serialization.Serializable
8 |
9 | public fun Routing.configureRouting() {
10 | get { article ->
11 | // Get all articles ...
12 | call.respond("List of articles sorted starting from ${article.sort}")
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/resources/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": ktor-server-resources:==
2 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/routing/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Routing
2 | description: Provides a structured routing DSL
3 | vcsLink: https://github.com/ktorio/ktor/blob/4517e3856a3cae8f157d2f6966635217827d2abd/ktor-server/ktor-server-core/jvm/src/io/ktor/routing/Routing.kt
4 | license: Apache 2.0
5 | category: Routing
6 | installation:
7 | in_routing: routing.kt
8 | test_function: test.kt
9 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/routing/2.0/routing.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.response.*
2 | import io.ktor.server.routing.*
3 |
4 | public fun Routing.configureRouting() {
5 | get("/") {
6 | call.respondText("Hello World!")
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/routing/2.0/test.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.client.request.*
2 | import io.ktor.http.*
3 | import io.ktor.server.testing.*
4 | import kotlin.test.Test
5 | import kotlin.test.assertEquals
6 |
7 | class ApplicationTest {
8 | @Test
9 | fun testRoot() = testApplication {
10 | application {
11 | module()
12 | }
13 | client.get("/").apply {
14 | assertEquals(HttpStatusCode.OK, status)
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/routing/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": ktor-server-core:==
2 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/shutdown-url/2.0/documentation.md:
--------------------------------------------------------------------------------
1 |
2 | The [Shutdown URL](https://ktor.io/docs/shutdown-url.html) plugin provides the ability to shut down a server when accessing a specified URL.
3 |
4 | ## Usage
5 |
6 | To specify a shutdown URL in a configuration file, use the `ktor.deployment.shutdown.url` property:
7 |
8 | ```
9 | ktor {
10 | deployment {
11 | shutdown.url = "/my/shutdown/path"
12 | }
13 | }
14 | ```
15 |
16 | Learn more from [Shutdown URL](https://ktor.io/docs/shutdown-url.html).
17 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/shutdown-url/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.engine.*
3 | import io.ktor.server.response.*
4 |
5 | public fun Application.configureAdministration() {
6 | install(ShutDownUrl.ApplicationCallPlugin) {
7 | // The URL that will be intercepted (you can also use the application.conf's ktor.deployment.shutdown.url key)
8 | shutDownUrl = "/ktor/application/shutdown"
9 | // A function that will be executed to get the exit code of the process
10 | exitCodeSupplier = { 0 } // ApplicationCall.() -> Int
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/shutdown-url/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Shutdown URL
2 | description: Enables a URL that shuts down the server when accessed
3 | vcsLink: https://github.com/ktorio/ktor/blob/7e78e715cec3ff039cd628f8ff8ce875c35cde4c/ktor-server/ktor-server-host-common/jvm/src/io/ktor/server/engine/ShutDownUrl.kt
4 | license: Apache 2.0
5 | category: Administration
6 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/shutdown-url/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": []
2 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/sse/3.0.0/documentation.md:
--------------------------------------------------------------------------------
1 | Server-Sent Events (SSE) support plugin for sending events using the [SSE specification](https://html.spec.whatwg.org/multipage/server-sent-events.html).
2 |
3 | This extends routing to include the `sse` function, which installs a special GET endpoint for streaming events.
4 |
5 | For more information, please refer to the [documentation](https://ktor.io/docs/3.0.0-beta-1/sse-server.html).
6 |
7 | ## Usage
8 |
9 | Under `Application.module()`:
10 |
11 | ```kotlin
12 | install(SSE)
13 | ```
14 |
15 | Under routing:
16 |
17 | ```kotlin
18 | install(Routing) {
19 | // creates GET endpoint /hello with single
20 | // event streamed with content "world"
21 | sse("/hello") {
22 | send(ServerSentEvent("world"))
23 | }
24 | }
25 | ```
--------------------------------------------------------------------------------
/plugins/server/io.ktor/sse/3.0.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.sse.*
3 |
4 | fun Application.install() {
5 | install(SSE)
6 | }
7 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/sse/3.0.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Server-Sent Events (SSE)
2 | description: Support for server push events
3 | vcsLink: https://github.com/ktorio/ktor/blob/main/ktor-server/ktor-server-plugins/ktor-server-sse/jvmAndNix/src/io/ktor/server/sse/SSE.kt
4 | license: Apache 2.0
5 | category: Routing
6 | prerequisites:
7 | - routing
8 | installation:
9 | default: install.kt
10 | in_routing: routing.kt
11 | # test_function: test.kt
--------------------------------------------------------------------------------
/plugins/server/io.ktor/sse/3.0.0/routing.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.routing.*
2 | import io.ktor.server.sse.*
3 | import io.ktor.sse.*
4 |
5 | fun Routing.install() {
6 | sse("/hello") {
7 | send(ServerSentEvent("world"))
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/sse/3.0.0/test.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.client.plugins.sse.sse
2 | import io.ktor.server.testing.*
3 | import io.ktor.server.sse.*
4 | import io.ktor.sse.*
5 | import kotlinx.coroutines.flow.*
6 | import kotlin.test.*
7 |
8 | class ServerSentEventsTest {
9 |
10 | @Test
11 | fun testServerSentEvents() = testApplication {
12 | install(SSE)
13 | routing {
14 | sse("/events") {
15 | repeat(100) {
16 | send(ServerSentEvent("event $it"))
17 | }
18 | }
19 | }
20 |
21 | createClient {
22 | install(io.ktor.client.plugins.sse.SSE)
23 | }.sse("/events") {
24 | incoming.collectIndexed { i, event ->
25 | assertEquals("event $i", event.data)
26 | }
27 | }
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/sse/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[3.0.0,)": ktor-server-sse:==
--------------------------------------------------------------------------------
/plugins/server/io.ktor/static-content/2.0/documentation.md:
--------------------------------------------------------------------------------
1 |
2 | The [static](https://ktor.io/docs/serving-static-content.html) plugin provides the ability to serve files, such as stylesheets, scripts, images, and so on.
3 |
4 | ## Usage
5 |
6 | In order to serve the contents from a folder, we need to specify the folder name using the `files` function. The path is always relative to the application path:
7 | ```kotlin
8 | routing {
9 | static("assets") {
10 | files("css")
11 | }
12 | }
13 | ```
14 | `files("css")` would then allow for any file located in the folder `css` to be served as static content under the given URL pattern, which in this case is `assets`. This means that a request to `/assets/stylesheet.css` would serve the file `/css/stylesheet.css`.
15 |
16 | To learn how to serve individual files, embedded application resources, etc., see [Serving static content](https://ktor.io/docs/serving-static-content.html).
17 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/static-content/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Static Content
2 | description: Serves static files from defined locations
3 | vcsLink: https://github.com/ktorio/ktor/blob/7e78e715cec3ff039cd628f8ff8ce875c35cde4c/ktor-server/ktor-server-core/jvm/src/io/ktor/http/content/StaticContent.kt
4 | license: Apache 2.0
5 | category: Routing
6 | prerequisites:
7 | - routing
8 | installation:
9 | in_routing: routing.kt
10 | resources: static/index.html
11 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/static-content/2.0/routing.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.http.content.*
3 | import io.ktor.server.response.*
4 | import io.ktor.server.routing.*
5 |
6 | public fun Routing.configureRouting() {
7 | // Static plugin. Try to access `/static/index.html`
8 | staticResources("/static", "static")
9 | }
10 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/static-content/2.0/static/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Hello Ktor!
6 |
7 |
8 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/static-content/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": ktor-server-host-common:==
2 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/status-pages/2.0/documentation.md:
--------------------------------------------------------------------------------
1 |
2 | The [StatusPages](https://ktor.io/docs/status-pages.html) plugin allows Ktor applications to respond appropriately to any failure state.
3 |
4 | ## Usage
5 |
6 | There are three main configuration options provided by `StatusPages`:
7 | * `exceptions` - Configures a response based on the mapped exception classes.
8 | * `status` - Configures a response to a status code value.
9 | * `statusFile` - Configures standard a file response from the classpath.
10 |
11 | To learn more, see [Status pages](https://ktor.io/docs/status-pages.html).
12 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/status-pages/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.http.*
2 | import io.ktor.server.application.*
3 | import io.ktor.server.plugins.statuspages.*
4 | import io.ktor.server.response.*
5 |
6 | public fun Application.configureRouting() {
7 | install(StatusPages) {
8 | exception { call, cause ->
9 | call.respondText(text = "500: $cause" , status = HttpStatusCode.InternalServerError)
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/status-pages/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Status Pages
2 | description: Provides exception handling for routes
3 | vcsLink: https://github.com/ktorio/ktor/blob/7e78e715cec3ff039cd628f8ff8ce875c35cde4c/ktor-server/ktor-server-core/jvm/src/io/ktor/features/StatusPages.kt
4 | license: Apache 2.0
5 | category: Routing
6 | prerequisites:
7 | - routing
8 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/status-pages/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)":
2 | - io.ktor:ktor-server-host-common:==
3 | - io.ktor:ktor-server-status-pages:==
4 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/swagger/2.2/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.plugins.swagger.*
3 | import io.ktor.server.response.*
4 | import io.ktor.server.routing.*
5 |
6 | public fun Application.configureHTTP() {
7 | routing {
8 | swaggerUI(path = "openapi")
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/swagger/2.2/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Swagger
2 | description: Serves Swagger UI for your project
3 | vcsLink: https://github.com/ktorio/ktor/blob/main/ktor-server/ktor-server-plugins/ktor-server-swagger/jvm/src/io/ktor/server/plugins/swagger/Swagger.kt
4 | license: Apache 2.0
5 | category: HTTP
6 | prerequisites:
7 | - routing
8 | installation:
9 | default: install.kt
10 | resources: openapi/documentation.yaml
11 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/swagger/2.2/openapi/documentation.yaml:
--------------------------------------------------------------------------------
1 | openapi: "3.0.3"
2 | info:
3 | title: "Application API"
4 | description: "Application API"
5 | version: "1.0.0"
6 | servers:
7 | - url: "http://0.0.0.0:8080"
8 | paths:
9 | /:
10 | get:
11 | description: "Hello World!"
12 | responses:
13 | "200":
14 | description: "OK"
15 | content:
16 | text/plain:
17 | schema:
18 | type: "string"
19 | examples:
20 | Example#1:
21 | value: "Hello World!"
22 | components:
23 | schemas: {}
--------------------------------------------------------------------------------
/plugins/server/io.ktor/swagger/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.2,)": ktor-server-swagger:==
2 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/thymeleaf/2.0/documentation.md:
--------------------------------------------------------------------------------
1 |
2 | Ktor allows you to use Thymeleaf templates as views within your application by installing the [Thymeleaf](https://ktor.io/docs/thymeleaf.html) plugin.
3 |
4 | ## Usage
5 |
6 | Inside the `install` block, you can configure the `ClassLoaderTemplateResolver`. For example, the code snippet below enables Ktor to look up `*.html` templates in the `templates` package relative to the current classpath:
7 | ```kotlin
8 | install(Thymeleaf) {
9 | setTemplateResolver(ClassLoaderTemplateResolver().apply {
10 | prefix = "templates/"
11 | suffix = ".html"
12 | characterEncoding = "utf-8"
13 | })
14 | }
15 | ```
16 |
17 | To learn more, see [Thymeleaf](https://ktor.io/docs/thymeleaf.html).
18 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/thymeleaf/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.response.*
3 | import io.ktor.server.thymeleaf.Thymeleaf
4 | import io.ktor.server.thymeleaf.ThymeleafContent
5 | import org.thymeleaf.templateresolver.ClassLoaderTemplateResolver
6 |
7 | public fun Application.configureTemplating() {
8 | install(Thymeleaf) {
9 | setTemplateResolver(ClassLoaderTemplateResolver().apply {
10 | prefix = "templates/thymeleaf/"
11 | suffix = ".html"
12 | characterEncoding = "utf-8"
13 | })
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/thymeleaf/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Thymeleaf
2 | description: Serves HTML content, templated using Thymeleaf
3 | vcsLink: https://github.com/ktorio/ktor/blob/7e78e715cec3ff039cd628f8ff8ce875c35cde4c/ktor-features/ktor-thymeleaf/jvm/src/io/ktor/thymeleaf/Thymeleaf.kt
4 | license: Apache 2.0
5 | category: Templating
6 | prerequisites:
7 | - routing
8 | installation:
9 | default: install.kt
10 | resources: templates/thymeleaf/index.html
11 | in_routing: routing.kt
12 | outside_app: outside_app.kt
13 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/thymeleaf/2.0/outside_app.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.response.*
3 | import io.ktor.server.thymeleaf.Thymeleaf
4 | import io.ktor.server.thymeleaf.ThymeleafContent
5 | import org.thymeleaf.templateresolver.ClassLoaderTemplateResolver
6 |
7 | data class ThymeleafUser(val id: Int, val name: String)
8 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/thymeleaf/2.0/routing.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.response.*
3 | import io.ktor.server.routing.*
4 | import io.ktor.server.thymeleaf.Thymeleaf
5 | import io.ktor.server.thymeleaf.ThymeleafContent
6 | import org.thymeleaf.templateresolver.ClassLoaderTemplateResolver
7 |
8 | public fun Routing.configureRouting() {
9 | get("/html-thymeleaf") {
10 | call.respond(ThymeleafContent("index", mapOf("user" to ThymeleafUser(1, "user1"))))
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/thymeleaf/2.0/templates/thymeleaf/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Title
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/thymeleaf/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": ktor-server-thymeleaf:==
2 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/velocity/2.0/documentation.md:
--------------------------------------------------------------------------------
1 |
2 | Ktor allows you to use Velocity templates as views within your application by installing the [Velocity](https://ktor.io/docs/velocity.html) plugin.
3 |
4 | ## Usage
5 |
6 | Inside the `install` block, you can configure the `VelocityEngine`. For example, if you want to use templates from the classpath, use a resource loader for `classpath`:
7 | ```kotlin
8 | install(Velocity) {
9 | setProperty(RuntimeConstants.RESOURCE_LOADER, "classpath")
10 | setProperty("classpath.resource.loader.class", ClasspathResourceLoader::class.java.name)
11 | }
12 | ```
13 |
14 | To learn more, see [Velocity](https://ktor.io/docs/velocity.html).
15 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/velocity/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.response.*
3 | import io.ktor.server.velocity.*
4 | import org.apache.velocity.runtime.RuntimeConstants
5 | import org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
6 |
7 | public fun Application.configureTemplating() {
8 | install(Velocity) {
9 | setProperty(RuntimeConstants.RESOURCE_LOADER, "classpath")
10 | setProperty("classpath.resource.loader.class", ClasspathResourceLoader::class.java.name)
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/velocity/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Velocity
2 | description: Serves HTML content, templated using Apache Velocity
3 | vcsLink: https://github.com/ktorio/ktor/blob/7e78e715cec3ff039cd628f8ff8ce875c35cde4c/ktor-features/ktor-velocity/jvm/src/io/ktor/velocity/Velocity.kt
4 | license: Apache 2.0
5 | category: Templating
6 | prerequisites:
7 | - routing
8 | installation:
9 | default: install.kt
10 | resources: templates/index.vl
11 | outside_app: outside_app.kt
12 | in_routing: routing.kt
13 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/velocity/2.0/outside_app.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.response.*
3 | import io.ktor.server.velocity.*
4 | import org.apache.velocity.runtime.RuntimeConstants
5 | import org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
6 |
7 | data class VelocityUser(val id: Int, val name: String)
8 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/velocity/2.0/routing.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.response.*
3 | import io.ktor.server.routing.*
4 | import io.ktor.server.velocity.*
5 | import org.apache.velocity.runtime.RuntimeConstants
6 | import org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
7 |
8 | public fun Routing.configureRouting() {
9 | get("/index") {
10 | val sampleUser = VelocityUser(1, "John")
11 | call.respond(VelocityContent("templates/index.vl", mapOf("user" to sampleUser)))
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/velocity/2.0/templates/index.vl:
--------------------------------------------------------------------------------
1 |
2 |
3 | Hello, $user.name
4 |
5 |
6 | Copied!
7 |
8 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/velocity/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": ktor-server-velocity:==
2 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/webjars/2.0/documentation.md:
--------------------------------------------------------------------------------
1 |
2 | This plugin enables serving static content provided by WebJars. It allows you to package your assets such as JavaScript libraries and CSS as part of your fat JAR.
3 |
4 | ## Usage
5 |
6 | The configuration below enables the plugin to serve any WebJars assets on the `/assets` path:
7 | ```kotlin
8 | install(Webjars) {
9 | path = "assets"
10 | zone = ZoneId.of("EST")
11 | }
12 | ```
13 |
14 | The `zone` argument configures the correct time zone to be used with the `Last-Modified` header to support caching (only if the `ConditionalHeaders` plugin is also installed). To learn more, see [WebJars](https://ktor.io/docs/webjars.html).
15 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/webjars/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.http.*
2 | import io.ktor.server.application.*
3 | import io.ktor.server.response.*
4 | import io.ktor.server.webjars.*
5 |
6 | public fun Application.configureRouting() {
7 | install(Webjars) {
8 | path = "/webjars" //defaults to /webjars
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/webjars/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Webjars
2 | description: Bundles static assets into your built JAR file
3 | vcsLink: https://github.com/ktorio/ktor/blob/7e78e715cec3ff039cd628f8ff8ce875c35cde4c/ktor-features/ktor-webjars/jvm/src/io/ktor/webjars/Webjars.kt
4 | license: Apache 2.0
5 | category: Routing
6 | prerequisites:
7 | - routing
8 | installation:
9 | default: install.kt
10 | in_routing: routing.kt
11 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/webjars/2.0/routing.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.http.*
2 | import io.ktor.server.application.*
3 | import io.ktor.server.response.*
4 | import io.ktor.server.routing.*
5 | import io.ktor.server.webjars.*
6 |
7 | public fun Routing.configureRouting() {
8 | get("/webjars") {
9 | call.respondText("", ContentType.Text.Html)
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/plugins/server/io.ktor/webjars/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)":
2 | - io.ktor:ktor-server-webjars:==
3 | - org.webjars:jquery:3.2.1
4 |
--------------------------------------------------------------------------------
/plugins/server/org.jetbrains/css-dsl/2.0/documentation.md:
--------------------------------------------------------------------------------
1 |
2 | [CSS DSL](https://ktor.io/docs/css-dsl.html) extends HTML DSL and allows you to author stylesheets in Kotlin by using the `kotlin-css` wrapper.
3 |
4 | ## Usage
5 |
6 | Serving CSS for a specific route might look as follows:
7 | ```kotlin
8 | get("/styles.css") {
9 | call.respondCss {
10 | body {
11 | backgroundColor = Color.darkBlue
12 | margin(0.px)
13 | }
14 | rule("h1.page-title") {
15 | color = Color.white
16 | }
17 | }
18 | }
19 | ```
20 |
21 | You can learn more from [CSS DSL](https://ktor.io/docs/css-dsl.html).
22 |
--------------------------------------------------------------------------------
/plugins/server/org.jetbrains/css-dsl/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.http.*
2 | import io.ktor.server.application.*
3 | import io.ktor.server.html.*
4 | import io.ktor.server.response.*
5 | import kotlinx.css.*
6 | import kotlinx.html.*
7 |
8 | public fun Application.configureTemplating() {
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/plugins/server/org.jetbrains/css-dsl/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: CSS DSL
2 | description: Generates CSS from Kotlin DSL
3 | vcsLink: https://github.com/JetBrains/kotlin-wrappers/tree/master/kotlin-css
4 | license: Apache 2.0
5 | category: Templating
6 | prerequisites:
7 | - html-dsl
8 | installation:
9 | default: install.kt
10 | in_routing: routing.kt
11 | outside_app: outside_app.kt
12 | gradle:
13 | repositories:
14 | - url: https://maven.pkg.jetbrains.space/kotlin/p/kotlin/kotlin-js-wrappers
15 | maven:
16 | repositories:
17 | - id: kotlin_js
18 | url: https://maven.pkg.jetbrains.space/kotlin/p/kotlin/kotlin-js-wrappers
19 |
--------------------------------------------------------------------------------
/plugins/server/org.jetbrains/css-dsl/2.0/outside_app.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.http.*
2 | import io.ktor.server.application.*
3 | import io.ktor.server.html.*
4 | import io.ktor.server.response.*
5 | import kotlinx.css.*
6 | import kotlinx.html.*
7 |
8 | suspend inline fun ApplicationCall.respondCss(builder: CSSBuilder.() -> Unit) {
9 | this.respondText(CSSBuilder().apply(builder).toString(), ContentType.Text.CSS)
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/plugins/server/org.jetbrains/css-dsl/2.0/routing.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.http.*
2 | import io.ktor.server.application.*
3 | import io.ktor.server.html.*
4 | import io.ktor.server.response.*
5 | import io.ktor.server.routing.*
6 | import kotlinx.css.*
7 | import kotlinx.html.*
8 |
9 | public fun Routing.configureRouting() {
10 | get("/styles.css") {
11 | call.respondCss {
12 | body {
13 | backgroundColor = Color.darkBlue
14 | margin(0.px)
15 | }
16 | rule("h1.page-title") {
17 | color = Color.white
18 | }
19 | }
20 | }
21 |
22 | get("/html-css-dsl") {
23 | call.respondHtml {
24 | head {
25 | link(rel = "stylesheet", href = "/styles.css", type = "text/css")
26 | }
27 | body {
28 | h1(classes = "page-title") {
29 | +"Hello from Ktor!"
30 | }
31 | }
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/plugins/server/org.jetbrains/css-dsl/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": kotlin-css:1.0.0-pre.129-kotlin-1.4.20
2 |
--------------------------------------------------------------------------------
/plugins/server/org.jetbrains/exposed/2.2/inside_app.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.http.*
2 | import io.ktor.server.application.*
3 | import io.ktor.server.request.*
4 | import io.ktor.server.response.*
5 | import org.jetbrains.exposed.sql.*
6 |
7 | public fun Application.install(database: Database) {
8 | val userService = UserService(database)
9 | }
10 |
--------------------------------------------------------------------------------
/plugins/server/org.jetbrains/exposed/2.2/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.http.*
2 | import io.ktor.server.application.*
3 | import io.ktor.server.request.*
4 | import io.ktor.server.response.*
5 | import org.jetbrains.exposed.sql.*
6 |
7 | public fun Application.configureDatabases() {
8 | val database = Database.connect(
9 | url = "jdbc:h2:mem:test;DB_CLOSE_DELAY=-1",
10 | user = "root",
11 | driver = "org.h2.Driver",
12 | password = "",
13 | )
14 | }
15 |
--------------------------------------------------------------------------------
/plugins/server/org.jetbrains/exposed/2.2/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Exposed
2 | description: Adds Exposed database to your application
3 | vcsLink: https://github.com/JetBrains/Exposed
4 | license: Apache 2.0
5 | category: Databases
6 | prerequisites:
7 | - routing
8 | - kotlinx-serialization
9 | installation:
10 | default: install.kt
11 | inside_app: inside_app.kt
12 | in_routing: routing.kt
13 | sources:
14 | - UsersSchema.kt
15 |
--------------------------------------------------------------------------------
/plugins/server/org.jetbrains/exposed/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.2,)":
2 | - org.jetbrains.exposed:exposed-core:$exposed
3 | - org.jetbrains.exposed:exposed-jdbc:$exposed
4 | - com.h2database:h2:$h2
5 |
--------------------------------------------------------------------------------
/plugins/server/org.jetbrains/group.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: JetBrains
2 | url: https://jetbrains.org/
3 | email: ktor@jetbrains.com
4 | logo: icon.svg
--------------------------------------------------------------------------------
/plugins/server/org.jetbrains/html-dsl/2.0/documentation.md:
--------------------------------------------------------------------------------
1 |
2 | [HTML DSL](https://ktor.io/docs/html-dsl.html) integrates the `kotlinx.html` library into Ktor and allows you to respond to a client with HTML blocks. With HTML DSL, you can write pure HTML in Kotlin, interpolate variables into views, and even build complex HTML layouts using templates.
3 |
4 | ## Usage
5 |
6 | To send an HTML response, call the `respondHtml` method inside the required route:
7 |
8 | ```kotlin
9 | routing {
10 | get("/") {
11 | val name = "Ktor"
12 | call.respondHtml(HttpStatusCode.OK) {
13 | head {
14 | title {
15 | +name
16 | }
17 | }
18 | body {
19 | h1 {
20 | +"Hello from $name !"
21 | }
22 | }
23 | }
24 | }
25 | }
26 | ```
27 |
28 | You can learn more from the [HTML DSL](https://ktor.io/docs/html-dsl.html) help topic.
29 |
--------------------------------------------------------------------------------
/plugins/server/org.jetbrains/html-dsl/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.html.*
3 | import io.ktor.server.response.*
4 | import kotlinx.html.*
5 |
6 | public fun Application.configureTemplating() {
7 |
8 | }
9 |
--------------------------------------------------------------------------------
/plugins/server/org.jetbrains/html-dsl/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: HTML DSL
2 | description: Generates HTML from Kotlin DSL
3 | vcsLink: https://github.com/Kotlin/kotlinx.html
4 | license: Apache 2.0
5 | category: Templating
6 | prerequisites:
7 | - routing
8 | installation:
9 | default: install.kt
10 | in_routing: routing.kt
11 |
--------------------------------------------------------------------------------
/plugins/server/org.jetbrains/html-dsl/2.0/routing.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.html.*
3 | import io.ktor.server.response.*
4 | import io.ktor.server.routing.*
5 | import kotlinx.html.*
6 |
7 | public fun Routing.configureRouting() {
8 | get("/html-dsl") {
9 | call.respondHtml {
10 | body {
11 | h1 { +"HTML" }
12 | ul {
13 | for (n in 1..10) {
14 | li { +"$n" }
15 | }
16 | }
17 | }
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/plugins/server/org.jetbrains/html-dsl/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)":
2 | - io.ktor:ktor-server-html-builder:==
3 | - org.jetbrains.kotlinx:kotlinx-html:$kotlinx-html
4 |
--------------------------------------------------------------------------------
/plugins/server/org.jetbrains/htmx/3.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: HTMX
2 | description: Includes HTMX for front-end scripting
3 | vcsLink: https://github.com/bigskysoftware/htmx
4 | license: Zero-Clause BSD
5 | category: Templating
6 | prerequisites:
7 | - html-dsl
8 | documentation: documentation.md
9 | amper:
10 | # TODO test amper
11 | disabled: true
12 | maven:
13 | disabled: true
14 | installation:
15 | in_routing: endpoints.kt
16 | web: web.kt
17 | outside_web: import.kt
18 | sources:
19 | - LeaderboardPage.kt (server)
20 | resources:
21 | - leaderboard.css (web)
22 |
--------------------------------------------------------------------------------
/plugins/server/org.jetbrains/htmx/3.0/server/endpoints.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
3 | */
4 |
5 | package com.example
6 |
7 | import io.ktor.server.html.respondHtml
8 | import io.ktor.server.routing.*
9 | import kotlinx.html.*
10 | import kotlin.random.Random
11 |
12 | fun Routing.htmxEndpoints() {
13 | val random = Random(System.currentTimeMillis())
14 |
15 | get("/") {
16 | call.respondHtml {
17 | leaderboardPage(random)
18 | }
19 | }
20 |
21 | get("/more-rows") {
22 | call.respondHtml {
23 | body {
24 | table {
25 | tbody {
26 | randomRows(random)
27 | }
28 | }
29 | }
30 | }
31 | }
32 | }
--------------------------------------------------------------------------------
/plugins/server/org.jetbrains/htmx/3.0/web/import.kt:
--------------------------------------------------------------------------------
1 | import kotlin.js.*
2 |
3 | @JsModule("htmx.org")
4 | external object htmx
--------------------------------------------------------------------------------
/plugins/server/org.jetbrains/htmx/3.0/web/leaderboard.css:
--------------------------------------------------------------------------------
1 | body {
2 | font-family: sans-serif;
3 | }
4 |
5 | #leaderboard {
6 | max-width: 400px;
7 | width: 100%;
8 |
9 | th {
10 | text-align: left;
11 | border-bottom: 2px solid;
12 | }
13 |
14 | tbody {
15 | tr.htmx-added {
16 | opacity: 0;
17 | }
18 | tr {
19 | opacity: 1;
20 | transition: opacity 0.5s ease-in;
21 | }
22 | tr:nth-child(odd):not(:last-child) {
23 | background-color: rgba(0, 0, 0, 0.1);
24 | }
25 | td {
26 | padding: 4px;
27 | }
28 | }
29 | }
30 |
31 | #total-count {
32 | position: fixed;
33 | right: 10px;
34 | top: 10px;
35 | }
--------------------------------------------------------------------------------
/plugins/server/org.jetbrains/htmx/3.0/web/web.kt:
--------------------------------------------------------------------------------
1 | import kotlinx.browser.document
2 | import kotlinx.browser.window
3 |
4 | fun main() {
5 | document.body?.apply {
6 | var rowCount = 1
7 | // Update the total count of items
8 | addEventListener("htmx:beforeSwap") {
9 | document.getElementById("total-count")?.innerHTML = "Total: ${(++rowCount) * 10}"
10 | }
11 | // Scroll to the bottom of the page after adding content
12 | addEventListener("htmx:afterSwap") {
13 | window.scrollTo(0.0, scrollHeight.toDouble())
14 | }
15 | }
16 | }
--------------------------------------------------------------------------------
/plugins/server/org.jetbrains/htmx/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[3.0,)":
2 | web:
3 | - npm(htmx.org:2.0.3)
4 | - org.jetbrains.kotlinx:kotlinx-browser:$kotlinx-browser
--------------------------------------------------------------------------------
/plugins/server/org.jetbrains/icon.svg:
--------------------------------------------------------------------------------
1 |
4 |
5 |
17 |
--------------------------------------------------------------------------------
/plugins/server/org.jetbrains/kotlinx-rpc/3.0/client/Rpc.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.client.HttpClient
2 | import io.ktor.client.request.url
3 | import kotlinx.rpc.RpcClient
4 | import kotlinx.rpc.krpc.ktor.client.rpc
5 | import kotlinx.rpc.krpc.ktor.client.rpcConfig
6 | import kotlinx.rpc.krpc.serialization.json.json
7 | import kotlinx.rpc.withService
8 |
9 | suspend fun HttpClient.rpcClient(url: String): RpcClient =
10 | rpc {
11 | url(url)
12 |
13 | rpcConfig {
14 | serialization {
15 | json()
16 | }
17 | }
18 | }
19 |
20 | fun RpcClient.sampleService(): SampleService =
21 | withService()
22 |
--------------------------------------------------------------------------------
/plugins/server/org.jetbrains/kotlinx-rpc/3.0/client/client.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.client.*
2 | import kotlinx.rpc.krpc.ktor.client.installKrpc
3 |
4 | fun HttpClientConfig<*>.configure() {
5 | installKrpc()
6 | }
7 |
--------------------------------------------------------------------------------
/plugins/server/org.jetbrains/kotlinx-rpc/3.0/core/SampleService.kt:
--------------------------------------------------------------------------------
1 | import kotlinx.rpc.RemoteService
2 | import kotlinx.rpc.annotations.Rpc
3 | import kotlinx.serialization.Serializable
4 | import kotlin.coroutines.CoroutineContext
5 |
6 | @Serializable
7 | data class Data(val value: String)
8 |
9 | @Rpc
10 | interface SampleService : RemoteService {
11 | suspend fun hello(data: Data): String
12 | }
13 |
14 | class SampleServiceImpl(override val coroutineContext: CoroutineContext) : SampleService {
15 | override suspend fun hello(data: Data): String {
16 | return "Server: ${data.value}"
17 | }
18 | }
--------------------------------------------------------------------------------
/plugins/server/org.jetbrains/kotlinx-rpc/3.0/server/frameworks.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.routing.*
3 |
4 | // Placeholder for test, so that our install matches the expected generated function
5 | fun Application.configureFrameworks() {
6 | configureRPC()
7 | routing {
8 | configureRouting()
9 | }
10 | }
--------------------------------------------------------------------------------
/plugins/server/org.jetbrains/kotlinx-rpc/3.0/server/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import kotlinx.rpc.krpc.ktor.server.Krpc
3 |
4 | fun Application.configureRPC() {
5 | install(Krpc)
6 | }
7 |
--------------------------------------------------------------------------------
/plugins/server/org.jetbrains/kotlinx-rpc/3.0/server/routing.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
3 | */
4 |
5 | import io.ktor.server.routing.*
6 | import kotlinx.rpc.krpc.serialization.json.*
7 | import kotlinx.rpc.krpc.ktor.server.rpc
8 |
9 | fun Routing.configureRouting() {
10 | rpc("/api") {
11 | rpcConfig {
12 | serialization {
13 | json()
14 | }
15 | }
16 |
17 | registerService { ctx -> SampleServiceImpl(ctx) }
18 | }
19 | }
--------------------------------------------------------------------------------
/plugins/server/org.jetbrains/kotlinx-rpc/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[3.0,)":
2 | core:
3 | - org.jetbrains.kotlinx:kotlinx-rpc-krpc-serialization-json:$kotlinx-rpc
4 | - org.jetbrains.kotlinx:kotlinx-rpc-core:$kotlinx-rpc
5 | server:
6 | - org.jetbrains.kotlinx:kotlinx-rpc-krpc-ktor-server:$kotlinx-rpc
7 | - org.jetbrains.kotlinx:kotlinx-rpc-krpc-ktor-client:$kotlinx-rpc # TODO test config
8 | client: org.jetbrains.kotlinx:kotlinx-rpc-krpc-ktor-client:$kotlinx-rpc
--------------------------------------------------------------------------------
/plugins/server/org.jetbrains/mongodb/2.2,3.0.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: MongoDB
2 | description: Adds MongoDB database to your application
3 | vcsLink: https://github.com/mongodb/mongo
4 | license: Apache 2.0
5 | category: Databases
6 | prerequisites:
7 | - routing
8 | - kotlinx-serialization
9 | documentation: documentation.md
10 | installation:
11 | default: install.kt
12 | outside_app: outside_app.kt
13 | sources:
14 | - CarsSchema.kt
--------------------------------------------------------------------------------
/plugins/server/org.jetbrains/mongodb/3.0.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: MongoDB
2 | description: Adds MongoDB database to your application
3 | vcsLink: https://github.com/mongodb/mongo
4 | license: Apache 2.0
5 | category: Databases
6 | prerequisites:
7 | - routing
8 | - kotlinx-serialization
9 | documentation: documentation.md
10 | installation:
11 | default: install.kt
12 | outside_app: outside_app.kt
13 | sources:
14 | - CarsSchema.kt
--------------------------------------------------------------------------------
/plugins/server/org.jetbrains/mongodb/logo.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/plugins/server/org.jetbrains/mongodb/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.2,3.0.0)":
2 | - org.mongodb:mongodb-driver-core:$mongo
3 | - org.mongodb:mongodb-driver-sync:$mongo
4 | - org.mongodb:bson:$mongo
5 | "[3.0.0,)":
6 | - org.mongodb:mongodb-driver-core:$mongo
7 | - org.mongodb:mongodb-driver-sync:$mongo
8 | - org.mongodb:bson:$mongo
9 |
--------------------------------------------------------------------------------
/plugins/server/org.jetbrains/postgres/2.2/application.conf:
--------------------------------------------------------------------------------
1 | postgres {
2 | url = "jdbc:postgresql://localhost/default"
3 | user = "username"
4 | password = "password"
5 | }
--------------------------------------------------------------------------------
/plugins/server/org.jetbrains/postgres/2.2/application.yaml:
--------------------------------------------------------------------------------
1 | postgres:
2 | url: "jdbc:postgresql://localhost/default"
3 | user: username
4 | password: password
--------------------------------------------------------------------------------
/plugins/server/org.jetbrains/postgres/2.2/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Postgres
2 | description: Adds Postgres database to your application
3 | vcsLink: https://github.com/pgjdbc
4 | license: Apache 2.0
5 | category: Databases
6 | prerequisites:
7 | - routing
8 | - kotlinx-serialization
9 | installation:
10 | default: install.kt
11 | outside_app: outside_app.kt
12 | application_conf: application.conf
13 | application_yaml: application.yaml
14 | sources:
15 | - CitySchema.kt
16 |
--------------------------------------------------------------------------------
/plugins/server/org.jetbrains/postgres/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ktorio/ktor-plugin-registry/483dc0ed49b07e6022405c276a68587e11d3afcd/plugins/server/org.jetbrains/postgres/logo.png
--------------------------------------------------------------------------------
/plugins/server/org.jetbrains/postgres/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.2,)":
2 | - org.postgresql:postgresql:$postgres
3 | - com.h2database:h2:$h2
4 |
--------------------------------------------------------------------------------
/renovate.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3 | "extends": [
4 | "config:recommended"
5 | ],
6 | "ignoreDeps": [
7 | "io.ktor:ktor-server-test-host"
8 | ]
9 | }
10 |
--------------------------------------------------------------------------------
/settings.gradle.kts:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | repositories {
3 | mavenCentral()
4 | gradlePluginPortal()
5 | }
6 | }
7 |
8 | plugins {
9 | id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
10 | }
11 |
12 | rootProject.name = "ktor-plugin-registry"
13 |
--------------------------------------------------------------------------------
/shared/io/ktor/plugins/registry/Constants.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
3 | */
4 |
5 | package io.ktor.plugins.registry
6 |
7 | const val GROUP_FILE = "group.ktor.yaml"
8 | const val VERSIONS_FILE = "versions.ktor.yaml"
9 | const val MANIFEST_FILE = "manifest.ktor.yaml"
10 |
--------------------------------------------------------------------------------
/shared/io/ktor/plugins/registry/Properties.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
3 | */
4 |
5 | package io.ktor.plugins.registry
6 |
7 | import java.nio.file.Path
8 | import java.util.Properties
9 | import kotlin.collections.component1
10 | import kotlin.collections.component2
11 | import kotlin.io.path.inputStream
12 |
13 | fun Path.readVersionProperties() = resolve("gradle.properties").let { versionsFile ->
14 | try {
15 | Properties().apply {
16 | load(versionsFile.inputStream())
17 | }.entries.associate { (key, value) ->
18 | key.toString() to value.toString()
19 | }
20 | } catch (_: Exception) {
21 | emptyMap()
22 | }
23 | }
--------------------------------------------------------------------------------
/shared/io/ktor/plugins/registry/ResolvedArtifacts.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
3 | */
4 |
5 | package io.ktor.plugins.registry
6 |
7 | import kotlinx.serialization.Serializable
8 |
9 | @Serializable
10 | data class ResolvedArtifact(
11 | val version: String,
12 | val path: String,
13 | )
14 |
15 | fun Map.find(artifact: ArtifactReference, group: PluginGroup) =
16 | get(artifact.groupAndName(group)) ?: get(artifact.groupAndName(group) + "-jvm")
17 |
18 | fun ArtifactReference.resolve(resolvedArtifact: ResolvedArtifact?): ArtifactReference =
19 | resolvedArtifact?.let {
20 | resolve(ArtifactVersion.parse(it.version))
21 | } ?: this
--------------------------------------------------------------------------------
/src/main/kotlin/io/ktor/plugins/registry/BuildRegistry.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
3 | */
4 |
5 | package io.ktor.plugins.registry
6 |
7 | import io.ktor.plugins.registry.utils.Files.resolveAndClear
8 | import java.nio.file.Paths
9 |
10 | /**
11 | * Builds registry for use in ktor project generator back end.
12 | */
13 | fun main() {
14 | val pluginsRoot = Paths.get("plugins")
15 | val buildDir = Paths.get("build")
16 | with(RegistryBuilder()) {
17 | val assetsDir = buildDir.resolveAndClear("registry/assets")
18 | buildRegistries(pluginsRoot, buildDir, assetsDir)
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/kotlin/io/ktor/plugins/registry/utils/Documentation.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
3 | */
4 |
5 | package io.ktor.plugins.registry.utils
6 |
7 | object DocumentationExtractor {
8 | private val usageRegex = Regex("\n#+\\s*Usage\\s*?\n", setOf(RegexOption.IGNORE_CASE, RegexOption.MULTILINE))
9 |
10 | fun parseDocumentationMarkdown(contents: String): DocumentationEntry =
11 | usageRegex.split(contents)
12 | .takeIf { it.size == 2 }
13 | ?.map(String::trim)
14 | ?.let { (description, usage) ->
15 | DocumentationEntry(description, usage)
16 | } ?: throw IllegalArgumentException("Missing usage section in documentation: \n$contents")
17 | }
18 |
19 | data class DocumentationEntry(
20 | val description: String,
21 | val usage: String,
22 | )
23 |
--------------------------------------------------------------------------------
/src/main/kotlin/io/ktor/plugins/registry/utils/PluginGroups.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
3 | */
4 |
5 | package io.ktor.plugins.registry.utils
6 |
7 | import com.charleskorn.kaml.YamlScalar
8 | import io.ktor.plugins.registry.PluginGroup
9 | import java.nio.file.Path
10 | import kotlin.io.path.name
11 |
12 | fun Path.readPluginGroup(): PluginGroup? =
13 | readYamlMap()?.let { yaml ->
14 | val (name, url, email, logo) = listOf("name", "url", "email", "logo").map {
15 | yaml.get(it)?.content
16 | }
17 | PluginGroup(parent.name, name, url, email, logo)
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/kotlin/io/ktor/plugins/registry/utils/Yaml.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
3 | */
4 |
5 | package io.ktor.plugins.registry.utils
6 |
7 | import com.charleskorn.kaml.Yaml
8 | import com.charleskorn.kaml.YamlMap
9 | import com.charleskorn.kaml.parseToYamlNode
10 | import com.charleskorn.kaml.yamlMap
11 | import java.nio.file.Path
12 | import kotlin.io.path.exists
13 | import kotlin.io.path.inputStream
14 |
15 | fun Path.readYamlMap(): YamlMap? =
16 | takeIf { it.exists() }
17 | ?.inputStream()
18 | ?.use(Yaml.default::parseToYamlNode)
19 | ?.yamlMap
20 |
--------------------------------------------------------------------------------
/src/main/resources/default-icon.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/main/resources/logback.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | %msg%n
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/mock/kotlin/MockApplication.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
3 | */
4 |
5 | import io.ktor.server.application.Application
6 |
7 | /**
8 | * The generator creates this function to delegate calling to other modules. It is supplied here for referencing from
9 | * unit tests.
10 | */
11 | fun Application.module() {}
--------------------------------------------------------------------------------
/src/test/kotlin/io/ktor/plugins/registry/utils/VersionsTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
3 | */
4 |
5 | package io.ktor.plugins.registry.utils
6 |
7 | import io.ktor.plugins.registry.*
8 | import kotlin.test.Test
9 | import kotlin.test.assertEquals
10 |
11 | class VersionsTest {
12 |
13 | @Test
14 | fun test() {
15 | assertEquals("${'$'}foo_bar_version", catalogVersion("foo-bar").normalizedName)
16 | assertEquals("${'$'}foo_bar_version", catalogVersion("fooBar").normalizedName)
17 | }
18 |
19 | private fun catalogVersion(name: String) =
20 | VersionVariable(name, VersionNumber("1.2.3"))
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/src/test/resources/build/ktor_releases:
--------------------------------------------------------------------------------
1 | 2.3.12
2 | 3.0.0
--------------------------------------------------------------------------------
/src/test/resources/plugins/gradle.properties:
--------------------------------------------------------------------------------
1 | exposed=0.53.+
2 | h2=2.2.224
--------------------------------------------------------------------------------
/src/test/resources/plugins/server/com.fail/bad_kt/2.0/install.kt:
--------------------------------------------------------------------------------
1 | does not compile
--------------------------------------------------------------------------------
/src/test/resources/plugins/server/com.fail/bad_kt/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Bad Kotlin code
2 | description: The install script won't compile
3 | vcsLink: https://github.com/fail/bad_kt
4 | license: Apache 2.0
5 | category: Templating
6 | documentation: |
7 | Here are the docs
8 | #Usage
9 | doThing()
--------------------------------------------------------------------------------
/src/test/resources/plugins/server/com.fail/bad_kt/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": []
--------------------------------------------------------------------------------
/src/test/resources/plugins/server/com.fail/group.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Failure Scenarios
2 | url: https://fail.com
--------------------------------------------------------------------------------
/src/test/resources/plugins/server/com.fail/missing_import/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import does.not.exist.*
2 | import io.ktor.server.application.*
3 |
4 | fun Application.install() {
5 | // should fail with bad import
6 | }
--------------------------------------------------------------------------------
/src/test/resources/plugins/server/com.fail/missing_import/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Missing import
2 | description: The install script won't compile
3 | vcsLink: https://github.com/fail/missing_import
4 | license: Apache 2.0
5 | category: Templating
6 | documentation: |
7 | Here are the docs
8 | #Usage
9 | doThing()
--------------------------------------------------------------------------------
/src/test/resources/plugins/server/com.fail/missing_import/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": []
--------------------------------------------------------------------------------
/src/test/resources/plugins/server/com.fail/no_doc/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Missing documentation file
2 | description: A test for missing documentation files.
3 | vcsLink: https://github.com/fail/missing_doc
4 | license: Apache 2.0
5 | category: Templating
6 | installation:
7 | default: "fun bun(){}"
--------------------------------------------------------------------------------
/src/test/resources/plugins/server/com.fail/no_doc/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": []
--------------------------------------------------------------------------------
/src/test/resources/plugins/server/com.fail/no_install/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Missing install file
2 | description: A test for missing install files.
3 | vcsLink: https://github.com/fail/missing
4 | license: Apache 2.0
5 | category: Templating
6 | documentation: |
7 | Here are the docs
8 | #Usage
9 | doThing()
--------------------------------------------------------------------------------
/src/test/resources/plugins/server/com.fail/no_install/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": []
--------------------------------------------------------------------------------
/src/test/resources/plugins/server/io.ktor/csrf/2.0/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import io.ktor.server.response.*
3 | import io.ktor.server.routing.*
4 |
5 | fun Application.install() {
6 | install(Routing) {
7 | get {
8 | call.respondText("Hello, World!")
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/test/resources/plugins/server/io.ktor/csrf/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": []
--------------------------------------------------------------------------------
/src/test/resources/plugins/server/io.ktor/group.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Ktor
2 | url: https://ktor.io/
--------------------------------------------------------------------------------
/src/test/resources/plugins/server/org.jetbrains/exposed/2.2/ExposedUser.kt:
--------------------------------------------------------------------------------
1 | import kotlinx.serialization.Serializable
2 |
3 | @Serializable
4 | data class ExposedUser(val name: String, val age: Int)
--------------------------------------------------------------------------------
/src/test/resources/plugins/server/org.jetbrains/exposed/2.2/inside_app.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.http.*
2 | import io.ktor.server.application.*
3 | import io.ktor.server.request.*
4 | import io.ktor.server.response.*
5 | import org.jetbrains.exposed.sql.*
6 |
7 | public fun Application.install(database: Database) {
8 | val userService = UserService(database)
9 | }
10 |
--------------------------------------------------------------------------------
/src/test/resources/plugins/server/org.jetbrains/exposed/2.2/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.http.*
2 | import io.ktor.server.application.*
3 | import io.ktor.server.request.*
4 | import io.ktor.server.response.*
5 | import org.jetbrains.exposed.sql.*
6 |
7 | public fun Application.configureDatabases() {
8 | val database = Database.connect(
9 | url = "jdbc:h2:mem:test;DB_CLOSE_DELAY=-1",
10 | user = "root",
11 | driver = "org.h2.Driver",
12 | password = "",
13 | )
14 | }
15 |
--------------------------------------------------------------------------------
/src/test/resources/plugins/server/org.jetbrains/exposed/2.2/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Exposed
2 | description: Adds Exposed database to your application
3 | vcsLink: https://github.com/JetBrains/Exposed
4 | license: Apache 2.0
5 | category: Databases
6 | installation:
7 | default: install.kt
8 | inside_app: inside_app.kt
9 | in_routing: routing.kt
10 | sources:
11 | - UsersSchema.kt
12 | - ExposedUser.kt
13 |
--------------------------------------------------------------------------------
/src/test/resources/plugins/server/org.jetbrains/exposed/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.2,)":
2 | - org.jetbrains.exposed:exposed-core:$exposed
3 | - org.jetbrains.exposed:exposed-jdbc:$exposed
4 | - com.h2database:h2:$h2
--------------------------------------------------------------------------------
/src/test/resources/plugins/server/org.jetbrains/group.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: JetBrains
2 | url: https://jetbrains.org/
3 | email: ktor@jetbrains.com
4 | logo: icon.svg
--------------------------------------------------------------------------------
/src/test/resources/plugins/server/org.jetbrains/icon.svg:
--------------------------------------------------------------------------------
1 |
4 |
5 |
17 |
--------------------------------------------------------------------------------
/src/test/resources/plugins/server/org.missing/test/2.0/manifest.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Missing Group
2 | description: The group yaml is missing.
3 | vcsLink: https://github.com/no/group
4 | license: Apache 2.0
5 | category: Templating
6 | documentation: |
7 | Here are the docs
8 | #Usage
9 | doThing()
10 | installation:
11 | default: "fun bun(){}"
--------------------------------------------------------------------------------
/src/test/resources/plugins/server/org.missing/test/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | "[2.0,)": []
--------------------------------------------------------------------------------
/templates/documentation.md:
--------------------------------------------------------------------------------
1 |
2 | A longer description here which is shown after selecting the plugin listing.
3 |
4 | More details are provided here.
5 |
6 | ## Usage
7 |
8 | The usage section is REQUIRED.
9 |
10 | Here you can find a short description of how to use the plugin, along with code snippets.
11 |
12 | ```kotlin
13 | install(Sample) {
14 | sampleProperty = "property.value"
15 | }
16 | ```
--------------------------------------------------------------------------------
/templates/group.ktor.yaml:
--------------------------------------------------------------------------------
1 | name: Example
2 | url: https://example.com/
3 | email: sample@example.com
--------------------------------------------------------------------------------
/templates/install.kt:
--------------------------------------------------------------------------------
1 | import io.ktor.server.application.*
2 | import org.group.plugin.sample.*
3 |
4 | // The contents of the `install` function will be used for the project template
5 | public fun Application.install() {
6 | install(Sample) {
7 | sampleProperty = "property.value"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/templates/schema/group-schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json-schema.org/draft-04/schema#",
3 | "id": "https://ktor.io/group.yaml.json",
4 | "properties": {
5 | "name": {
6 | "description": "The name of your organization",
7 | "type": "string",
8 | "maxLength": 80,
9 | "minLength": 1
10 | },
11 | "url": {
12 | "description": "A URL associated with your organization",
13 | "type": "string",
14 | "maxLength": 80
15 | },
16 | "email": {
17 | "description": "An email for contacting the plugin maintainers",
18 | "type": "string",
19 | "maxLength": 80
20 | },
21 | "logo": {
22 | "description": "An icon which is displayed along all plugin items in the generator",
23 | "type": "string",
24 | "maxLength": 80
25 | }
26 | },
27 | "required": ["name"],
28 | "additionalProperties": false,
29 | "title": "YAML schema for Ktor plugin groups",
30 | "type": "object"
31 | }
--------------------------------------------------------------------------------
/templates/schema/version-schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json-schema.org/draft-04/schema#",
3 | "id": "https://ktor.io/versions.yaml.json",
4 | "patternProperties": {
5 | "^[\\[\\](),0-9]": {
6 | "description": "Maven version range specification",
7 | "type": ["string", "array", "object"]
8 | }
9 | },
10 | "title": "YAML schema for Ktor version mappings",
11 | "type": "object"
12 | }
--------------------------------------------------------------------------------
/templates/versions.ktor.yaml:
--------------------------------------------------------------------------------
1 | # This file maps ktor versions to the required artifacts
2 |
3 | # For a single artifact, include just the string.
4 | # The version range uses Maven-style semantic versioning https://docs.gradle.org/current/userguide/single_versions.html
5 | # Group and artifact name will default to the group and plugin ID.
6 | "[1.0,2.0)": 1.+
7 |
8 | # For multiple gradle imports, use a list.
9 | 2.+:
10 | - org.sample:sample-artifact:1.+
11 | - io.ktor:ktor-serialization-kotlinx-json:$serialization
12 |
13 | # For multi-module dependencies, use a map.
14 | (3.0,]:
15 | server: com.company:library-server:1.0.2
16 | client: com.company:library-client:1.0.2
17 |
18 | # You can declare version variables here, they will appear in the version catalog or properties
19 | serialization: 1.6.+
--------------------------------------------------------------------------------