(callExpr *exprproto.Expr_Call, factors *QueryExportFactors)
| 239 | } |
| 240 | |
| 241 | func findField(callExpr *exprproto.Expr_Call, factors *QueryExportFactors) { |
| 242 | if callExpr == nil { |
| 243 | return |
| 244 | } |
| 245 | if len(callExpr.Args) == 2 { |
| 246 | idExpr := callExpr.Args[0].GetIdentExpr() |
| 247 | if idExpr != nil { |
| 248 | if idExpr.Name == CELAttributeResourceDatabase && callExpr.Function == "_==_" { |
| 249 | factors.Databases = append(factors.Databases, callExpr.Args[1].GetConstExpr().GetStringValue()) |
| 250 | } |
| 251 | if idExpr.Name == CELAttributeResourceDatabase && callExpr.Function == "@in" { |
| 252 | list := callExpr.Args[1].GetListExpr() |
| 253 | for _, element := range list.Elements { |
| 254 | factors.Databases = append(factors.Databases, element.GetConstExpr().GetStringValue()) |
| 255 | } |
| 256 | } |
| 257 | return |
| 258 | } |
| 259 | } |
| 260 | for _, arg := range callExpr.Args { |
| 261 | callExpr := arg.GetCallExpr() |
| 262 | findField(callExpr, factors) |
| 263 | } |
| 264 | } |
| 265 | |
| 266 | func EvalBindingCondition(expr string, requestTime time.Time) (bool, error) { |
| 267 | input := map[string]any{ |
no test coverage detected