Skip to content

Commit

Permalink
fix(misc): Upgrade to kotlin 1.4 to match with kork kotlin version (#…
Browse files Browse the repository at this point in the history
…1312)

* fix(misc): Upgrade to kotlin 1.4 to match with kork kotlin version

* fix(misc): Remove TomcatConfiguration properties reference
  • Loading branch information
srekapalli committed Aug 24, 2020
1 parent b3ede47 commit ab06a31
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion build.gradle
@@ -1,6 +1,6 @@
plugins {
id 'io.spinnaker.project' version "$spinnakerGradleVersion" apply false
id "nebula.kotlin" version "$kotlinVersion" apply false
id "org.jetbrains.kotlin.jvm" version "$kotlinVersion" apply false
id "org.jetbrains.kotlin.plugin.allopen" version "$kotlinVersion" apply false
id "org.jetbrains.dokka" version "0.10.1" apply false
}
Expand Down
@@ -1,6 +1,5 @@
package com.netflix.spinnaker.gate.config;

import com.netflix.spinnaker.config.TomcatConfigurationProperties;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.context.WebServerApplicationContext;
import org.springframework.boot.web.embedded.tomcat.TomcatWebServer;
Expand All @@ -17,18 +16,18 @@ public class MultiAuthSupport {
@Value("${default.legacy-server-port-auth:true}")
private boolean legacyServerPortAuth;

@Value("${default.legacy-server-port:-1}")
private int legacyServerPort;

@Bean
RequestMatcherProvider multiAuthRequestMatcherProvider(
ApplicationContext applicationContext,
TomcatConfigurationProperties tomcatConfigurationProperties) {
RequestMatcherProvider multiAuthRequestMatcherProvider(ApplicationContext applicationContext) {
return new RequestMatcherProvider() {
@Override
public RequestMatcher requestMatcher() {
if (applicationContext instanceof WebServerApplicationContext) {
final WebServerApplicationContext ctx = (WebServerApplicationContext) applicationContext;
return req -> {
if (legacyServerPortAuth
&& tomcatConfigurationProperties.getLegacyServerPort() == req.getLocalPort()) {
if (legacyServerPortAuth && legacyServerPort == req.getLocalPort()) {
return true;
}
// we have to do this per request because at bean-creation time the WebServer has not
Expand Down
Expand Up @@ -48,7 +48,8 @@ class ApiExtensionController @Autowired constructor(private val apiExtensions: L
val duplicateApiExtensionIds = apiExtensions
.groupBy { it.id().toLowerCase() }
.filter { it.value.size > 1 }
.flatMap { it.value }
.map { it.value }
.flatten()
.map { "[class=${it.javaClass}], id=${it.id()}]" }

if (duplicateApiExtensionIds.isNotEmpty()) {
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
@@ -1,8 +1,8 @@
enablePublishing=false
fiatVersion=1.22.0
includeProviders=basic,iap,ldap,oauth2,saml,x509
korkVersion=7.59.0
kotlinVersion=1.3.71
korkVersion=7.60.4
kotlinVersion=1.4.0
org.gradle.parallel=true
spinnakerGradleVersion=8.5.0

Expand Down
2 changes: 1 addition & 1 deletion gradle/kotlin-test.gradle
Expand Up @@ -38,7 +38,7 @@ test {

compileTestKotlin {
kotlinOptions {
languageVersion = "1.3"
languageVersion = "1.4"
jvmTarget = "1.8"
}
}
8 changes: 3 additions & 5 deletions gradle/kotlin.gradle
Expand Up @@ -14,22 +14,20 @@
* limitations under the License.
*/

apply plugin: "nebula.kotlin"
apply plugin: "kotlin"
apply plugin: "kotlin-spring"

compileKotlin {
kotlinOptions {
languageVersion = "1.3"
languageVersion = "1.4"
jvmTarget = "1.8"
freeCompilerArgs += ["-progressive"]
}
}

compileTestKotlin {
kotlinOptions {
languageVersion = "1.3"
languageVersion = "1.4"
jvmTarget = "1.8"
freeCompilerArgs += ["-progressive"]
}
}

Expand Down

0 comments on commit ab06a31

Please sign in to comment.