Skip to content

V2 OV: register a new Organization Representative from template parameters - #42

Open
spbsoluble wants to merge 2 commits into
feat/v2-spec-followupsfrom
feat/v2-ov-org-representative
Open

spbsoluble wants to merge 2 commits into
feat/v2-spec-followupsfrom
feat/v2-ov-org-representative

Conversation

@spbsoluble

Copy link
Copy Markdown
Collaborator

Plan: issues/0096-v2-followups-round2-plan.md, item 5 (item 6 in issues/0094). Stacked on #40, separate from #41 because it handles personal data.

What it does

  • New template parameters (V2, OV only): OrgRepresentativeName, OrgRepresentativeEmail, OrgRepresentativePhone, OrgRepresentativeDesignation, OrgRepresentativeEmployeeId. Name and Email together send organization.useNewOrgRepresentative: true plus organization.organizationRepresentative. Without them, both fields are omitted and the OV body is byte-identical to today (golden tests unchanged).
  • Validation: one helper (ValidateOrgRepresentativeParams) used by ValidateProductInfo at template save and by EnrollV2CoreAsync before any CA call. It mirrors the spec's create-description rules:
    • OV only: DV/EV/Private PKI are rejected (EMS-1315).
    • The connector needs OrganizationNumber (EMS-1316).
    • Name and email must both be set (EMS-1319/1320). This also applies when only phone, designation or employee ID is set, because the CA would otherwise drop them silently.
    • The email must pass LooksLikeEmailAddress.
    • The phone must have 6-15 digits, with an optional leading + and -.() (EMS-1321). There was no existing phone helper to reuse, so IsValidRepresentativePhone is new.
    • Messages name the parameter, never its value.
  • Response:
    • V2CreateOrderResponse.OrganizationRepresentativeStatus (applied / pending-approval) is logged at Information.
    • PendingOrganizationRepresentative is a raw JsonElement?, because its shape is undocumented and a typed mismatch would throw after the order exists. Only its presence is logged.
  • V1 and reissue: V1 ignores the parameters, with a warning at template save. A V2 reissue doesn't send the block (the reissue body has no organization) and logs that it didn't.

Personal data

  • Covered by existing keys: name, email, phone and designation already use the bare keys in PersonalOtherFieldNames/PersonalEmailFieldNames.
  • Added: employeeId, plus organizationRepresentative and pendingOrganizationRepresentative in case CERTInext ever returns either as a string.
  • Pre-existing leak, fixed here. Emails inside CA error text in logged bodies weren't masked. EMS-1317 ("that email is already a representative…") echoes the representative's address in problem+json detail. The exception message was masked, but the Warning-level CERTInext V2 API non-success … ResponseBody= line and the Trace response dump weren't. RedactPersonalData now masks emails inside detail/title/message/errorMessage string values, via a new LogSanitizer.MaskEmailsInText, which shares SanitizeCaText's regex. This affects every V2 error body, not just EMS-1317 (for example, a requestor email echoed in an error).

Testing

  • Unit tests: dotnet test CERTInext.Tests -c Release 1333 passed (baseline 1296 + 37 new); the DcvSupport=false build runs 1252, all passed.
  • Builds: dotnet build -c Release --no-incremental and the same with -p:DcvSupport=false, 0 warnings / 0 errors.
  • New tests:
    • V2OrgRepresentativeTests: rule matrix, phone rule, exact organization-block wire JSON, optional keys omitted, no-representative body unchanged, DV/EV fail-fast with no CA calls, the pending-approval log line, and no representative value in any plugin log line.
    • Create-response deserialization of an arbitrary pending shape, plus ValidateProductInfo reject/accept.
    • RedactPersonalDataTests: the request block, the pending response, and a string-valued block.
    • ClientPayloadLogRedactionTests: a new V2 WireMock section covering the Trace request/response dumps with the flag off and on, and a 422 EMS-1317 echo with no unmasked email in any client line.

Live

Not run. A live OV order needs an SSL.com-validated organization, the sandbox reports NOT_SUBMITTED, and the plan says to ask first. Unit, WireMock and golden-body tests are the proof.

Open questions / for review

  • The spec's SslOrganizationRepresentative also lists an empty boolean, which looks like a Java serializer artifact. It's never sent. Should CERTInext be asked about it?
  • The spec gives pendingOrganizationRepresentative no schema. Should it be added to analysis/v2-api-support-questions.md as a question?
  • I chose a V1 warning (not a rejection) at save, matching how other V2-only template parameters behave on V1.
  • The manifest's enrollment_config entries carry only name/description, like every existing entry. I didn't add the required/example/default keys the plan mentions, because no other enrollment parameter has them.

spbsoluble and others added 2 commits November 15, 2026 12:19
… parameters

OrgRepresentativeName/Email (together) plus optional Phone/Designation/EmployeeId send
organization.useNewOrgRepresentative=true with an organizationRepresentative block on
a V2 OV create. ValidateProductInfo and EnrollV2CoreAsync share one check that mirrors
CERTInext's rules before any CA call: OV only (EMS-1315), a pre-vetted organization
(EMS-1316), name and email together (EMS-1319/1320), one email, phone 6-15 digits
(EMS-1321). Error messages name parameters, never values. V1 ignores them (warns at
save); a reissue doesn't send them. The create response's
organizationRepresentativeStatus is logged; pendingOrganizationRepresentative is kept
raw (undocumented shape) and only its presence logged.

Personal data: employeeId and the block keys join PersonalOtherFieldNames, and emails
inside CA error text (detail/title/message/errorMessage) in logged bodies are now
masked; an EMS-1317 error echoing the representative's email used to reach the
Warning-level V2 non-success line unmasked.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant