Skip to content

Commit

Permalink
Major CSV changes and improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
UnknownJoe796 committed Mar 16, 2024
1 parent 27d21eb commit 60bb9d2
Show file tree
Hide file tree
Showing 22 changed files with 1,469 additions and 163 deletions.
33 changes: 33 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import com.sun.xml.fastinfoset.sax.Properties
import org.owasp.dependencycheck.gradle.extension.DependencyCheckExtension


buildscript {
Expand All @@ -7,16 +10,29 @@ buildscript {
// maven(url = "https://s01.oss.sonatype.org/content/repositories/snapshots/")
maven(url = "https://s01.oss.sonatype.org/content/repositories/releases/")
google()
gradlePluginPortal()
mavenCentral()
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
classpath("org.jetbrains.dokka:dokka-gradle-plugin:1.9.10")
classpath("com.lightningkite:deploy-helpers:0.0.7")
classpath("com.android.tools.build:gradle:7.4.2")
classpath("org.owasp:dependency-check-gradle:9.0.9")
classpath("com.github.ben-manes:gradle-versions-plugin:0.51.0")
}
}
val localProps = project.rootProject.file("local.properties").takeIf { it.exists() }?.inputStream()?.use { stream ->
java.util.Properties().apply { load(stream) }
}
allprojects {
apply(plugin = "org.owasp.dependencycheck")
apply(plugin = "com.github.ben-manes.versions")
configure<DependencyCheckExtension> {
localProps?.getProperty("nvdApiKey")?.let {
nvd.apiKey = it
}
}
group = "com.lightningkite.lightningserver"
repositories {
mavenLocal()
Expand All @@ -27,4 +43,21 @@ allprojects {

}
tasks.withType<Jar> { duplicatesStrategy = DuplicatesStrategy.EXCLUDE }
tasks.withType<DependencyUpdatesTask> {
rejectVersionIf {
isNonStable(candidate.version) && !isNonStable(currentVersion)
}
}
}
apply(plugin = "org.owasp.dependencycheck")
tasks.withType<DependencyUpdatesTask> {
rejectVersionIf {
isNonStable(candidate.version) && !isNonStable(currentVersion)
}
}
fun isNonStable(version: String): Boolean {
val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.uppercase().contains(it) }
val regex = "^[0-9,.v-]+(-r)?$".toRegex()
val isStable = stableKeyword || regex.matches(version)
return isStable.not()
}
2 changes: 0 additions & 2 deletions demo/src/main/kotlin/Server.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import com.lightningkite.lightningserver.db.*
import com.lightningkite.lightningserver.email.Email
import com.lightningkite.lightningserver.email.EmailLabeledValue
import com.lightningkite.lightningserver.email.EmailSettings
import com.lightningkite.lightningserver.email.SesClient
import com.lightningkite.lightningserver.encryption.secureHash
import com.lightningkite.lightningserver.exceptions.NotFoundException
import com.lightningkite.lightningserver.exceptions.SentryExceptionReporter
Expand Down Expand Up @@ -65,7 +64,6 @@ object Server : ServerPathGroup(ServerPath.root) {

init {
Metrics
SesClient
PostgresDatabase
DynamoDbCache
MongoDatabase
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kotlin.code.style=official

kspVersion=1.9.22-1.0.17
kotlinVersion=1.9.22
kotlinXSerialization=1.6.2
kotlinXSerialization=1.6.3
logBack=1.4.12
coroutines=1.7.3
ktorVersion=2.3.8

This file was deleted.

This file was deleted.

3 changes: 1 addition & 2 deletions server-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ dependencies {
api("org.jetbrains.kotlinx:kotlinx-html-jvm:0.8.0")

api("dev.turingcomplete:kotlin-onetimepassword:2.4.0")
api("com.lightningkite:kotlinx-serialization-csv:2.2.1")
api("org.jetbrains.kotlinx:kotlinx-serialization-properties:$kotlinXSerialization")
api("org.jetbrains.kotlinx:kotlinx-serialization-cbor:$kotlinXSerialization")
api("io.github.pdvrieze.xmlutil:serialization-jvm:0.86.3")
Expand All @@ -53,7 +52,7 @@ dependencies {
implementation("org.bouncycastle:bcprov-jdk18on:1.77")
implementation("org.bouncycastle:bcpkix-jdk18on:1.77")

api("org.apache.commons:commons-email:1.5")
api("org.eclipse.angus:angus-mail:2.0.3")

testImplementation("com.auth0:java-jwt:4.3.0")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,14 @@ import com.lightningkite.lightningserver.core.ContentType
import com.lightningkite.lightningserver.http.HttpContentAndHeaders
import com.lightningkite.lightningserver.http.HttpHeaders
import com.lightningkite.lightningserver.settings.generalSettings
import jakarta.activation.*
import jakarta.mail.*
import jakarta.mail.internet.*
import jakarta.mail.util.*
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.flow.flowOf
import java.util.*
import javax.activation.DataHandler
import javax.mail.Address
import javax.mail.Message
import javax.mail.Multipart
import javax.mail.Session
import javax.mail.internet.*
import javax.mail.util.ByteArrayDataSource


private suspend fun HttpContentAndHeaders.into(part: MimePart) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package com.lightningkite.lightningserver.email
import com.lightningkite.lightningserver.logger
import com.lightningkite.lightningserver.settings.generalSettings
import java.util.*
import javax.mail.Authenticator
import javax.mail.PasswordAuthentication
import javax.mail.Session
import javax.mail.Transport
import jakarta.mail.Authenticator
import jakarta.mail.PasswordAuthentication
import jakarta.mail.Session
import jakarta.mail.Transport

/**
* An email client that will send real emails through SMTP.
Expand Down
Loading

0 comments on commit 60bb9d2

Please sign in to comment.