Skip to content
This repository has been archived by the owner on Nov 15, 2024. It is now read-only.

Commit

Permalink
upgrade http4k, API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddenton committed Jan 9, 2021
1 parent 70fe550 commit 407b114
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 32 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
This list is not intended to be all-encompassing - it will document major and breaking API
changes with their rationale when appropriate. Given version `A.B.C.D`, breaking changes are to be expected in version number increments where changes in the `A` or `B` sections:

### v2.8.0.0
- **http4k-connect-*** : Upgrade to http4k 4.X.X.X.

### v2.7.1.0
- **http4k-connect-amazon-systemsmanager** : Refined model.
- **http4k-connect-amazon-*** : Fixed handling of ARNs.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
package org.http4k.connect.amazon

import org.http4k.core.HttpHandler
import org.http4k.routing.bind
import org.http4k.routing.header
import org.http4k.routing.routes
import org.http4k.routing.reverseProxy

/**
* Simple ReverseProxy for AWS services. Allows for simple traffic splitting based
* on the Host header.
*/
fun AwsReverseProxy(vararg awsServices: Pair<AwsServiceCompanion, HttpHandler>) =
routes(
*awsServices.map { it.first.awsService.value to it.second }.toTypedArray()
.map { service ->
header("host") { it.contains(service.first) } bind service.second
}.toTypedArray()
)
reverseProxy(*awsServices.map { it.first.awsService.value to it.second }.toTypedArray())

Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ package org.http4k.format

import com.squareup.moshi.JsonAdapter
import com.squareup.moshi.Moshi
import org.http4k.connect.ConnectJsonAdapterFactory
import org.http4k.connect.adapter
import org.http4k.connect.amazon.model.KotshiTagJsonAdapter

abstract class AwsJsonAdapterFactory(
vararg typesToAdapters: Pair<String, (Moshi) -> JsonAdapter<*>>
) : ConnectJsonAdapterFactory(
) : SimpleMoshiAdapterFactory(
*(typesToAdapters.toList() + adapter { KotshiTagJsonAdapter() })
.toTypedArray()
)
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.http4k.connect.amazon.kms

import com.squareup.moshi.Moshi
import org.http4k.connect.adapter
import org.http4k.connect.amazon.kms.action.KotshiCreateKeyJsonAdapter
import org.http4k.connect.amazon.kms.action.KotshiDecryptJsonAdapter
import org.http4k.connect.amazon.kms.action.KotshiDecryptedJsonAdapter
Expand All @@ -24,6 +23,7 @@ import org.http4k.connect.amazon.kms.action.KotshiVerifyResultJsonAdapter
import org.http4k.connect.amazon.model.KotshiKeyMetadataJsonAdapter
import org.http4k.format.AwsJsonAdapterFactory
import org.http4k.format.ConfigurableMoshi
import org.http4k.format.adapter
import org.http4k.format.asConfigurable
import org.http4k.format.withAwsCoreMappings
import org.http4k.format.withStandardMappings
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.http4k.connect.amazon.secretsmanager

import com.squareup.moshi.Moshi
import org.http4k.connect.adapter
import org.http4k.connect.amazon.model.SecretId
import org.http4k.connect.amazon.model.VersionId
import org.http4k.connect.amazon.model.VersionStage
Expand All @@ -23,6 +22,7 @@ import org.http4k.connect.amazon.secretsmanager.action.KotshiUpdatedSecretValueJ
import org.http4k.format.AutoMappingConfiguration
import org.http4k.format.AwsJsonAdapterFactory
import org.http4k.format.ConfigurableMoshi
import org.http4k.format.adapter
import org.http4k.format.asConfigurable
import org.http4k.format.text
import org.http4k.format.withAwsCoreMappings
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.http4k.connect.amazon.systemsmanager

import com.squareup.moshi.Moshi
import org.http4k.connect.adapter
import org.http4k.connect.amazon.model.SSMParameterName
import org.http4k.connect.amazon.systemsmanager.action.KotshiDeleteParameterJsonAdapter
import org.http4k.connect.amazon.systemsmanager.action.KotshiGetParameterJsonAdapter
Expand All @@ -12,6 +11,7 @@ import org.http4k.connect.amazon.systemsmanager.action.KotshiPutParameterResultJ
import org.http4k.format.AutoMappingConfiguration
import org.http4k.format.AwsJsonAdapterFactory
import org.http4k.format.ConfigurableMoshi
import org.http4k.format.adapter
import org.http4k.format.asConfigurable
import org.http4k.format.text
import org.http4k.format.withAwsCoreMappings
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
http4k_version=3.285.2
http4k_version=4.0.0.0
junit_version=5.7.0
kotlin_version=1.4.21
forkhandles_version=1.6.0.0
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 407b114

Please sign in to comment.