pdcp

package
v0.0.92 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 15 Imported by: 10

Documentation

Overview

pdcp contains projectdiscovery cloud platform related features like result upload , dashboard etc.

Index

Constants

View Source
const (
	ApiKeyHeaderName = "X-Api-Key"
)

Variables

View Source
var (
	DashBoardURL     = "https://cloud.projectdiscovery.io"
	DefaultApiServer = "https://api.projectdiscovery.io"
)
View Source
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 PDCPCredentials struct {
	Username string `yaml:"username"`
	Email    string `yaml:"email"`
	APIKey   string `yaml:"api-key"`
	Server   string `yaml:"server"`
}

type PDCPUserProfileResponse

type PDCPUserProfileResponse struct {
	UserName string `json:"name"`
	Email    string `json:"email"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL