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
type PDCPCredentials ¶
type PDCPUserProfileResponse ¶
type PDCPUserProfileResponse struct {
UserName string `json:"name"`
}
type UploadWriter ¶
type UploadWriter struct { *output.StandardWriter // contains filtered or unexported fields }
UploadWriter is a writer that uploads its output to pdcp server to enable web dashboard and more
func NewUploadWriter ¶
func NewUploadWriter(creds *PDCPCredentials) (*UploadWriter, error)
NewUploadWriter creates a new upload writer
func (*UploadWriter) Upload ¶
func (u *UploadWriter) Upload()
Upload uploads the results to pdcp server