Skip to content

Commit 15b9a59

Browse files
authored
chore: only trace rbac.Filter (coder#4177)
1 parent 95aea10 commit 15b9a59

File tree

2 files changed

+0
-12
lines changed

2 files changed

+0
-12
lines changed

coderd/rbac/authz.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,6 @@ func (a RegoAuthorizer) ByRoleName(ctx context.Context, subjectID string, roleNa
131131
// Authorize allows passing in custom Roles.
132132
// This is really helpful for unit testing, as we can create custom roles to exercise edge cases.
133133
func (a RegoAuthorizer) Authorize(ctx context.Context, subjectID string, roles []Role, scope Role, action Action, object Object) error {
134-
ctx, span := tracing.StartSpan(ctx)
135-
defer span.End()
136-
137134
input := map[string]interface{}{
138135
"subject": authSubject{
139136
ID: subjectID,
@@ -179,9 +176,6 @@ func (a RegoAuthorizer) Authorize(ctx context.Context, subjectID string, roles [
179176
// Prepare will partially execute the rego policy leaving the object fields unknown (except for the type).
180177
// This will vastly speed up performance if batch authorization on the same type of objects is needed.
181178
func (RegoAuthorizer) Prepare(ctx context.Context, subjectID string, roles []Role, scope Role, action Action, objectType string) (*PartialAuthorizer, error) {
182-
ctx, span := tracing.StartSpan(ctx)
183-
defer span.End()
184-
185179
auth, err := newPartialAuthorizer(ctx, subjectID, roles, scope, action, objectType)
186180
if err != nil {
187181
return nil, xerrors.Errorf("new partial authorizer: %w", err)
@@ -191,9 +185,6 @@ func (RegoAuthorizer) Prepare(ctx context.Context, subjectID string, roles []Rol
191185
}
192186

193187
func (a RegoAuthorizer) PrepareByRoleName(ctx context.Context, subjectID string, roleNames []string, scope Scope, action Action, objectType string) (PreparedAuthorized, error) {
194-
ctx, span := tracing.StartSpan(ctx)
195-
defer span.End()
196-
197188
roles, err := RolesByNames(roleNames)
198189
if err != nil {
199190
return nil, err

coderd/rbac/partial.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ type PartialAuthorizer struct {
2828
var _ PreparedAuthorized = (*PartialAuthorizer)(nil)
2929

3030
func (pa *PartialAuthorizer) Authorize(ctx context.Context, object Object) error {
31-
ctx, span := tracing.StartSpan(ctx)
32-
defer span.End()
33-
3431
if pa.alwaysTrue {
3532
return nil
3633
}

0 commit comments

Comments
 (0)