Repository navigation
Conversation
Adds src/server: POST /v1/redact takes a PDF and the candidate's known contact values, redacts in text mode with OpenAI, checks the output has no text or links, and returns the PDF with timing, detection and version headers. Known LinkedIn and GitHub URLs also match the dash-joined tails of their slug, so a profile URL that wrapped onto a second line no longer leaves half of it readable. Concurrency and queue length are capped, and a token can be required. The Dockerfile installs fonts-liberation: with no fonts, every measured character width is zero, boxes drift by a character, and the first letter of an email stays visible. Signed-off-by: XploY04 <2004agarwalyash@gmail.com>
Leaks: - Pages with images, form fields or annotations get a vision pass for the text targets (opaqueContent: 'vision'). Findings cover the whole field or annotation, or the image under the model's rectangle grown by one cell. No vision support for such a page is a 422. - Known LinkedIn/GitHub URLs also match a slug tail wrapped after the dash, at the start of a line, and one-word slugs with a digit, underscore or 8+ characters. The whole slug only matches after "/" or with a digit, so hyphenated names stay readable. - Word boxes use pdf.js's resolved font class instead of its internal font id. Monospace runs are split evenly, and serif and sans are measured with Liberation by name, which fixes the first letter of a Courier email showing. - Rotated text is boxed along its rotation. Over-redaction: - redact-identifying hides link text only for mailto:, tel:, social profiles (not repositories or LinkedIn company pages), and custom targets, instead of every URL. - URL patterns skip ASP.NET, Socket.IO, B.Tech and similar; the handle target skips annotations, decorators and npm scopes. - Known values that cannot be what they claim are dropped. Server: - Model replies are constrained to the requested target ids, and failed model calls are logged by name and status only. - A request deadline, a per-call model timeout with no SDK retries, and an abort when the client hangs up, logged as 499. - A slot is reserved on arrival and the body is read only once the request has one, so a full queue holds no bodies in memory. - Base image pinned by digest, plus a HEALTHCHECK. Signed-off-by: XploY04 <2004agarwalyash@gmail.com>
The service left the name readable on purpose. Clients must not see it before an introduction is accepted, so it is now a target: the model looks for the name, and a new known.names field gives exact patterns for the name the caller holds. The full name matches in any case and either order; a word of four or more letters also matches on its own when written as a name, so a candidate called Dev or Mark does not blank ordinary text. Signed-off-by: XploY04 <2004agarwalyash@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Adds an HTTP server and Dockerfile so rsredact can run as a cluster service, the way rsparse does. The Rumero backend calls it when a company views a candidate's CV or a CV is attached to an email.
POST /v1/redact: multipartfile(PDF, up to 25 MiB) and optionalknownJSON (emails,phones,urls): the candidate's own contact values, matched exactly, including LinkedIn/GitHub slug pieces that wrap onto a second line.X-Rsredact-Duration-Ms,-Model-Ms,-Llm-Calls,-Detections,-Version.GET /healthz, optional bearer token (RSREDACT_API_TOKEN), capped concurrency and queue (RSREDACT_MAX_CONCURRENCY), per-request deadline, work aborted when the client disconnects.fonts-liberation(without fonts, boxes drifted and left characters readable).Second commit fixes an independent review: images and form fields with contact details, the slug wrap after the hyphen, monospace box drift, rotated text, over-redaction of hyperlinked employers/certifications and of
B.Tech/ASP.NET/@RestController, validation ofknown, model text in logs and headers, disconnect handling, timeouts and memory while queued.Checks
npm test: 47 pass, 1 skipped (the live OpenAI test, no key in CI).docker buildand a read-only, non-root container run.