(binding: Binding)
| 32 | import { ensureUserFullName } from "@/utils/v1/user"; |
| 33 | |
| 34 | export const isBindingPolicyExpired = (binding: Binding): boolean => { |
| 35 | if (binding.parsedExpr) { |
| 36 | const conditionExpr = convertFromExpr(binding.parsedExpr); |
| 37 | if (conditionExpr.expiredTime) { |
| 38 | const expiration = new Date(conditionExpr.expiredTime); |
| 39 | if (expiration < new Date()) { |
| 40 | return true; |
| 41 | } |
| 42 | } |
| 43 | } |
| 44 | return false; |
| 45 | }; |
| 46 | |
| 47 | // Revoke a single member from one specific role binding, returning a new policy |
| 48 | // (the input is left untouched). |
no test coverage detected