Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions apps/backend-go/internal/browserclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,13 +296,6 @@ func (c *Client) Extract(ctx context.Context, req ExtractRequest) (ExtractResult
return out, c.post(ctx, "/v1/extract", req, req.Timeout, &out)
}

// Holehe checks which sites an email is registered on.
func (c *Client) Holehe(ctx context.Context, req HoleheRequest) (HoleheResult, error) {
req.Timeout = clamp(req.Timeout, 60*time.Second)
var out HoleheResult
return out, c.post(ctx, "/v1/holehe", req, req.Timeout, &out)
}

// StaffSpy scrapes a company's LinkedIn roster.
func (c *Client) StaffSpy(ctx context.Context, req StaffSpyRequest) (StaffSpyResult, error) {
req.Timeout = clamp(req.Timeout, 180*time.Second)
Expand Down
2 changes: 0 additions & 2 deletions apps/backend-go/internal/browserclient/contract_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,6 @@ func endpoints() []endpoint {
{"post", "/v1/extract", ExtractRequest{HTML: "<p>x</p>", URL: "https://e.com/a", Engine: "browser",
IncludeMarkdown: true, MaxBytes: 4096, UpstreamProxy: "http://1.2.3.4:8080", Timeout: 20 * time.Second},
"ExtractRequest", &ExtractResult{}, "ExtractResult"},
{"post", "/v1/holehe", HoleheRequest{Email: "a@b.example", MaxModules: 10, UpstreamProxy: "http://1.2.3.4:8080",
Timeout: 30 * time.Second}, "HoleheRequest", &HoleheResult{}, "HoleheResult"},
{"post", "/v1/staffspy", StaffSpyRequest{CompanyName: "Acme", SearchTerm: "ceo", Location: "Pune", MaxResults: 5,
Cookies: li, UpstreamProxy: "http://1.2.3.4:8080", Timeout: 60 * time.Second},
"StaffSpyRequest", &StaffSpyResult{}, "StaffSpyResult"},
Expand Down
16 changes: 2 additions & 14 deletions apps/backend-go/internal/browserclient/recorded_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,21 +121,9 @@ func TestRecordedExtract(t *testing.T) {
}
}

func TestRecordedHoleheStaffSpyStats(t *testing.T) {
f := loadFixture(t, "holehe")
func TestRecordedStaffSpyStats(t *testing.T) {
f := loadFixture(t, "staffspy")
c, sent := replay(t, f)
h, err := c.Holehe(context.Background(), HoleheRequest{Email: "jane@acme.example"})
if err != nil {
t.Fatal(err)
}
sameRequest(t, "holehe", *sent, f.Request)
strict(t, "holehe", f.Response, &HoleheResult{})
if !reflect.DeepEqual(h.ExistsOn, []string{"twitter"}) || h.TotalChecked != 2 || !h.Sites[1].RateLimited {
t.Fatalf("%+v", h)
}

f = loadFixture(t, "staffspy")
c, sent = replay(t, f)
s, err := c.StaffSpy(context.Background(), StaffSpyRequest{CompanyName: "Acme",
Cookies: []Cookie{{Name: "li_at", Value: "x", Domain: ".linkedin.com"}}})
if err != nil {
Expand Down
247 changes: 0 additions & 247 deletions apps/backend-go/internal/browserclient/testdata/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -624,135 +624,6 @@
"title": "Health",
"type": "object"
},
"HoleheRequest": {
"additionalProperties": false,
"properties": {
"email": {
"maxLength": 254,
"minLength": 3,
"pattern": "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$",
"title": "Email",
"type": "string"
},
"max_modules": {
"default": 50,
"description": "legacy checked the first 50 modules",
"maximum": 200.0,
"minimum": 1.0,
"title": "Max Modules",
"type": "integer"
},
"timeout_s": {
"default": 60.0,
"maximum": 300.0,
"minimum": 5.0,
"title": "Timeout S",
"type": "number"
},
"upstream_proxy": {
"anyOf": [
{
"maxLength": 2048,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"description": "upstream proxy (http/socks5/socks4 URL) the caller chose for this request; egress still goes through the service's guard first. Never logged or stored.",
"title": "Upstream Proxy"
}
},
"required": [
"email"
],
"title": "HoleheRequest",
"type": "object"
},
"HoleheResult": {
"properties": {
"elapsed_ms": {
"title": "Elapsed Ms",
"type": "integer"
},
"email": {
"title": "Email",
"type": "string"
},
"errors": {
"description": "modules that raised",
"title": "Errors",
"type": "integer"
},
"exists_on": {
"items": {
"type": "string"
},
"title": "Exists On",
"type": "array"
},
"partial": {
"title": "Partial",
"type": "boolean"
},
"sites": {
"items": {
"$ref": "#/components/schemas/HoleheSite"
},
"title": "Sites",
"type": "array"
},
"total_checked": {
"title": "Total Checked",
"type": "integer"
}
},
"required": [
"email",
"sites",
"exists_on",
"total_checked",
"errors",
"partial",
"elapsed_ms"
],
"title": "HoleheResult",
"type": "object"
},
"HoleheSite": {
"properties": {
"domain": {
"title": "Domain",
"type": "string"
},
"exists": {
"title": "Exists",
"type": "boolean"
},
"method": {
"title": "Method",
"type": "string"
},
"name": {
"title": "Name",
"type": "string"
},
"rate_limited": {
"title": "Rate Limited",
"type": "boolean"
}
},
"required": [
"name",
"domain",
"method",
"exists",
"rate_limited"
],
"title": "HoleheSite",
"type": "object"
},
"JobBoardsRequest": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -2338,124 +2209,6 @@
"summary": "Health"
}
},
"/v1/holehe": {
"post": {
"operationId": "holehe_v1_holehe_post",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HoleheRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HoleheResult"
}
}
},
"description": "Successful Response"
},
"400": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorEnvelope"
}
}
},
"description": "Bad Request"
},
"401": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorEnvelope"
}
}
},
"description": "Unauthorized"
},
"403": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorEnvelope"
}
}
},
"description": "Forbidden"
},
"413": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorEnvelope"
}
}
},
"description": "Content Too Large"
},
"429": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorEnvelope"
}
}
},
"description": "Too Many Requests"
},
"500": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorEnvelope"
}
}
},
"description": "Internal Server Error"
},
"502": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorEnvelope"
}
}
},
"description": "Bad Gateway"
},
"503": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorEnvelope"
}
}
},
"description": "Service Unavailable"
},
"504": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorEnvelope"
}
}
},
"description": "Gateway Timeout"
}
},
"summary": "Holehe"
}
},
"/v1/render": {
"post": {
"operationId": "render_v1_render_post",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
"errors": {},
"ok": 2
},
"holehe": {
"calls": 1,
"errors": {},
"ok": 1
},
"search": {
"calls": 2,
"errors": {},
Expand Down
39 changes: 0 additions & 39 deletions apps/backend-go/internal/browserclient/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,45 +420,6 @@ type ExtractResult struct {
ElapsedMS int `json:"elapsed_ms"`
}

// ── holehe ──────────────────────────────────────────────────────────

// HoleheRequest is POST /v1/holehe. MaxModules zero means 50 (legacy).
// Timeout zero means 60 s.
type HoleheRequest struct {
Email string `json:"email"`
MaxModules int `json:"max_modules,omitempty"`
UpstreamProxy ProxyURL `json:"upstream_proxy,omitempty"`
Timeout time.Duration `json:"-"`
}

func (r HoleheRequest) MarshalJSON() ([]byte, error) {
type alias HoleheRequest
return json.Marshal(struct {
alias
TimeoutS float64 `json:"timeout_s,omitempty"`
}{alias(r), secs(r.Timeout)})
}

type HoleheSite struct {
Name string `json:"name"`
Domain string `json:"domain"`
Method string `json:"method"`
Exists bool `json:"exists"`
RateLimited bool `json:"rate_limited"`
}

// HoleheResult: raw per-site results in module order. The verdict mapping
// (legacy is_real = len(ExistsOn) >= 2, email_verify, confidence) is Go's.
type HoleheResult struct {
Email string `json:"email"`
Sites []HoleheSite `json:"sites"`
ExistsOn []string `json:"exists_on"`
TotalChecked int `json:"total_checked"`
Errors int `json:"errors"`
Partial bool `json:"partial"`
ElapsedMS int `json:"elapsed_ms"`
}

// ── staffspy ────────────────────────────────────────────────────────

// StaffSpyRequest is POST /v1/staffspy (503 engine_unavailable unless the
Expand Down
Loading
Loading