Files
twofauth-rs/compatibility/cases.admin-sharing.json
wt cf25e28c28
Rust verification / test (push) Successful in 4m10s
initial commit
2026-10-28 15:59:54 +07:00

716 lines
15 KiB
JSON

[
{
"id": "fresh-csrf",
"path": "/refresh-csrf",
"expected_status": 200,
"expect_text_token": true
},
{
"id": "login-admin",
"path": "/user/login",
"method": "POST",
"expected_status": 200,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
},
"json": {
"email": "admin@example.invalid",
"password": "Synthetic-compat-password-4620"
},
"capture_json": {
"admin_id": "/id"
}
},
{
"id": "last-admin-demote-denied",
"path": "/api/v1/users/{{admin_id}}/promote",
"method": "PATCH",
"expected_status": 403,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
},
"json": {
"is_admin": false
}
},
{
"id": "last-admin-delete-denied",
"path": "/api/v1/users/{{admin_id}}",
"method": "DELETE",
"expected_status": 403,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
}
},
{
"id": "recipient-admin-read",
"path": "/api/v1/users/3",
"method": "GET",
"expected_status": 200,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
},
"capture_json": {
"recipient_id": "/info/id"
},
"ignore_json_pointers": [
"/info/id",
"/info/last_seen_at",
"/info/created_at"
]
},
{
"id": "admin-create-user",
"path": "/api/v1/users",
"method": "POST",
"expected_status": 201,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
},
"json": {
"name": "Managed",
"email": "managed@example.invalid",
"password": "Synthetic-managed-password-4620",
"password_confirmation": "Synthetic-managed-password-4620",
"is_admin": false
},
"capture_json": {
"managed_id": "/info/id"
},
"ignore_json_pointers": [
"/info/id",
"/info/last_seen_at",
"/info/created_at"
]
},
{
"id": "promote-user",
"path": "/api/v1/users/{{managed_id}}/promote",
"method": "PATCH",
"expected_status": 200,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
},
"json": {
"is_admin": true
},
"ignore_json_pointers": [
"/info/id",
"/info/last_seen_at",
"/info/created_at"
]
},
{
"id": "demote-user",
"path": "/api/v1/users/{{managed_id}}/promote",
"method": "PATCH",
"expected_status": 200,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
},
"json": {
"is_admin": false
},
"ignore_json_pointers": [
"/info/id",
"/info/last_seen_at",
"/info/created_at"
]
},
{
"id": "revoke-empty-pats",
"path": "/api/v1/users/{{managed_id}}/pats",
"method": "DELETE",
"expected_status": 204,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
}
},
{
"id": "delete-managed-user",
"path": "/api/v1/users/{{managed_id}}",
"method": "DELETE",
"expected_status": 204,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
}
},
{
"id": "custom-setting-create",
"path": "/api/v1/settings",
"method": "POST",
"expected_status": 201,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
},
"json": {
"key": "compatCustom",
"value": "first"
}
},
{
"id": "custom-setting-read",
"path": "/api/v1/settings/compatCustom",
"method": "GET",
"expected_status": 200,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
}
},
{
"id": "custom-setting-update",
"path": "/api/v1/settings/compatCustom",
"method": "PUT",
"expected_status": 200,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
},
"json": {
"value": "second"
}
},
{
"id": "custom-setting-delete",
"path": "/api/v1/settings/compatCustom",
"method": "DELETE",
"expected_status": 204,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
}
},
{
"id": "custom-setting-deleted",
"path": "/api/v1/settings/compatCustom",
"method": "GET",
"expected_status": 404,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
}
},
{
"id": "owner-create-hotp",
"path": "/api/v1/twofaccounts",
"method": "POST",
"expected_status": 201,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
},
"json": {
"service": "compat-sharing",
"account": "fixture@example.invalid",
"otp_type": "hotp",
"secret": "GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ",
"digits": 6,
"algorithm": "sha1",
"counter": 0
},
"capture_json": {
"shared_id": "/id"
},
"ignore_json_pointers": [
"/id"
]
},
{
"id": "setting-useEncryption-True",
"path": "/api/v1/settings/useEncryption",
"method": "PUT",
"expected_status": 200,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
},
"json": {
"value": true
}
},
{
"id": "encrypted-account-read",
"path": "/api/v1/twofaccounts/{{shared_id}}",
"method": "GET",
"expected_status": 200,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
},
"ignore_json_pointers": [
"/id"
]
},
{
"id": "setting-useEncryption-False",
"path": "/api/v1/settings/useEncryption",
"method": "PUT",
"expected_status": 200,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
},
"json": {
"value": false
}
},
{
"id": "decrypted-account-read",
"path": "/api/v1/twofaccounts/{{shared_id}}",
"method": "GET",
"expected_status": 200,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
},
"ignore_json_pointers": [
"/id"
]
},
{
"id": "setting-enableSharing-True",
"path": "/api/v1/settings/enableSharing",
"method": "PUT",
"expected_status": 200,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
},
"json": {
"value": true
}
},
{
"id": "setting-enableAllUsersSharingScope-True",
"path": "/api/v1/settings/enableAllUsersSharingScope",
"method": "PUT",
"expected_status": 200,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
},
"json": {
"value": true
}
},
{
"id": "share-explicit-recipient",
"path": "/api/v1/twofaccounts/{{shared_id}}/shares",
"method": "POST",
"expected_status": 201,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
},
"json": {
"user_ids": [
"{{recipient_id}}"
]
},
"ignore_json_pointers": [
"/twofaccount_id"
]
},
{
"id": "logout-owner",
"path": "/user/logout",
"method": "GET",
"expected_status": 200,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
}
},
{
"id": "refresh-before-recipient",
"path": "/refresh-csrf",
"expected_status": 200,
"expect_text_token": true
},
{
"id": "login-recipient",
"path": "/user/login",
"method": "POST",
"expected_status": 200,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
},
"json": {
"email": "recipient@example.invalid",
"password": "Synthetic-compat-password-4620"
}
},
{
"id": "recipient-read-secret-hidden",
"path": "/api/v1/twofaccounts/{{shared_id}}",
"method": "GET",
"expected_status": 200,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
},
"ignore_json_pointers": [
"/id"
],
"absent_json_pointers": [
"/secret"
]
},
{
"id": "recipient-export-denied",
"path": "/api/v1/twofaccounts/export?ids={{shared_id}}",
"method": "GET",
"expected_status": 403,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
}
},
{
"id": "recipient-hotp",
"path": "/api/v1/twofaccounts/{{shared_id}}/otp",
"method": "GET",
"expected_status": 200,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
},
"expected_json": {
"/password": "755224"
}
},
{
"id": "recipient-visible-count",
"path": "/api/v1/twofaccounts/count",
"method": "GET",
"expected_status": 200,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
},
"expected_json": {
"/owned": 0,
"/shared": 1,
"/total": 1
}
},
{
"id": "recipient-group-create",
"path": "/api/v1/groups",
"method": "POST",
"expected_status": 201,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
},
"json": {
"name": "Borrowed group",
"show_in_chips": true
},
"capture_json": {
"recipient_group": "/id"
},
"ignore_json_pointers": [
"/id"
]
},
{
"id": "recipient-group-assign",
"path": "/api/v1/groups/{{recipient_group}}/assign",
"method": "POST",
"expected_status": 200,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
},
"json": {
"ids": [
"{{shared_id}}"
]
},
"ignore_json_pointers": [
"/id"
],
"expected_json": {
"/twofaccounts_count": 1
}
},
{
"id": "recipient-group-read",
"path": "/api/v1/groups/{{recipient_group}}",
"method": "GET",
"expected_status": 200,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
},
"ignore_json_pointers": [
"/id"
],
"expected_json": {
"/twofaccounts_count": 0
}
},
{
"id": "recipient-group-index-count",
"path": "/api/v1/groups",
"method": "GET",
"expected_status": 200,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
},
"ignore_json_pointers": [
"/1/id"
],
"expected_json": {
"/1/twofaccounts_count": 1
}
},
{
"id": "logout-recipient",
"path": "/user/logout",
"method": "GET",
"expected_status": 200,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
}
},
{
"id": "refresh-before-admin",
"path": "/refresh-csrf",
"expected_status": 200,
"expect_text_token": true
},
{
"id": "login-admin",
"path": "/user/login",
"method": "POST",
"expected_status": 200,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
},
"json": {
"email": "admin@example.invalid",
"password": "Synthetic-compat-password-4620"
}
},
{
"id": "owner-group-independence",
"path": "/api/v1/twofaccounts/{{shared_id}}",
"method": "GET",
"expected_status": 200,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
},
"ignore_json_pointers": [
"/id"
],
"expected_json": {
"/group_id": null
}
},
{
"id": "owner-transfer-self-validation",
"path": "/api/v1/twofaccounts/{{shared_id}}/owner",
"method": "PATCH",
"expected_status": 422,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
},
"json": {
"new_owner_id": "{{admin_id}}",
"confirm_password": "Synthetic-compat-password-4620"
}
},
{
"id": "revoke-explicit-share",
"path": "/api/v1/twofaccounts/{{shared_id}}/shares/{{recipient_id}}",
"method": "DELETE",
"expected_status": 204,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
}
},
{
"id": "logout-owner",
"path": "/user/logout",
"method": "GET",
"expected_status": 200,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
}
},
{
"id": "refresh-before-recipient",
"path": "/refresh-csrf",
"expected_status": 200,
"expect_text_token": true
},
{
"id": "login-recipient",
"path": "/user/login",
"method": "POST",
"expected_status": 200,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
},
"json": {
"email": "recipient@example.invalid",
"password": "Synthetic-compat-password-4620"
}
},
{
"id": "recipient-after-revocation",
"path": "/api/v1/twofaccounts/{{shared_id}}",
"method": "GET",
"expected_status": 403,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
}
},
{
"id": "logout-recipient",
"path": "/user/logout",
"method": "GET",
"expected_status": 200,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
}
},
{
"id": "refresh-before-admin",
"path": "/refresh-csrf",
"expected_status": 200,
"expect_text_token": true
},
{
"id": "login-admin",
"path": "/user/login",
"method": "POST",
"expected_status": 200,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
},
"json": {
"email": "admin@example.invalid",
"password": "Synthetic-compat-password-4620"
}
},
{
"id": "share-all-scope",
"path": "/api/v1/twofaccounts/{{shared_id}}/shares/all",
"method": "POST",
"expected_status": 201,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
},
"json": {},
"ignore_json_pointers": [
"/twofaccount_id"
]
},
{
"id": "logout-owner",
"path": "/user/logout",
"method": "GET",
"expected_status": 200,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
}
},
{
"id": "refresh-before-recipient",
"path": "/refresh-csrf",
"expected_status": 200,
"expect_text_token": true
},
{
"id": "login-recipient",
"path": "/user/login",
"method": "POST",
"expected_status": 200,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
},
"json": {
"email": "recipient@example.invalid",
"password": "Synthetic-compat-password-4620"
}
},
{
"id": "recipient-all-scope-read",
"path": "/api/v1/twofaccounts/{{shared_id}}",
"method": "GET",
"expected_status": 200,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
},
"ignore_json_pointers": [
"/id"
],
"absent_json_pointers": [
"/secret"
]
},
{
"id": "logout-recipient",
"path": "/user/logout",
"method": "GET",
"expected_status": 200,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
}
},
{
"id": "refresh-before-admin",
"path": "/refresh-csrf",
"expected_status": 200,
"expect_text_token": true
},
{
"id": "login-admin",
"path": "/user/login",
"method": "POST",
"expected_status": 200,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
},
"json": {
"email": "admin@example.invalid",
"password": "Synthetic-compat-password-4620"
}
},
{
"id": "revoke-all-shares",
"path": "/api/v1/twofaccounts/{{shared_id}}/shares",
"method": "DELETE",
"expected_status": 204,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
}
},
{
"id": "delete-shared-account",
"path": "/api/v1/twofaccounts/{{shared_id}}",
"method": "DELETE",
"expected_status": 204,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
}
},
{
"id": "setting-enableSharing-False",
"path": "/api/v1/settings/enableSharing",
"method": "PUT",
"expected_status": 200,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
},
"json": {
"value": false
}
},
{
"id": "setting-enableAllUsersSharingScope-False",
"path": "/api/v1/settings/enableAllUsersSharingScope",
"method": "PUT",
"expected_status": 200,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
},
"json": {
"value": false
}
},
{
"id": "logout-admin",
"path": "/user/logout",
"method": "GET",
"expected_status": 200,
"headers_from_cookies": {
"X-XSRF-TOKEN": "XSRF-TOKEN"
}
}
]