github.com/ActiveState/cli@v0.0.0-20240508170324-6801f60cd051/pkg/platform/api/vulnerabilities/vulnerabilities.go (about)

     1  package vulnerabilities
     2  
     3  import (
     4  	"github.com/ActiveState/cli/internal/gqlclient"
     5  	"github.com/ActiveState/cli/pkg/platform/api"
     6  	"github.com/ActiveState/cli/pkg/platform/authentication"
     7  )
     8  
     9  func New(auth *authentication.Auth) *gqlclient.Client {
    10  	client := gqlclient.New(api.GetServiceURL(api.ServiceVulnerabilities).String(), 0)
    11  
    12  	// Most requests to this service require authentication
    13  	if auth != nil && auth.Authenticated() {
    14  		client.SetTokenProvider(auth)
    15  	}
    16  
    17  	return client
    18  }