RefreshWindow
public struct RefreshWindow
Type that defines a time window used to identify excessive refresh calls. When enabled, prior to executing a
refresh, the AuthenticationInterceptor compares the timestamp history of previous refresh calls against the
RefreshWindow. If more refreshes have occurred within the refresh window than allowed, the refresh is
cancelled and an AuthorizationError.excessiveRefresh error is thrown.
-
TimeIntervaldefining the duration of the time window before the current time in which the number of refresh attempts is compared againstmaximumAttempts. For example, ifintervalis 30 seconds, then theRefreshWindowrepresents the past 30 seconds. If more attempts occurred in the past 30 seconds thanmaximumAttempts, an.excessiveRefresherror will be thrown.Declaration
Swift
public let interval: TimeInterval -
Total refresh attempts allowed within
intervalbefore throwing an.excessiveRefresherror.Declaration
Swift
public let maximumAttempts: Int -
Creates a
RefreshWindowinstance from the specifiedintervalandmaximumAttempts.Declaration
Swift
public init(interval: TimeInterval = 30.0, maximumAttempts: Int = 5)Parameters
intervalTimeIntervaldefining the duration of the time window before the current time.maximumAttemptsThe maximum attempts allowed within the
TimeInterval.
View on GitHub
Install in Dash