authz: set authzv1.ReadResponse.Found (#91212)
Co-authored-by: Gabriel MABILLE <gabriel.mabille@grafana.com>
This commit is contained in:
co-authored by
Gabriel MABILLE
parent
66b1a219f4
commit
cf55ac5813
@@ -48,6 +48,8 @@ func (s *legacyServer) Read(ctx context.Context, req *authzv1.ReadRequest) (*aut
|
|||||||
ctx, span := s.tracer.Start(ctx, "authz.grpc.Read")
|
ctx, span := s.tracer.Start(ctx, "authz.grpc.Read")
|
||||||
defer span.End()
|
defer span.End()
|
||||||
|
|
||||||
|
// FIXME: once we have access tokens, we need to do namespace validation here
|
||||||
|
|
||||||
action := req.GetAction()
|
action := req.GetAction()
|
||||||
subject := req.GetSubject()
|
subject := req.GetSubject()
|
||||||
stackID := req.GetStackId() // TODO can we consider the stackID as the orgID?
|
stackID := req.GetStackId() // TODO can we consider the stackID as the orgID?
|
||||||
@@ -74,5 +76,8 @@ func (s *legacyServer) Read(ctx context.Context, req *authzv1.ReadRequest) (*aut
|
|||||||
for _, perm := range permissions {
|
for _, perm := range permissions {
|
||||||
data = append(data, &authzv1.ReadResponse_Data{Object: perm.Scope})
|
data = append(data, &authzv1.ReadResponse_Data{Object: perm.Scope})
|
||||||
}
|
}
|
||||||
return &authzv1.ReadResponse{Data: data}, nil
|
return &authzv1.ReadResponse{
|
||||||
|
Data: data,
|
||||||
|
Found: len(data) > 0,
|
||||||
|
}, nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user