feat: terms of service and versioned consent; data rights for every account
ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
ci / lint (pull_request) Successful in 9m21s
ci / test (pull_request) Successful in 13m53s
ci / build (pull_request) Successful in 11m22s
ci / image (pull_request) Successful in 4m36s
ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
ci / lint (pull_request) Successful in 9m21s
ci / test (pull_request) Successful in 13m53s
ci / build (pull_request) Successful in 11m22s
ci / image (pull_request) Successful in 4m36s
Terms of service join the legal notice and privacy policy, for the platform only. Every account accepts the platform's privacy policy and terms: on sign-up (also through an invitation) by ticking a box for the versions shown, and after a sign-in through a provider right away. When an admin saves a material change with "everyone has to accept again", the document gets a new version and each account is asked at its next request; corrections ask nobody. Acceptances are kept per version with their time, as proof, and are part of the data export. Until an account accepted, and while it is suspended, it can read the documents, export its data, delete itself and sign out, nothing else: pages lead to /consent or /account/suspended, other API calls answer 403 consent_required or account_suspended. Suspended accounts therefore sign in again, by password or provider; their API tokens stay blocked. Deleting an account deletes the organizations it owns, monitors and all, also when they have other members (each organization has one owner); it no longer refuses. The account settings name those organizations first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
1 parent
61fdfa830a
commit
8d7c1f856c
38 files changed
+2033
-354
No files matched your search
@@ -140,7 +140,8 @@ func TestModeration(t *testing.T) {
|
||||
t.Error("a heartbeat after reinstatement is not recorded")
|
||||
}
|
||||
|
||||
// A suspended account is signed out and kept out, tokens included.
|
||||
// A suspended account is signed out, its tokens stop working, and
|
||||
// signing in again only lets it export or delete its data.
|
||||
suspend("users/"+userID, true, "")
|
||||
if st, _ := owner.do("GET", "/api/v1/me", nil); st != http.StatusUnauthorized {
|
||||
t.Errorf("session of a suspended account = %d", st)
|
||||
@@ -149,8 +150,11 @@ func TestModeration(t *testing.T) {
|
||||
t.Errorf("token of a suspended account = %d", st)
|
||||
}
|
||||
fresh := e.browser(t)
|
||||
st, body = fresh.do("POST", "/api/v1/auth/login", map[string]any{"email": ownerEmail, "password": testPassword})
|
||||
expect(t, "sign-in of a suspended account", st, body, http.StatusForbidden, "account_suspended")
|
||||
if st, body := fresh.do("POST", "/api/v1/auth/login", map[string]any{"email": ownerEmail, "password": testPassword}); st != http.StatusOK {
|
||||
t.Errorf("sign-in of a suspended account = %d %v", st, body)
|
||||
}
|
||||
st, body = fresh.do("GET", "/api/v1/org/monitors", nil)
|
||||
expect(t, "API of a suspended account", st, body, http.StatusForbidden, "account_suspended")
|
||||
if st, _ := e.browser(t).do("POST", "/api/v1/auth/login", map[string]any{"email": ownerEmail, "password": "wrong password"}); st != http.StatusUnauthorized {
|
||||
t.Error("a wrong password reveals the suspension")
|
||||
}
|
||||
@@ -165,12 +169,6 @@ func TestModeration(t *testing.T) {
|
||||
st, body = admin.do("DELETE", "/api/v1/admin/users/"+admin.userIDSelf().String(), nil)
|
||||
expect(t, "delete an admin", st, body, http.StatusConflict, "target_is_admin")
|
||||
|
||||
// An owner of a shared organization cannot be deleted before it.
|
||||
fresh.do("POST", "/api/v1/me/org", map[string]any{"org_id": orgID})
|
||||
e.joinVia(t, fresh.invite("m@"+uniq("mod")+".test", fresh.roleID("viewer")))
|
||||
st, body = admin.do("DELETE", "/api/v1/admin/users/"+userID, nil)
|
||||
expect(t, "delete the owner of a shared org", st, body, http.StatusConflict, "owns_shared_orgs")
|
||||
|
||||
// Deleting: page, organization, account.
|
||||
if st, _ := admin.do("DELETE", "/api/v1/admin/status-pages/"+page["id"].(string), nil); st != http.StatusNoContent || served() {
|
||||
t.Errorf("delete page = %d", st)
|
||||
|
||||
Reference in new issue
Block a user