2018-02-15 00:40:34 +01:00
|
|
|
table! {
|
|
|
|
attachments (id) {
|
2019-05-26 23:02:41 +02:00
|
|
|
id -> Text,
|
|
|
|
cipher_uuid -> Text,
|
2018-02-15 00:40:34 +01:00
|
|
|
file_name -> Text,
|
|
|
|
file_size -> Integer,
|
2019-05-20 21:12:41 +02:00
|
|
|
akey -> Nullable<Text>,
|
2018-02-15 00:40:34 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-10 01:00:55 +01:00
|
|
|
table! {
|
|
|
|
ciphers (uuid) {
|
2019-05-26 23:02:41 +02:00
|
|
|
uuid -> Text,
|
|
|
|
created_at -> Timestamp,
|
|
|
|
updated_at -> Timestamp,
|
|
|
|
user_uuid -> Nullable<Text>,
|
|
|
|
organization_uuid -> Nullable<Text>,
|
2019-05-20 21:12:41 +02:00
|
|
|
atype -> Integer,
|
2018-03-06 00:02:36 +01:00
|
|
|
name -> Text,
|
|
|
|
notes -> Nullable<Text>,
|
|
|
|
fields -> Nullable<Text>,
|
2018-02-10 01:00:55 +01:00
|
|
|
data -> Text,
|
2018-08-28 02:38:58 +05:30
|
|
|
password_history -> Nullable<Text>,
|
2020-04-17 22:35:27 +02:00
|
|
|
deleted_at -> Nullable<Timestamp>,
|
2021-05-01 01:06:06 -07:00
|
|
|
reprompt -> Nullable<Integer>,
|
2018-02-10 01:00:55 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-01 15:08:03 +02:00
|
|
|
table! {
|
|
|
|
ciphers_collections (cipher_uuid, collection_uuid) {
|
2019-05-26 23:02:41 +02:00
|
|
|
cipher_uuid -> Text,
|
|
|
|
collection_uuid -> Text,
|
2018-06-01 15:08:03 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-17 22:30:19 +01:00
|
|
|
table! {
|
|
|
|
collections (uuid) {
|
2019-05-26 23:02:41 +02:00
|
|
|
uuid -> Text,
|
|
|
|
org_uuid -> Text,
|
2018-02-17 22:30:19 +01:00
|
|
|
name -> Text,
|
2023-06-28 20:37:13 +02:00
|
|
|
external_id -> Nullable<Text>,
|
2018-02-17 22:30:19 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-10 01:00:55 +01:00
|
|
|
table! {
|
2022-03-03 21:00:10 +01:00
|
|
|
devices (uuid, user_uuid) {
|
2019-05-26 23:02:41 +02:00
|
|
|
uuid -> Text,
|
|
|
|
created_at -> Timestamp,
|
|
|
|
updated_at -> Timestamp,
|
|
|
|
user_uuid -> Text,
|
2018-02-10 01:00:55 +01:00
|
|
|
name -> Text,
|
2019-05-20 21:12:41 +02:00
|
|
|
atype -> Integer,
|
2023-06-11 13:28:18 +02:00
|
|
|
push_uuid -> Nullable<Text>,
|
2018-02-10 01:00:55 +01:00
|
|
|
push_token -> Nullable<Text>,
|
|
|
|
refresh_token -> Text,
|
2018-06-01 15:08:03 +02:00
|
|
|
twofactor_remember -> Nullable<Text>,
|
2018-02-10 01:00:55 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-11-20 19:15:45 +01:00
|
|
|
table! {
|
|
|
|
event (uuid) {
|
|
|
|
uuid -> Text,
|
|
|
|
event_type -> Integer,
|
|
|
|
user_uuid -> Nullable<Text>,
|
|
|
|
org_uuid -> Nullable<Text>,
|
|
|
|
cipher_uuid -> Nullable<Text>,
|
|
|
|
collection_uuid -> Nullable<Text>,
|
|
|
|
group_uuid -> Nullable<Text>,
|
|
|
|
org_user_uuid -> Nullable<Text>,
|
|
|
|
act_user_uuid -> Nullable<Text>,
|
|
|
|
device_type -> Nullable<Integer>,
|
|
|
|
ip_address -> Nullable<Text>,
|
|
|
|
event_date -> Timestamp,
|
|
|
|
policy_uuid -> Nullable<Text>,
|
|
|
|
provider_uuid -> Nullable<Text>,
|
|
|
|
provider_user_uuid -> Nullable<Text>,
|
|
|
|
provider_org_uuid -> Nullable<Text>,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-19 02:16:27 -07:00
|
|
|
table! {
|
|
|
|
favorites (user_uuid, cipher_uuid) {
|
|
|
|
user_uuid -> Text,
|
|
|
|
cipher_uuid -> Text,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-10 01:00:55 +01:00
|
|
|
table! {
|
|
|
|
folders (uuid) {
|
2019-05-26 23:02:41 +02:00
|
|
|
uuid -> Text,
|
|
|
|
created_at -> Timestamp,
|
|
|
|
updated_at -> Timestamp,
|
|
|
|
user_uuid -> Text,
|
2018-02-10 01:00:55 +01:00
|
|
|
name -> Text,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-05-04 20:10:35 +02:00
|
|
|
table! {
|
|
|
|
folders_ciphers (cipher_uuid, folder_uuid) {
|
2019-05-26 23:02:41 +02:00
|
|
|
cipher_uuid -> Text,
|
|
|
|
folder_uuid -> Text,
|
2018-05-04 20:10:35 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-09-19 17:30:14 +02:00
|
|
|
table! {
|
|
|
|
invitations (email) {
|
2019-05-26 23:02:41 +02:00
|
|
|
email -> Text,
|
2018-09-19 17:30:14 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-14 13:22:30 +01:00
|
|
|
table! {
|
|
|
|
org_policies (uuid) {
|
|
|
|
uuid -> Text,
|
|
|
|
org_uuid -> Text,
|
|
|
|
atype -> Integer,
|
|
|
|
enabled -> Bool,
|
|
|
|
data -> Text,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-17 22:30:19 +01:00
|
|
|
table! {
|
|
|
|
organizations (uuid) {
|
2019-05-26 23:02:41 +02:00
|
|
|
uuid -> Text,
|
2018-02-17 22:30:19 +01:00
|
|
|
name -> Text,
|
|
|
|
billing_email -> Text,
|
Added web-vault v2.21.x support + some misc fixes
- The new web-vault v2.21.0+ has support for Master Password Reset. For
this to work it generates a public/private key-pair which needs to be
stored in the database. Currently the Master Password Reset is not
fixed, but there are endpoints which are needed even if we do not
support this feature (yet). This PR fixes those endpoints, and stores
the keys already in the database.
- There was an issue when you want to do a key-rotate when you change
your password, it also called an Emergency Access endpoint, which we do
not yet support. Because this endpoint failed to reply correctly
produced some errors, and also prevent the user from being forced to
logout. This resolves #1826 by adding at least that endpoint.
Because of that extra endpoint check to Emergency Access is done using
an old user stamp, i also modified the stamp exception to allow multiple
rocket routes to be called, and added an expiration timestamp to it.
During these tests i stumbled upon an issue that after my key-change was
done, it triggered the websockets to try and reload my ciphers, because
they were updated. This shouldn't happen when rotating they keys, since
all access should be invalided. Now there will be no websocket
notification for this, which also prevents error toasts.
- Increased Send Size limit to 500MB (with a litle overhead)
As a side note, i tested these changes on both v2.20.4 and v2.21.1 web-vault versions, all keeps working.
2021-07-04 23:02:56 +02:00
|
|
|
private_key -> Nullable<Text>,
|
|
|
|
public_key -> Nullable<Text>,
|
2018-02-17 22:30:19 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-03-14 23:35:55 +01:00
|
|
|
table! {
|
|
|
|
sends (uuid) {
|
|
|
|
uuid -> Text,
|
|
|
|
user_uuid -> Nullable<Text>,
|
|
|
|
organization_uuid -> Nullable<Text>,
|
|
|
|
name -> Text,
|
|
|
|
notes -> Nullable<Text>,
|
|
|
|
atype -> Integer,
|
|
|
|
data -> Text,
|
2021-03-15 16:42:20 +01:00
|
|
|
akey -> Text,
|
2021-03-14 23:35:55 +01:00
|
|
|
password_hash -> Nullable<Binary>,
|
|
|
|
password_salt -> Nullable<Binary>,
|
|
|
|
password_iter -> Nullable<Integer>,
|
|
|
|
max_access_count -> Nullable<Integer>,
|
|
|
|
access_count -> Integer,
|
|
|
|
creation_date -> Timestamp,
|
|
|
|
revision_date -> Timestamp,
|
|
|
|
expiration_date -> Nullable<Timestamp>,
|
|
|
|
deletion_date -> Timestamp,
|
|
|
|
disabled -> Bool,
|
2021-05-11 22:51:12 -07:00
|
|
|
hide_email -> Nullable<Bool>,
|
2021-03-14 23:35:55 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-12 21:46:50 +02:00
|
|
|
table! {
|
|
|
|
twofactor (uuid) {
|
2019-05-26 23:02:41 +02:00
|
|
|
uuid -> Text,
|
|
|
|
user_uuid -> Text,
|
2019-05-20 21:12:41 +02:00
|
|
|
atype -> Integer,
|
2018-07-12 21:46:50 +02:00
|
|
|
enabled -> Bool,
|
|
|
|
data -> Text,
|
2019-10-10 17:32:20 +02:00
|
|
|
last_used -> Integer,
|
2018-07-12 21:46:50 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-25 01:36:05 -07:00
|
|
|
table! {
|
|
|
|
twofactor_incomplete (user_uuid, device_uuid) {
|
|
|
|
user_uuid -> Text,
|
|
|
|
device_uuid -> Text,
|
|
|
|
device_name -> Text,
|
|
|
|
login_time -> Timestamp,
|
|
|
|
ip_address -> Text,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-10 01:00:55 +01:00
|
|
|
table! {
|
|
|
|
users (uuid) {
|
2019-05-26 23:02:41 +02:00
|
|
|
uuid -> Text,
|
2020-11-30 23:12:56 +01:00
|
|
|
enabled -> Bool,
|
2019-05-26 23:02:41 +02:00
|
|
|
created_at -> Timestamp,
|
|
|
|
updated_at -> Timestamp,
|
2019-11-24 22:28:49 -07:00
|
|
|
verified_at -> Nullable<Timestamp>,
|
|
|
|
last_verifying_at -> Nullable<Timestamp>,
|
|
|
|
login_verify_count -> Integer,
|
2019-05-26 23:02:41 +02:00
|
|
|
email -> Text,
|
2019-11-24 22:28:49 -07:00
|
|
|
email_new -> Nullable<Text>,
|
|
|
|
email_new_token -> Nullable<Text>,
|
2018-02-10 01:00:55 +01:00
|
|
|
name -> Text,
|
2019-05-26 23:02:41 +02:00
|
|
|
password_hash -> Binary,
|
|
|
|
salt -> Binary,
|
2018-02-10 01:00:55 +01:00
|
|
|
password_iterations -> Integer,
|
|
|
|
password_hint -> Nullable<Text>,
|
2019-05-20 21:12:41 +02:00
|
|
|
akey -> Text,
|
2018-02-10 01:00:55 +01:00
|
|
|
private_key -> Nullable<Text>,
|
|
|
|
public_key -> Nullable<Text>,
|
|
|
|
totp_secret -> Nullable<Text>,
|
|
|
|
totp_recover -> Nullable<Text>,
|
|
|
|
security_stamp -> Text,
|
2020-12-14 19:58:23 +01:00
|
|
|
stamp_exception -> Nullable<Text>,
|
2018-02-15 00:40:34 +01:00
|
|
|
equivalent_domains -> Text,
|
|
|
|
excluded_globals -> Text,
|
2018-09-19 17:30:14 +02:00
|
|
|
client_kdf_type -> Integer,
|
|
|
|
client_kdf_iter -> Integer,
|
2023-01-31 21:26:23 -05:00
|
|
|
client_kdf_memory -> Nullable<Integer>,
|
|
|
|
client_kdf_parallelism -> Nullable<Integer>,
|
2022-01-19 02:51:26 -08:00
|
|
|
api_key -> Nullable<Text>,
|
2023-01-11 21:45:11 +01:00
|
|
|
avatar_color -> Nullable<Text>,
|
2023-06-02 22:28:30 +02:00
|
|
|
external_id -> Nullable<Text>,
|
2018-09-10 14:51:40 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-17 22:30:19 +01:00
|
|
|
table! {
|
|
|
|
users_collections (user_uuid, collection_uuid) {
|
2019-05-26 23:02:41 +02:00
|
|
|
user_uuid -> Text,
|
|
|
|
collection_uuid -> Text,
|
2018-05-04 20:10:35 +02:00
|
|
|
read_only -> Bool,
|
2020-07-02 21:51:20 -07:00
|
|
|
hide_passwords -> Bool,
|
2018-02-17 22:30:19 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
table! {
|
2018-04-24 22:01:55 +02:00
|
|
|
users_organizations (uuid) {
|
2019-05-26 23:02:41 +02:00
|
|
|
uuid -> Text,
|
|
|
|
user_uuid -> Text,
|
|
|
|
org_uuid -> Text,
|
2018-04-24 22:01:55 +02:00
|
|
|
access_all -> Bool,
|
2019-05-20 21:12:41 +02:00
|
|
|
akey -> Text,
|
2018-02-17 22:30:19 +01:00
|
|
|
status -> Integer,
|
2019-05-20 21:12:41 +02:00
|
|
|
atype -> Integer,
|
2023-01-25 08:06:21 +01:00
|
|
|
reset_password_key -> Nullable<Text>,
|
2023-09-02 23:57:43 +02:00
|
|
|
external_id -> Nullable<Text>,
|
2018-02-17 22:30:19 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-06-02 21:36:15 +02:00
|
|
|
table! {
|
|
|
|
organization_api_key (uuid, org_uuid) {
|
|
|
|
uuid -> Text,
|
|
|
|
org_uuid -> Text,
|
|
|
|
atype -> Integer,
|
|
|
|
api_key -> Text,
|
|
|
|
revision_date -> Timestamp,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-03-24 20:15:55 +01:00
|
|
|
table! {
|
|
|
|
emergency_access (uuid) {
|
|
|
|
uuid -> Text,
|
|
|
|
grantor_uuid -> Text,
|
|
|
|
grantee_uuid -> Nullable<Text>,
|
|
|
|
email -> Nullable<Text>,
|
|
|
|
key_encrypted -> Nullable<Text>,
|
|
|
|
atype -> Integer,
|
|
|
|
status -> Integer,
|
|
|
|
wait_time_days -> Integer,
|
|
|
|
recovery_initiated_at -> Nullable<Timestamp>,
|
|
|
|
last_notification_at -> Nullable<Timestamp>,
|
|
|
|
updated_at -> Timestamp,
|
|
|
|
created_at -> Timestamp,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-20 15:31:53 +02:00
|
|
|
table! {
|
|
|
|
groups (uuid) {
|
|
|
|
uuid -> Text,
|
|
|
|
organizations_uuid -> Text,
|
|
|
|
name -> Text,
|
|
|
|
access_all -> Bool,
|
|
|
|
external_id -> Nullable<Text>,
|
|
|
|
creation_date -> Timestamp,
|
|
|
|
revision_date -> Timestamp,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
table! {
|
|
|
|
groups_users (groups_uuid, users_organizations_uuid) {
|
|
|
|
groups_uuid -> Text,
|
|
|
|
users_organizations_uuid -> Text,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
table! {
|
|
|
|
collections_groups (collections_uuid, groups_uuid) {
|
|
|
|
collections_uuid -> Text,
|
|
|
|
groups_uuid -> Text,
|
|
|
|
read_only -> Bool,
|
|
|
|
hide_passwords -> Bool,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-04 21:12:23 +02:00
|
|
|
table! {
|
|
|
|
auth_requests (uuid) {
|
|
|
|
uuid -> Text,
|
|
|
|
user_uuid -> Text,
|
|
|
|
organization_uuid -> Nullable<Text>,
|
|
|
|
request_device_identifier -> Text,
|
|
|
|
device_type -> Integer,
|
|
|
|
request_ip -> Text,
|
|
|
|
response_device_id -> Nullable<Text>,
|
|
|
|
access_code -> Text,
|
|
|
|
public_key -> Text,
|
2023-09-01 21:03:50 +02:00
|
|
|
enc_key -> Nullable<Text>,
|
|
|
|
master_password_hash -> Nullable<Text>,
|
2023-08-04 21:12:23 +02:00
|
|
|
approved -> Nullable<Bool>,
|
|
|
|
creation_date -> Timestamp,
|
|
|
|
response_date -> Nullable<Timestamp>,
|
|
|
|
authentication_date -> Nullable<Timestamp>,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-05-20 21:30:31 +02:00
|
|
|
joinable!(attachments -> ciphers (cipher_uuid));
|
|
|
|
joinable!(ciphers -> organizations (organization_uuid));
|
|
|
|
joinable!(ciphers -> users (user_uuid));
|
|
|
|
joinable!(ciphers_collections -> ciphers (cipher_uuid));
|
|
|
|
joinable!(ciphers_collections -> collections (collection_uuid));
|
|
|
|
joinable!(collections -> organizations (org_uuid));
|
|
|
|
joinable!(devices -> users (user_uuid));
|
|
|
|
joinable!(folders -> users (user_uuid));
|
|
|
|
joinable!(folders_ciphers -> ciphers (cipher_uuid));
|
|
|
|
joinable!(folders_ciphers -> folders (folder_uuid));
|
2020-03-14 13:22:30 +01:00
|
|
|
joinable!(org_policies -> organizations (org_uuid));
|
2021-03-14 23:35:55 +01:00
|
|
|
joinable!(sends -> organizations (organization_uuid));
|
|
|
|
joinable!(sends -> users (user_uuid));
|
2019-05-20 21:30:31 +02:00
|
|
|
joinable!(twofactor -> users (user_uuid));
|
|
|
|
joinable!(users_collections -> collections (collection_uuid));
|
|
|
|
joinable!(users_collections -> users (user_uuid));
|
|
|
|
joinable!(users_organizations -> organizations (org_uuid));
|
|
|
|
joinable!(users_organizations -> users (user_uuid));
|
2022-11-20 19:15:45 +01:00
|
|
|
joinable!(users_organizations -> ciphers (org_uuid));
|
2023-06-02 21:36:15 +02:00
|
|
|
joinable!(organization_api_key -> organizations (org_uuid));
|
2021-03-24 20:15:55 +01:00
|
|
|
joinable!(emergency_access -> users (grantor_uuid));
|
2022-10-20 15:31:53 +02:00
|
|
|
joinable!(groups -> organizations (organizations_uuid));
|
|
|
|
joinable!(groups_users -> users_organizations (users_organizations_uuid));
|
|
|
|
joinable!(groups_users -> groups (groups_uuid));
|
|
|
|
joinable!(collections_groups -> collections (collections_uuid));
|
|
|
|
joinable!(collections_groups -> groups (groups_uuid));
|
2022-11-20 19:15:45 +01:00
|
|
|
joinable!(event -> users_organizations (uuid));
|
2023-08-04 21:12:23 +02:00
|
|
|
joinable!(auth_requests -> users (user_uuid));
|
2019-05-20 21:30:31 +02:00
|
|
|
|
2018-02-10 01:00:55 +01:00
|
|
|
allow_tables_to_appear_in_same_query!(
|
2018-02-15 00:40:34 +01:00
|
|
|
attachments,
|
2018-02-10 01:00:55 +01:00
|
|
|
ciphers,
|
2018-06-01 15:08:03 +02:00
|
|
|
ciphers_collections,
|
2018-02-17 22:30:19 +01:00
|
|
|
collections,
|
2018-02-10 01:00:55 +01:00
|
|
|
devices,
|
|
|
|
folders,
|
2018-05-04 20:10:35 +02:00
|
|
|
folders_ciphers,
|
2018-09-19 17:30:14 +02:00
|
|
|
invitations,
|
2020-03-14 13:22:30 +01:00
|
|
|
org_policies,
|
2018-02-17 22:30:19 +01:00
|
|
|
organizations,
|
2021-03-14 23:35:55 +01:00
|
|
|
sends,
|
2018-07-12 21:46:50 +02:00
|
|
|
twofactor,
|
2018-02-10 01:00:55 +01:00
|
|
|
users,
|
2018-02-17 22:30:19 +01:00
|
|
|
users_collections,
|
|
|
|
users_organizations,
|
2023-06-02 21:36:15 +02:00
|
|
|
organization_api_key,
|
2021-03-24 20:15:55 +01:00
|
|
|
emergency_access,
|
2022-10-20 15:31:53 +02:00
|
|
|
groups,
|
|
|
|
groups_users,
|
|
|
|
collections_groups,
|
2022-11-20 19:15:45 +01:00
|
|
|
event,
|
2023-08-04 21:12:23 +02:00
|
|
|
auth_requests,
|
2019-06-02 13:35:01 +02:00
|
|
|
);
|