PreparedRecorder is the prepared version of the RecordingAuthorizer. It records the Authorize() calls to the original recorder. If the caller uses CompileToSQL, all recording stops. This is to support parity between memory and SQL backed dbs.
| 335 | // uses CompileToSQL, all recording stops. This is to support parity between |
| 336 | // memory and SQL backed dbs. |
| 337 | type PreparedRecorder struct { |
| 338 | rec *RecordingAuthorizer |
| 339 | prepped rbac.PreparedAuthorized |
| 340 | subject rbac.Subject |
| 341 | action policy.Action |
| 342 | |
| 343 | rw sync.Mutex |
| 344 | usingSQL bool |
| 345 | } |
| 346 | |
| 347 | func (s *PreparedRecorder) Authorize(ctx context.Context, object rbac.Object) error { |
| 348 | s.rw.Lock() |
nothing calls this directly
no outgoing calls
no test coverage detected