Move SudoPrivilege out of SystemView (#7266)

* Move SudoPrivilege out of SystemView

We only use this in token store and it literally doesn't work anything
that isn't the token store or system mount, so we should stop exposing
something that doesn't work.

* Reconcile extended system view with sdk/logical a bit and put an explanation for why SudoPrivilege isn't moved over
This commit is contained in:
Jeff Mitchell
2019-08-26 10:23:46 -04:00
committed by GitHub
parent df37fc3a46
commit 5559d40cf9
8 changed files with 208 additions and 385 deletions

View File

@@ -44,18 +44,6 @@ func (s *gRPCSystemViewClient) MaxLeaseTTL() time.Duration {
return time.Duration(reply.TTL)
}
func (s *gRPCSystemViewClient) SudoPrivilege(ctx context.Context, path string, token string) bool {
reply, err := s.client.SudoPrivilege(ctx, &pb.SudoPrivilegeArgs{
Path: path,
Token: token,
})
if err != nil {
return false
}
return reply.Sudo
}
func (s *gRPCSystemViewClient) Tainted() bool {
reply, err := s.client.Tainted(context.Background(), &pb.Empty{})
if err != nil {
@@ -177,13 +165,6 @@ func (s *gRPCSystemViewServer) MaxLeaseTTL(ctx context.Context, _ *pb.Empty) (*p
}, nil
}
func (s *gRPCSystemViewServer) SudoPrivilege(ctx context.Context, args *pb.SudoPrivilegeArgs) (*pb.SudoPrivilegeReply, error) {
sudo := s.impl.SudoPrivilege(ctx, args.Path, args.Token)
return &pb.SudoPrivilegeReply{
Sudo: sudo,
}, nil
}
func (s *gRPCSystemViewServer) Tainted(ctx context.Context, _ *pb.Empty) (*pb.TaintedReply, error) {
tainted := s.impl.Tainted()
return &pb.TaintedReply{