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
1 change: 0 additions & 1 deletion licensing/src/main/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ softclient4es {
key = ${?SOFTCLIENT4ES_LICENSE_KEY}
api-key = ""
api-key = ${?SOFTCLIENT4ES_API_KEY}
api-url = "https://license.softclient4es.com"
connect-timeout = 10s
read-timeout = 10s

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import scala.concurrent.duration._
case class LicenseConfig(
key: Option[String],
apiKey: Option[String],
apiUrl: String,
connectTimeout: FiniteDuration,
readTimeout: FiniteDuration,
refreshEnabled: Boolean,
Expand Down Expand Up @@ -53,7 +52,6 @@ object LicenseConfig {

val gracePeriod = license.getDuration("grace-period").toMillis.millis

val apiUrl = license.getString("api-url")
val connectTimeout = license.getDuration("connect-timeout").toMillis.millis
val readTimeout = license.getDuration("read-timeout").toMillis.millis

Expand All @@ -62,7 +60,6 @@ object LicenseConfig {
LicenseConfig(
key = key,
apiKey = apiKey,
apiUrl = apiUrl,
connectTimeout = connectTimeout,
readTimeout = readTimeout,
refreshEnabled = refreshEnabled,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class LicenseConfigSpec extends AnyFlatSpec with Matchers {
cfg.refreshInterval shouldBe 24.hours
cfg.telemetryEnabled shouldBe true
cfg.gracePeriod shouldBe 14.days
cfg.apiUrl shouldBe "https://license.softclient4es.com"
cfg.cacheDir should include(".softclient4es")
}

Expand Down Expand Up @@ -90,11 +89,6 @@ class LicenseConfigSpec extends AnyFlatSpec with Matchers {
cfg.gracePeriod shouldBe 7.days
}

"custom api-url" should "be parsed correctly" in {
val cfg = configFrom("""softclient4es.license.api-url = "https://custom.example.com" """)
cfg.apiUrl shouldBe "https://custom.example.com"
}

"custom cache-dir" should "be parsed correctly" in {
val cfg = configFrom("""softclient4es.license.cache-dir = "/tmp/test-cache" """)
cfg.cacheDir shouldBe "/tmp/test-cache"
Expand All @@ -111,13 +105,11 @@ class LicenseConfigSpec extends AnyFlatSpec with Matchers {
}
telemetry.enabled = false
grace-period = 30d
api-url = "https://staging.license.softclient4es.com"
cache-dir = "/opt/licenses"
}
""")
cfg.key shouldBe Some("eyJ.test.jwt")
cfg.apiKey shouldBe Some("sk-custom")
cfg.apiUrl shouldBe "https://staging.license.softclient4es.com"
cfg.refreshEnabled shouldBe false
cfg.refreshInterval shouldBe 6.hours
cfg.telemetryEnabled shouldBe false
Expand Down
Loading