From 4a8e22314938f7ef4cf43e743c2aa904930f0c1e Mon Sep 17 00:00:00 2001 From: Ian Streeter Date: Mon, 25 Nov 2024 10:57:01 +0000 Subject: [PATCH] Users must accept Snowplow Limited Use License Agreement (#58) --- config/config.azure.minimal.hocon | 4 ++++ config/config.azure.reference.hocon | 5 +++++ config/config.kinesis.minimal.hocon | 4 ++++ config/config.kinesis.reference.hocon | 5 +++++ config/config.pubsub.minimal.hocon | 4 ++++ config/config.pubsub.reference.hocon | 5 +++++ modules/core/src/main/resources/reference.conf | 5 +++++ .../com.snowplowanalytics.snowplow.snowflake/Config.scala | 7 +++++-- .../snowplow/snowflake/KafkaConfigSpec.scala | 8 +++++--- .../snowplow/snowflake/KinesisConfigSpec.scala | 8 +++++--- .../snowplow/snowflake/PubsubConfigSpec.scala | 8 +++++--- 11 files changed, 52 insertions(+), 11 deletions(-) diff --git a/config/config.azure.minimal.hocon b/config/config.azure.minimal.hocon index bc7f114..cddcd44 100644 --- a/config/config.azure.minimal.hocon +++ b/config/config.azure.minimal.hocon @@ -1,4 +1,8 @@ { + "license" { + "accept": true + } + "input": { "topicName": "sp-dev-enriched" "bootstrapServers": "localhost:9092" diff --git a/config/config.azure.reference.hocon b/config/config.azure.reference.hocon index 55d1234..3e072fc 100644 --- a/config/config.azure.reference.hocon +++ b/config/config.azure.reference.hocon @@ -1,4 +1,9 @@ { + # -- Full license text available in LICENSE.md + "license" { + "accept": true + } + "input": { # -- kafka topic name for the source of enriched events "topicName": "sp-dev-enriched" diff --git a/config/config.kinesis.minimal.hocon b/config/config.kinesis.minimal.hocon index eb8819f..1c67024 100644 --- a/config/config.kinesis.minimal.hocon +++ b/config/config.kinesis.minimal.hocon @@ -1,4 +1,8 @@ { + "license" { + "accept": true + } + "input": { "streamName": "snowplow-enriched-events" } diff --git a/config/config.kinesis.reference.hocon b/config/config.kinesis.reference.hocon index 39c6094..c05033a 100644 --- a/config/config.kinesis.reference.hocon +++ b/config/config.kinesis.reference.hocon @@ -1,4 +1,9 @@ { + # -- Full license text available in LICENSE.md + "license" { + "accept": true + } + "input": { # -- kinesis stream for the source of enriched events "streamName": "snowplow-enriched-events" diff --git a/config/config.pubsub.minimal.hocon b/config/config.pubsub.minimal.hocon index 2277868..e972007 100644 --- a/config/config.pubsub.minimal.hocon +++ b/config/config.pubsub.minimal.hocon @@ -1,4 +1,8 @@ { + "license" { + "accept": true + } + "input": { "subscription": "projects/myproject/subscriptions/snowplow-enriched" } diff --git a/config/config.pubsub.reference.hocon b/config/config.pubsub.reference.hocon index 1edd907..c535421 100644 --- a/config/config.pubsub.reference.hocon +++ b/config/config.pubsub.reference.hocon @@ -1,4 +1,9 @@ { + # -- Full license text available in LICENSE.md + "license" { + "accept": true + } + "input": { # -- pubsub subscription for the source of enriched events "subscription": "projects/myproject/subscriptions/snowplow-enriched" diff --git a/modules/core/src/main/resources/reference.conf b/modules/core/src/main/resources/reference.conf index 731dfdb..53c3f5d 100644 --- a/modules/core/src/main/resources/reference.conf +++ b/modules/core/src/main/resources/reference.conf @@ -8,6 +8,11 @@ { + "license" { + "accept": "false" + "accept": ${?ACCEPT_LIMITED_USE_LICENSE} + } + "output": { "good": { "table": "events" diff --git a/modules/core/src/main/scala/com.snowplowanalytics.snowplow.snowflake/Config.scala b/modules/core/src/main/scala/com.snowplowanalytics.snowplow.snowflake/Config.scala index b7e40d2..c155707 100644 --- a/modules/core/src/main/scala/com.snowplowanalytics.snowplow.snowflake/Config.scala +++ b/modules/core/src/main/scala/com.snowplowanalytics.snowplow.snowflake/Config.scala @@ -22,7 +22,7 @@ import com.snowplowanalytics.iglu.core.circe.CirceIgluCodecs.schemaCriterionDeco import scala.concurrent.duration.FiniteDuration import scala.util.Try -import com.snowplowanalytics.snowplow.runtime.{HttpClient, Metrics => CommonMetrics, Retrying, Telemetry, Webhook} +import com.snowplowanalytics.snowplow.runtime.{AcceptedLicense, HttpClient, Metrics => CommonMetrics, Retrying, Telemetry, Webhook} import com.snowplowanalytics.snowplow.runtime.HealthProbe.decoders._ case class Config[+Source, +Sink]( @@ -34,7 +34,8 @@ case class Config[+Source, +Sink]( skipSchemas: List[SchemaCriterion], telemetry: Telemetry.Config, monitoring: Config.Monitoring, - http: Config.Http + http: Config.Http, + license: AcceptedLicense ) object Config { @@ -130,6 +131,8 @@ object Config { implicit val monitoringDecoder = deriveConfiguredDecoder[Monitoring] implicit val retriesDecoder = deriveConfiguredDecoder[Retries] implicit val httpDecoder = deriveConfiguredDecoder[Http] + implicit val licenseDecoder = + AcceptedLicense.decoder(AcceptedLicense.DocumentationLink("https://docs.snowplow.io/limited-use-license-1.1/")) deriveConfiguredDecoder[Config[Source, Sink]] } diff --git a/modules/kafka/src/test/scala/com/snowplowanalytics/snowplow/snowflake/KafkaConfigSpec.scala b/modules/kafka/src/test/scala/com/snowplowanalytics/snowplow/snowflake/KafkaConfigSpec.scala index 45c3f67..d61825e 100644 --- a/modules/kafka/src/test/scala/com/snowplowanalytics/snowplow/snowflake/KafkaConfigSpec.scala +++ b/modules/kafka/src/test/scala/com/snowplowanalytics/snowplow/snowflake/KafkaConfigSpec.scala @@ -16,7 +16,7 @@ import cats.effect.{ExitCode, IO} import com.comcast.ip4s.Port import com.snowplowanalytics.iglu.core.SchemaCriterion import com.snowplowanalytics.snowplow.runtime.Metrics.StatsdConfig -import com.snowplowanalytics.snowplow.runtime.{ConfigParser, HttpClient, Retrying, Telemetry, Webhook} +import com.snowplowanalytics.snowplow.runtime.{AcceptedLicense, ConfigParser, HttpClient, Retrying, Telemetry, Webhook} import com.snowplowanalytics.snowplow.sinks.kafka.KafkaSinkConfig import com.snowplowanalytics.snowplow.snowflake.Config.Snowflake import com.snowplowanalytics.snowplow.sources.kafka.KafkaSourceConfig @@ -133,7 +133,8 @@ object KafkaConfigSpec { healthProbe = Config.HealthProbe(port = Port.fromInt(8000).get, unhealthyLatency = 5.minutes), webhook = Webhook.Config(endpoint = None, tags = Map.empty, heartbeat = 5.minutes) ), - http = Config.Http(HttpClient.Config(maxConnectionsPerServer = 4)) + http = Config.Http(HttpClient.Config(maxConnectionsPerServer = 4)), + license = AcceptedLicense() ) /** @@ -233,6 +234,7 @@ object KafkaConfigSpec { webhook = Webhook.Config(endpoint = Some(uri"https://webhook.acme.com"), tags = Map("pipeline" -> "production"), heartbeat = 60.minutes) ), - http = Config.Http(HttpClient.Config(maxConnectionsPerServer = 4)) + http = Config.Http(HttpClient.Config(maxConnectionsPerServer = 4)), + license = AcceptedLicense() ) } diff --git a/modules/kinesis/src/test/scala/com/snowplowanalytics/snowplow/snowflake/KinesisConfigSpec.scala b/modules/kinesis/src/test/scala/com/snowplowanalytics/snowplow/snowflake/KinesisConfigSpec.scala index 8d45251..e666149 100644 --- a/modules/kinesis/src/test/scala/com/snowplowanalytics/snowplow/snowflake/KinesisConfigSpec.scala +++ b/modules/kinesis/src/test/scala/com/snowplowanalytics/snowplow/snowflake/KinesisConfigSpec.scala @@ -16,7 +16,7 @@ import cats.effect.{ExitCode, IO} import com.comcast.ip4s.Port import com.snowplowanalytics.iglu.core.SchemaCriterion import com.snowplowanalytics.snowplow.runtime.Metrics.StatsdConfig -import com.snowplowanalytics.snowplow.runtime.{ConfigParser, HttpClient, Retrying, Telemetry, Webhook} +import com.snowplowanalytics.snowplow.runtime.{AcceptedLicense, ConfigParser, HttpClient, Retrying, Telemetry, Webhook} import com.snowplowanalytics.snowplow.sinks.kinesis.{BackoffPolicy, KinesisSinkConfig} import com.snowplowanalytics.snowplow.snowflake.Config.Snowflake import com.snowplowanalytics.snowplow.sources.kinesis.KinesisSourceConfig @@ -129,7 +129,8 @@ object KinesisConfigSpec { healthProbe = Config.HealthProbe(port = Port.fromInt(8000).get, unhealthyLatency = 5.minutes), webhook = Webhook.Config(endpoint = None, tags = Map.empty, heartbeat = 5.minutes) ), - http = Config.Http(HttpClient.Config(maxConnectionsPerServer = 4)) + http = Config.Http(HttpClient.Config(maxConnectionsPerServer = 4)), + license = AcceptedLicense() ) /** @@ -224,6 +225,7 @@ object KinesisConfigSpec { webhook = Webhook.Config(endpoint = Some(uri"https://webhook.acme.com"), tags = Map("pipeline" -> "production"), heartbeat = 60.minutes) ), - http = Config.Http(HttpClient.Config(maxConnectionsPerServer = 4)) + http = Config.Http(HttpClient.Config(maxConnectionsPerServer = 4)), + license = AcceptedLicense() ) } diff --git a/modules/pubsub/src/test/scala/com/snowplowanalytics/snowplow/snowflake/PubsubConfigSpec.scala b/modules/pubsub/src/test/scala/com/snowplowanalytics/snowplow/snowflake/PubsubConfigSpec.scala index 90821dc..b327c2c 100644 --- a/modules/pubsub/src/test/scala/com/snowplowanalytics/snowplow/snowflake/PubsubConfigSpec.scala +++ b/modules/pubsub/src/test/scala/com/snowplowanalytics/snowplow/snowflake/PubsubConfigSpec.scala @@ -17,7 +17,7 @@ import com.comcast.ip4s.Port import com.snowplowanalytics.iglu.core.SchemaCriterion import com.snowplowanalytics.snowplow.pubsub.GcpUserAgent import com.snowplowanalytics.snowplow.runtime.Metrics.StatsdConfig -import com.snowplowanalytics.snowplow.runtime.{ConfigParser, HttpClient, Retrying, Telemetry, Webhook} +import com.snowplowanalytics.snowplow.runtime.{AcceptedLicense, ConfigParser, HttpClient, Retrying, Telemetry, Webhook} import com.snowplowanalytics.snowplow.sinks.pubsub.PubsubSinkConfig import com.snowplowanalytics.snowplow.snowflake.Config.Snowflake import com.snowplowanalytics.snowplow.sources.pubsub.PubsubSourceConfig @@ -129,7 +129,8 @@ object PubsubConfigSpec { healthProbe = Config.HealthProbe(port = Port.fromInt(8000).get, unhealthyLatency = 5.minutes), webhook = Webhook.Config(endpoint = None, tags = Map.empty, heartbeat = 5.minutes) ), - http = Config.Http(HttpClient.Config(maxConnectionsPerServer = 4)) + http = Config.Http(HttpClient.Config(maxConnectionsPerServer = 4)), + license = AcceptedLicense() ) /** @@ -223,6 +224,7 @@ object PubsubConfigSpec { webhook = Webhook.Config(endpoint = Some(uri"https://webhook.acme.com"), tags = Map("pipeline" -> "production"), heartbeat = 60.minutes) ), - http = Config.Http(HttpClient.Config(maxConnectionsPerServer = 4)) + http = Config.Http(HttpClient.Config(maxConnectionsPerServer = 4)), + license = AcceptedLicense() ) }