All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.gu.play.secretrotation.TransitionTiming.scala Maven / Gradle / Ivy

package com.gu.play.secretrotation

import java.time.{Duration, Instant}

import org.threeten.extra.Interval

/**
  * @param overlapDuration how long old secrets will be accepted after the new secret is actively used
  * @param usageDelay don't use a new secret too quickly, other boxes need time to notice
  */
case class TransitionTiming(
  overlapDuration: Duration,
  usageDelay: Duration
) {
  def overlapIntervalForSecretPublishedAt(instant: Instant): Interval =
    Interval.of(instant.plus(usageDelay), overlapDuration)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy