Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions cloudapi-common/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
id("java")

Expand Down Expand Up @@ -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>("test") {
useJUnitPlatform()
}
val compileKotlin: KotlinCompile by tasks
compileKotlin.kotlinOptions {
jvmTarget = "1.8"
}
val compileTestKotlin: KotlinCompile by tasks
compileTestKotlin.kotlinOptions {
jvmTarget = "1.8"
}
11 changes: 11 additions & 0 deletions cloudapi-model/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
id("java")
kotlin("jvm")
Expand All @@ -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>("test") {
useJUnitPlatform()
}
val compileKotlin: KotlinCompile by tasks
compileKotlin.kotlinOptions {
jvmTarget = "1.8"
}
val compileTestKotlin: KotlinCompile by tasks
compileTestKotlin.kotlinOptions {
jvmTarget = "1.8"
}
11 changes: 11 additions & 0 deletions cloudapi-web/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

val kotlin_version: String by project

plugins {
Expand Down Expand Up @@ -81,6 +83,7 @@ dependencies {

// test
testImplementation("org.jetbrains.kotlin:kotlin-test:$kotlin_version")
implementation(kotlin("stdlib-jdk8"))
}

tasks {
Expand All @@ -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"
}
4 changes: 2 additions & 2 deletions cloudapi-web/src/main/kotlin/cn/edu/buaa/scs/service/Auth.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -38,6 +40,15 @@ object VCenterClient : IVMClient {
install(HttpTimeout) {
requestTimeoutMillis = 10000L
}
engine {
https {
trustManager = object : X509TrustManager {
override fun getAcceptedIssuers(): Array<X509Certificate> = arrayOf()
override fun checkClientTrusted(chain: Array<X509Certificate>, authType: String) {}
override fun checkServerTrusted(chain: Array<X509Certificate>, authType: String) {}
}
}
}
},
basePath = globalConfig.vcenter.serviceUrl
)
Expand Down
11 changes: 11 additions & 0 deletions vcenter/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
id("java")
application
Expand Down Expand Up @@ -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 {
Expand All @@ -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"
}