module Session.KeyRotation
  ( KeyRotation (..)
  ) where

import Internal.Prelude

-- | /Key rotation/ means we delete the session on the server
--   and copy the stored data into a new session with a different key.
data KeyRotation
  = -- | Generate a new session key and invalidate the old one
    RotateSessionKey
  deriving stock (KeyRotation -> KeyRotation -> Bool
(KeyRotation -> KeyRotation -> Bool)
-> (KeyRotation -> KeyRotation -> Bool) -> Eq KeyRotation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: KeyRotation -> KeyRotation -> Bool
== :: KeyRotation -> KeyRotation -> Bool
$c/= :: KeyRotation -> KeyRotation -> Bool
/= :: KeyRotation -> KeyRotation -> Bool
Eq, Eq KeyRotation
Eq KeyRotation =>
(KeyRotation -> KeyRotation -> Ordering)
-> (KeyRotation -> KeyRotation -> Bool)
-> (KeyRotation -> KeyRotation -> Bool)
-> (KeyRotation -> KeyRotation -> Bool)
-> (KeyRotation -> KeyRotation -> Bool)
-> (KeyRotation -> KeyRotation -> KeyRotation)
-> (KeyRotation -> KeyRotation -> KeyRotation)
-> Ord KeyRotation
KeyRotation -> KeyRotation -> Bool
KeyRotation -> KeyRotation -> Ordering
KeyRotation -> KeyRotation -> KeyRotation
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: KeyRotation -> KeyRotation -> Ordering
compare :: KeyRotation -> KeyRotation -> Ordering
$c< :: KeyRotation -> KeyRotation -> Bool
< :: KeyRotation -> KeyRotation -> Bool
$c<= :: KeyRotation -> KeyRotation -> Bool
<= :: KeyRotation -> KeyRotation -> Bool
$c> :: KeyRotation -> KeyRotation -> Bool
> :: KeyRotation -> KeyRotation -> Bool
$c>= :: KeyRotation -> KeyRotation -> Bool
>= :: KeyRotation -> KeyRotation -> Bool
$cmax :: KeyRotation -> KeyRotation -> KeyRotation
max :: KeyRotation -> KeyRotation -> KeyRotation
$cmin :: KeyRotation -> KeyRotation -> KeyRotation
min :: KeyRotation -> KeyRotation -> KeyRotation
Ord, Int -> KeyRotation -> ShowS
[KeyRotation] -> ShowS
KeyRotation -> String
(Int -> KeyRotation -> ShowS)
-> (KeyRotation -> String)
-> ([KeyRotation] -> ShowS)
-> Show KeyRotation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> KeyRotation -> ShowS
showsPrec :: Int -> KeyRotation -> ShowS
$cshow :: KeyRotation -> String
show :: KeyRotation -> String
$cshowList :: [KeyRotation] -> ShowS
showList :: [KeyRotation] -> ShowS
Show, ReadPrec [KeyRotation]
ReadPrec KeyRotation
Int -> ReadS KeyRotation
ReadS [KeyRotation]
(Int -> ReadS KeyRotation)
-> ReadS [KeyRotation]
-> ReadPrec KeyRotation
-> ReadPrec [KeyRotation]
-> Read KeyRotation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS KeyRotation
readsPrec :: Int -> ReadS KeyRotation
$creadList :: ReadS [KeyRotation]
readList :: ReadS [KeyRotation]
$creadPrec :: ReadPrec KeyRotation
readPrec :: ReadPrec KeyRotation
$creadListPrec :: ReadPrec [KeyRotation]
readListPrec :: ReadPrec [KeyRotation]
Read, KeyRotation
KeyRotation -> KeyRotation -> Bounded KeyRotation
forall a. a -> a -> Bounded a
$cminBound :: KeyRotation
minBound :: KeyRotation
$cmaxBound :: KeyRotation
maxBound :: KeyRotation
Bounded, Int -> KeyRotation
KeyRotation -> Int
KeyRotation -> [KeyRotation]
KeyRotation -> KeyRotation
KeyRotation -> KeyRotation -> [KeyRotation]
KeyRotation -> KeyRotation -> KeyRotation -> [KeyRotation]
(KeyRotation -> KeyRotation)
-> (KeyRotation -> KeyRotation)
-> (Int -> KeyRotation)
-> (KeyRotation -> Int)
-> (KeyRotation -> [KeyRotation])
-> (KeyRotation -> KeyRotation -> [KeyRotation])
-> (KeyRotation -> KeyRotation -> [KeyRotation])
-> (KeyRotation -> KeyRotation -> KeyRotation -> [KeyRotation])
-> Enum KeyRotation
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: KeyRotation -> KeyRotation
succ :: KeyRotation -> KeyRotation
$cpred :: KeyRotation -> KeyRotation
pred :: KeyRotation -> KeyRotation
$ctoEnum :: Int -> KeyRotation
toEnum :: Int -> KeyRotation
$cfromEnum :: KeyRotation -> Int
fromEnum :: KeyRotation -> Int
$cenumFrom :: KeyRotation -> [KeyRotation]
enumFrom :: KeyRotation -> [KeyRotation]
$cenumFromThen :: KeyRotation -> KeyRotation -> [KeyRotation]
enumFromThen :: KeyRotation -> KeyRotation -> [KeyRotation]
$cenumFromTo :: KeyRotation -> KeyRotation -> [KeyRotation]
enumFromTo :: KeyRotation -> KeyRotation -> [KeyRotation]
$cenumFromThenTo :: KeyRotation -> KeyRotation -> KeyRotation -> [KeyRotation]
enumFromThenTo :: KeyRotation -> KeyRotation -> KeyRotation -> [KeyRotation]
Enum)