MCPcopy Index your code
hub / github.com/coder/coder / Prepare

Method Prepare

coderd/coderdtest/authorize.go:307–324  ·  view source on GitHub ↗
(ctx context.Context, subject rbac.Subject, action policy.Action, objectType string)

Source from the content-addressed store, hash-verified

305}
306
307func (r *RecordingAuthorizer) Prepare(ctx context.Context, subject rbac.Subject, action policy.Action, objectType string) (rbac.PreparedAuthorized, error) {
308 r.RLock()
309 defer r.RUnlock()
310 if r.Wrapped == nil {
311 panic("Developer error: RecordingAuthorizer.Wrapped is nil")
312 }
313
314 prep, err := r.Wrapped.Prepare(ctx, subject, action, objectType)
315 if err != nil {
316 return nil, err
317 }
318 return &PreparedRecorder{
319 rec: r,
320 prepped: prep,
321 subject: subject,
322 action: action,
323 }, nil
324}
325
326// Reset clears the recorded Authorize() calls.
327func (r *RecordingAuthorizer) Reset() {

Callers 1

TestAuthzRecorderFunction · 0.95

Calls 1

PrepareMethod · 0.65

Tested by 1

TestAuthzRecorderFunction · 0.76