Documentation ¶
Overview ¶
pdcp contains projectdiscovery cloud platform related features like result upload , dashboard etc.
Index ¶
Constants ¶
const (
ApiKeyHeaderName = "X-Api-Key"
)
Variables ¶
var ( DashBoardURL = "https://cloud.projectdiscovery.io" DefaultApiServer = "https://api.projectdiscovery.io" )
var ( PDCPDir = filepath.Join(folderutil.HomeDirOrDefault(""), ".pdcp") PDCPCredFile = filepath.Join(PDCPDir, "credentials.yaml") ErrNoCreds = fmt.Errorf("no credentials found in %s", PDCPDir) )
Functions ¶
func CheckNValidateCredentials ¶
func CheckNValidateCredentials(toolName string)
CheckNValidateCredentials checks if credentials exist on filesystem if not waits for user to enter credentials and validates them and saves them to filesystem when validate is true any existing credentials are validated Note: this is meant to be used in cli only (interactive mode)
Types ¶
type PDCPCredHandler ¶
type PDCPCredHandler struct{}
PDCPCredHandler is interface for adding / retrieving pdcp credentials from file system
func (*PDCPCredHandler) GetCreds ¶
func (p *PDCPCredHandler) GetCreds() (*PDCPCredentials, error)
GetCreds retrieves the credentials from the file system or environment variables
func (*PDCPCredHandler) SaveCreds ¶
func (p *PDCPCredHandler) SaveCreds(resp *PDCPCredentials) error
SaveCreds saves the credentials to the file system
func (*PDCPCredHandler) ValidateAPIKey ¶
func (p *PDCPCredHandler) ValidateAPIKey(key string, host string, toolName string) (*PDCPCredentials, error)
ValidateAPIKey validates the api key and retrieves associated user metadata like username from given api server/host