github.com/pachyderm/pachyderm@v1.13.4/src/client/auth.go (about)

     1  package client
     2  
     3  import (
     4  	"context"
     5  
     6  	"github.com/pachyderm/pachyderm/src/client/auth"
     7  	"github.com/pachyderm/pachyderm/src/client/pkg/grpcutil"
     8  )
     9  
    10  // IsAuthActive returns whether auth is activated on the cluster
    11  func (c APIClient) IsAuthActive() (bool, error) {
    12  	_, err := c.GetAdmins(context.Background(), &auth.GetAdminsRequest{})
    13  	switch {
    14  	case auth.IsErrNotSignedIn(err):
    15  		return true, nil
    16  	case auth.IsErrNotActivated(err):
    17  		return false, nil
    18  	default:
    19  		return false, grpcutil.ScrubGRPC(err)
    20  	}
    21  }