feat(accounts): add consent settings and organization management
This commit is contained in:
1 parent
24638d46d2
commit
391af7a1ef
83 files changed
+10198
-613
No files matched your search
@@ -621,6 +621,15 @@ type Handler interface {
|
||||
//
|
||||
// GET /api/v1/me/privacy/preview
|
||||
GetMyCardPreview(ctx context.Context) (GetMyCardPreviewRes, error)
|
||||
// GetMyConsentText implements GetMyConsentText operation.
|
||||
//
|
||||
// Requires a verified session. Returns the current published text and version of c1, c2, c3, or c5 so
|
||||
// the user can read the exact text before an explicit settings grant. C4 is excluded: its text
|
||||
// includes an organization snapshot and it is granted only during invitation acceptance. The response
|
||||
// is private and is not cached.
|
||||
//
|
||||
// GET /api/v1/me/consent-texts/{purpose}
|
||||
GetMyConsentText(ctx context.Context, params GetMyConsentTextParams) (GetMyConsentTextRes, error)
|
||||
// GetMyInvitation implements GetMyInvitation operation.
|
||||
//
|
||||
// Requires the session cookie of a candidate account. The candidate comes from the session; the
|
||||
@@ -864,6 +873,20 @@ type Handler interface {
|
||||
//
|
||||
// GET /api/v1/specializations
|
||||
GetSpecializationCatalog(ctx context.Context) (*SpecializationCatalog, error)
|
||||
// GrantMyConsent implements GrantMyConsent operation.
|
||||
//
|
||||
// Requires a verified session, its CSRF token in X-CSRF-Token, and the exact configured Origin. The
|
||||
// subject comes from the session. The body names the current text version the user read and requires
|
||||
// `accepted: true`; the server verifies that version is still current and stores the hash of the exact
|
||||
// text. A stale version answers 400 validation_failed at `/text_version`, without writing a grant.
|
||||
//
|
||||
// C1 is available to candidate and employer accounts. C2, C3, and C5 are available only to candidate
|
||||
// accounts. C4 is excluded and can be granted only by accepting an invitation. A repeated grant of the
|
||||
// same current version returns the existing record; after revocation a grant creates a new record and
|
||||
// never reopens a publication or restores an older grant.
|
||||
//
|
||||
// PUT /api/v1/me/consents/{purpose}
|
||||
GrantMyConsent(ctx context.Context, req *ConsentSettingsGrantRequest, params GrantMyConsentParams) (GrantMyConsentRes, error)
|
||||
// HideOrganization implements HideOrganization operation.
|
||||
//
|
||||
// Requires the session cookie of a candidate account, the CSRF token of that session in X-CSRF-Token,
|
||||
@@ -945,8 +968,9 @@ type Handler interface {
|
||||
// value. A c2 record proves the consent to the publication text; the published field set and its
|
||||
// changes are evidence of the publication history.
|
||||
//
|
||||
// Granting c1, c2, c3, and c5 in the consent settings and revoking any purpose are planned operations
|
||||
// of this tag; c1 is given at registration and c4 only in AcceptMyInvitation.
|
||||
// Settings grants of c1, c2, c3, and c5 require the currently published text and an explicit
|
||||
// acceptance. Revoking c2, c3, or c5 is available in settings; c1 creates a durable account-deletion
|
||||
// request, and c4 is revoked only for one organization. C4 is granted only in AcceptMyInvitation.
|
||||
//
|
||||
// Access: a missing, unknown, expired, or revoked session answers 401 unauthenticated. A malformed
|
||||
// `limit`, `cursor`, or `state` answers 400 validation_failed.
|
||||
@@ -1210,6 +1234,16 @@ type Handler interface {
|
||||
//
|
||||
// POST /api/v1/identity/registrations
|
||||
RegisterAccount(ctx context.Context, req *RegistrationRequest, params RegisterAccountParams) (RegisterAccountRes, error)
|
||||
// RequestMyAccountDeletion implements RequestMyAccountDeletion operation.
|
||||
//
|
||||
// Requires a verified session, its CSRF token in X-CSRF-Token, and the exact configured Origin. The
|
||||
// subject comes from the session. In one transaction, revokes any active C1 record, creates or returns
|
||||
// the subject's active durable deletion request, and writes the outbox intent. The API does not delete
|
||||
// the account synchronously. Repeating the request returns the same active request; a later C1 grant
|
||||
// never cancels it.
|
||||
//
|
||||
// POST /api/v1/me/account-deletion-requests
|
||||
RequestMyAccountDeletion(ctx context.Context) (RequestMyAccountDeletionRes, error)
|
||||
// ResendEmailVerification implements ResendEmailVerification operation.
|
||||
//
|
||||
// Public operation without a session. The answer is the same 202 for an unknown email, a verified
|
||||
@@ -1226,6 +1260,31 @@ type Handler interface {
|
||||
//
|
||||
// POST /api/v1/identity/email-verification-requests
|
||||
ResendEmailVerification(ctx context.Context, req *EmailVerificationResendRequest) (ResendEmailVerificationRes, error)
|
||||
// RevokeMyConsent implements RevokeMyConsent operation.
|
||||
//
|
||||
// Requires a verified candidate session, its CSRF token in X-CSRF-Token, and the exact configured
|
||||
// Origin. The subject comes from the session. Revokes every unrevoked record of c2, c3, or c5,
|
||||
// including superseded records, and never changes another purpose. Repeating a revocation is harmless
|
||||
// and creates no duplicate event.
|
||||
//
|
||||
// Revoking c2 immediately closes the stored publication and records privacy history in the same
|
||||
// transaction; a downstream revocation intent is written to the outbox. A later c2 grant does not
|
||||
// reopen publication or restore old grants. Revoking c3 does not block the manual assessment path.
|
||||
// Revoking c5 makes the consent gate deny further FSP import and writes a durable stop/delete intent;
|
||||
// an external FSP deletion adapter is not available yet.
|
||||
//
|
||||
// DELETE /api/v1/me/consents/{purpose}
|
||||
RevokeMyConsent(ctx context.Context, params RevokeMyConsentParams) (RevokeMyConsentRes, error)
|
||||
// RevokeMyOrganizationContactConsent implements RevokeMyOrganizationContactConsent operation.
|
||||
//
|
||||
// Requires a verified candidate session, its CSRF token in X-CSRF-Token, and the exact configured
|
||||
// Origin. The subject comes from the session; `org_id` is the only scope the caller may choose. The
|
||||
// server revokes every unrevoked C4 record for this subject and organization, using the fields stored
|
||||
// on those records to request downstream grant revocation. It does not affect another organization.
|
||||
// Repeating the request is harmless and creates no duplicate event.
|
||||
//
|
||||
// DELETE /api/v1/me/consents/c4/organizations/{org_id}
|
||||
RevokeMyOrganizationContactConsent(ctx context.Context, params RevokeMyOrganizationContactConsentParams) (RevokeMyOrganizationContactConsentRes, error)
|
||||
// SaveMyProfile implements SaveMyProfile operation.
|
||||
//
|
||||
// Requires the session cookie of a candidate account, the CSRF token of that session in X-CSRF-Token,
|
||||
|
||||
Reference in new issue
Block a user