test(backend): check company isolation and revocation over every org read
This commit is contained in:
1 parent
e367553d7c
commit
84454116f2
5 files changed
+837
-2
No files matched your search
@@ -1101,7 +1101,7 @@ Implemented: `GetOrganizationInvitationContacts` ([contract](../../api/README.en
|
||||
- Quota and audit. A successful read writes one `contact_read` row to `candidate_card_access_events` in the same transaction, with the granted kinds and never a value. It does not consume the card-view quota, because the contract does not count contact reads against it. The candidate's own history read stays a contract-only operation.
|
||||
- Not implemented: the candidate's cancellation, and the organization's withdrawal. `CurrentContactFields` in `usecase/candidateview` stays closed, because the card-handle read has no contract operation.
|
||||
|
||||
Tests: `domain/contact_disclosure_test.go` (confirmed values only, refused revoked grants, redacted formatting), `usecase/invitation/contacts_test.go` (owner and role checks, visibility, revoked grant and C4 record, unknown invitations), `usecase/invitation/contact_access_test.go` (the organization's states, their agreement with the read in each closing state, a blocked grant that opens once it is visible, and a revoked grant that never reopens), and the integration test `TestOrganizationContactReadsAndRevocationOverHTTP` over the real router and PostgreSQL. It covers the email-only read, the repeated read, the refusals of another organization, a recruiter, and a candidate, C4 revocation with an independent organization, hiding and unhiding without reopening, C2 revocation with republication, closing the publication, and the index. It also checks `contact_access` of the single read and of the list after each change, a declined invitation, and an expired one, which runs last because it moves the clock.
|
||||
Tests: `domain/contact_disclosure_test.go` (confirmed values only, refused revoked grants, redacted formatting), `usecase/invitation/contacts_test.go` (owner and role checks, visibility, revoked grant and C4 record, unknown invitations), `usecase/invitation/contact_access_test.go` (the organization's states, their agreement with the read in each closing state, a blocked grant that opens once it is visible, and a revoked grant that never reopens), and the integration test `TestOrganizationContactReadsAndRevocationOverHTTP` over the real router and PostgreSQL. It covers the email-only read, the repeated read, the refusals of another organization, a recruiter, and a candidate, C4 revocation with an independent organization, hiding and unhiding without reopening, C2 revocation with republication, closing the publication, and the index. It also checks `contact_access` of the single read and of the list after each change, a declined invitation, and an expired one, which runs last because it moves the clock. `TestCompanyIsolationAndRevocationOverHTTP` walks every organization-scoped operation of the minimal path with the valid session of another company, on the path of the owning company and on its own path with the identifiers from the owner's responses, and checks that each one answers the documented refusal, the same as for an identifier that does not exist, and changes nothing. It does the same for a candidate with the invitation and the notification of another candidate. It also checks that hiding the organization, revoking C4, and withdrawing C2 close the next card, evidence, draft, search, and contact read through the handles of an earlier search, that neither a new C2 nor a new publication revives a grant that C4 revocation closed, that the MVP serves no PDF, selection snapshot, or stored search result, and that the server log, the outbox payloads, the inbox rows, and the stored email requests carry no contact, name, or profile value of the candidates.
|
||||
|
||||
|
||||
## Frontend
|
||||
|
||||
Reference in new issue
Block a user