feat(consent): add versioned append-only consent ledger C1-C5

This commit is contained in:
shira committed 2026-10-06 14:52:33 +03:00
1 parent 008254e44a
commit de49f93b0b
64 files changed
+9244 -132

No files matched your search

@@ -792,6 +792,38 @@ func (UnimplementedHandler) GetSpecializationCatalog(ctx context.Context) (r *Sp
return r, ht.ErrNotImplemented
}
// ListMyConsents implements ListMyConsents operation.
//
// Requires the session cookie of a candidate or an employer account. The subject comes from the
// session, never from a request parameter, so the response holds only the caller's own consents: no
// request can name another account, and records of other accounts are never listed. Returns a page of
// the consent ledger of the account, newest grant first with the identifier as the tie-breaker, with
// cursor pagination.
//
// The ledger is append-only. Every grant is a record with its purpose, the accepted text version, the
// source, and the grant time; the server also stores the hash of exactly the text the subject saw. A
// newer text version of the same purpose is a new record, and the earlier one becomes `superseded`
// without any change. A revocation stamps every unrevoked record of the purpose, and for c4 of one
// organization, once; a later grant is a new record. Purposes are independent.
//
// Without `state` the page lists the whole history; `state=active` lists the consents that hold now,
// one per purpose for c1, c2, c3, and c5 and one per accepted invitation for c4. A c4 record names the
// organization with the name its consent text showed (a snapshot that a later rename does not change),
// the selected contact fields, and the invitation with its terms version; it never carries a contact
// value. A c2 record proves the consent to the publication text; the published field set and its
// changes are evidence of the publication history (TASK-088).
//
// Granting c1, c2, c3, and c5 in the consent settings and revoking any purpose are planned operations
// of this tag (TASK-063 and TASK-064); c1 is given at registration and c4 only in AcceptMyInvitation.
//
// Access: a missing, unknown, expired, or revoked session answers 401 unauthenticated. A malformed
// `limit`, `cursor`, or `state` answers 400 validation_failed.
//
// GET /api/v1/me/consents
func (UnimplementedHandler) ListMyConsents(ctx context.Context, params ListMyConsentsParams) (r ListMyConsentsRes, _ error) {
return r, ht.ErrNotImplemented
}
// ListMyInvitations implements ListMyInvitations operation.
//
// Requires the session cookie of a candidate account. The candidate comes from the session, never from