def this()

in pan-domain-auth-verification/src/main/scala/com/gu/pandomainauth/PublicSettings.scala [20:44]


  def this(settingsFileKey: String, bucketName: String, s3Client: AmazonS3,
    scheduler: ScheduledExecutorService = Executors.newScheduledThreadPool(1)) = this(
    new Settings.Loader(S3BucketLoader.forAwsSdkV1(s3Client, bucketName), settingsFileKey), scheduler
  )

  private val settingsRefresher = new Settings.Refresher[Verification](
    loader,
    CryptoConf.SettingsReader(_).verificationConf,
    identity,
    scheduler
  )

  def start(interval: Duration = ofMinutes(1)): Unit = settingsRefresher.start(interval)

  def verification: Verification = settingsRefresher.get()

  @deprecated("Use `verification` instead, to allow smooth transition to new public keys")
  def publicKey: PublicKey = verification.activePublicKey
}

/**
 * Static PublicSettings for applications that do not want to use the provided mechanism for auto-refreshing
 * public data.
 */
object PublicSettings {