diff --git a/cloudapi-common/build.gradle.kts b/cloudapi-common/build.gradle.kts index 40be325..cc0e175 100644 --- a/cloudapi-common/build.gradle.kts +++ b/cloudapi-common/build.gradle.kts @@ -1,3 +1,5 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + plugins { id("java") @@ -63,8 +65,17 @@ dependencies { testImplementation("org.junit.jupiter:junit-jupiter:5.8.1") testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.1") testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.1") + implementation(kotlin("stdlib-jdk8")) } tasks.getByName("test") { useJUnitPlatform() } +val compileKotlin: KotlinCompile by tasks +compileKotlin.kotlinOptions { + jvmTarget = "1.8" +} +val compileTestKotlin: KotlinCompile by tasks +compileTestKotlin.kotlinOptions { + jvmTarget = "1.8" +} \ No newline at end of file diff --git a/cloudapi-model/build.gradle.kts b/cloudapi-model/build.gradle.kts index 98e7420..2b70739 100644 --- a/cloudapi-model/build.gradle.kts +++ b/cloudapi-model/build.gradle.kts @@ -1,3 +1,5 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + plugins { id("java") kotlin("jvm") @@ -20,8 +22,17 @@ dependencies { testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.1") testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.1") + implementation(kotlin("stdlib-jdk8")) } tasks.getByName("test") { useJUnitPlatform() } +val compileKotlin: KotlinCompile by tasks +compileKotlin.kotlinOptions { + jvmTarget = "1.8" +} +val compileTestKotlin: KotlinCompile by tasks +compileTestKotlin.kotlinOptions { + jvmTarget = "1.8" +} \ No newline at end of file diff --git a/cloudapi-web/build.gradle.kts b/cloudapi-web/build.gradle.kts index cbf338b..65368bb 100644 --- a/cloudapi-web/build.gradle.kts +++ b/cloudapi-web/build.gradle.kts @@ -1,3 +1,5 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + val kotlin_version: String by project plugins { @@ -81,6 +83,7 @@ dependencies { // test testImplementation("org.jetbrains.kotlin:kotlin-test:$kotlin_version") + implementation(kotlin("stdlib-jdk8")) } tasks { @@ -99,3 +102,11 @@ tasks { useJUnitPlatform() } } +val compileKotlin: KotlinCompile by tasks +compileKotlin.kotlinOptions { + jvmTarget = "1.8" +} +val compileTestKotlin: KotlinCompile by tasks +compileTestKotlin.kotlinOptions { + jvmTarget = "1.8" +} \ No newline at end of file diff --git a/cloudapi-web/src/main/kotlin/cn/edu/buaa/scs/service/Auth.kt b/cloudapi-web/src/main/kotlin/cn/edu/buaa/scs/service/Auth.kt index 1b5685c..6e73863 100644 --- a/cloudapi-web/src/main/kotlin/cn/edu/buaa/scs/service/Auth.kt +++ b/cloudapi-web/src/main/kotlin/cn/edu/buaa/scs/service/Auth.kt @@ -136,7 +136,7 @@ class AuthService(val call: ApplicationCall) : IService { private suspend fun afterLogin(token: String, user: User): LoginUserResponse { if (user.paasToken.isBlank()) { - call.project.createUser(user.id) +// call.project.createUser(user.id) } // insert token in redis (just for compatibility with older platforms) @@ -291,7 +291,7 @@ class AuthService(val call: ApplicationCall) : IService { user.acceptTime = System.currentTimeMillis().toString() user.flushChanges() - call.project.createUser(user) +// call.project.createUser(user) return afterLogin(generateRSAToken(user.id), user) } diff --git a/cloudapi-web/src/main/kotlin/cn/edu/buaa/scs/vm/vcenter/VCenterClient.kt b/cloudapi-web/src/main/kotlin/cn/edu/buaa/scs/vm/vcenter/VCenterClient.kt index dc2bffe..b1cff89 100644 --- a/cloudapi-web/src/main/kotlin/cn/edu/buaa/scs/vm/vcenter/VCenterClient.kt +++ b/cloudapi-web/src/main/kotlin/cn/edu/buaa/scs/vm/vcenter/VCenterClient.kt @@ -21,6 +21,8 @@ import org.ktorm.dsl.and import org.ktorm.dsl.eq import org.ktorm.entity.find import org.ktorm.jackson.KtormModule +import java.security.cert.X509Certificate +import javax.net.ssl.X509TrustManager object VCenterClient : IVMClient { @@ -38,6 +40,15 @@ object VCenterClient : IVMClient { install(HttpTimeout) { requestTimeoutMillis = 10000L } + engine { + https { + trustManager = object : X509TrustManager { + override fun getAcceptedIssuers(): Array = arrayOf() + override fun checkClientTrusted(chain: Array, authType: String) {} + override fun checkServerTrusted(chain: Array, authType: String) {} + } + } + } }, basePath = globalConfig.vcenter.serviceUrl ) diff --git a/vcenter/build.gradle.kts b/vcenter/build.gradle.kts index b4a53e6..13a1f31 100644 --- a/vcenter/build.gradle.kts +++ b/vcenter/build.gradle.kts @@ -1,3 +1,5 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + plugins { id("java") application @@ -37,6 +39,7 @@ dependencies { testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.1") testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.1") + implementation(kotlin("stdlib-jdk8")) } tasks { @@ -55,3 +58,11 @@ tasks { useJUnitPlatform() } } +val compileKotlin: KotlinCompile by tasks +compileKotlin.kotlinOptions { + jvmTarget = "1.8" +} +val compileTestKotlin: KotlinCompile by tasks +compileTestKotlin.kotlinOptions { + jvmTarget = "1.8" +} \ No newline at end of file