mirror of https://github.com/usbharu/Hideout.git
refactor: passwordをUserDetailに移動
This commit is contained in:
parent
9c2107eac1
commit
bbd7754385
|
@ -1,7 +1,7 @@
|
|||
insert into "USERS" (ID, NAME, DOMAIN, SCREEN_NAME, DESCRIPTION, PASSWORD, INBOX, OUTBOX, URL, PUBLIC_KEY, PRIVATE_KEY,
|
||||
CREATED_AT, KEY_ID, FOLLOWING, FOLLOWERS, INSTANCE)
|
||||
insert into actors (ID, NAME, DOMAIN, SCREEN_NAME, DESCRIPTION, INBOX, OUTBOX, URL, PUBLIC_KEY, PRIVATE_KEY,
|
||||
CREATED_AT, KEY_ID, FOLLOWING, FOLLOWERS, INSTANCE)
|
||||
VALUES (1730415786666758144, 'test-user', 'localhost', 'Im test user.', 'THis account is test user.',
|
||||
'$2a$10$/mWC/n7nC7X3l9qCEOKnredxne2zewoqEsJWTOdlKfg2zXKJ0F9Em', 'http://localhost/users/test-user/inbox',
|
||||
'http://localhost/users/test-user/inbox',
|
||||
'http://localhost/users/test-user/outbox', 'http://localhost/users/test-user',
|
||||
'-----BEGIN PUBLIC KEY-----
|
||||
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAi4mifRg6huAIn6DXk3Vn
|
||||
|
@ -44,3 +44,7 @@ Ja15+ZWbOA4vJA9pOh3x4XM=
|
|||
', 1701398248417,
|
||||
'http://localhost/users/test-user#pubkey', 'http://localhost/users/test-user/following',
|
||||
'http://localhost/users/test-users/followers', null);
|
||||
|
||||
insert into user_details (actor_id, password, auto_accept_follow_request, auto_accept_followee_follow_request)
|
||||
values ( 1730415786666758144
|
||||
, '$2a$10$/mWC/n7nC7X3l9qCEOKnredxne2zewoqEsJWTOdlKfg2zXKJ0F9Em', true, true)
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
insert into "USERS" (id, name, domain, screen_name, description, password, inbox, outbox, url, public_key, private_key,
|
||||
created_at, key_id, following, followers, instance)
|
||||
insert into "actors" (id, name, domain, screen_name, description, inbox, outbox, url, public_key, private_key,
|
||||
created_at, key_id, following, followers, instance)
|
||||
VALUES (3733363, 'follow-test-user-1', 'example.com', 'follow-test-user-1-name', '',
|
||||
'5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8',
|
||||
'https://example.com/users/follow-test-user-1/inbox',
|
||||
'https://example.com/users/follow-test-user-1/outbox', 'https://example.com/users/follow-test-user-1',
|
||||
'-----BEGIN PUBLIC KEY-----...-----END PUBLIC KEY-----',
|
||||
|
@ -9,7 +8,6 @@ VALUES (3733363, 'follow-test-user-1', 'example.com', 'follow-test-user-1-name',
|
|||
'https://example.com/users/follow-test-user-1#pubkey', 'https://example.com/users/follow-test-user-1/following',
|
||||
'https://example.com/users/follow-test-user-1/followers', null),
|
||||
(37335363, 'follow-test-user-2', 'example.com', 'follow-test-user-2-name', '',
|
||||
'5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8',
|
||||
'https://example.com/users/follow-test-user-2/inbox',
|
||||
'https://example.com/users/follow-test-user-2/outbox', 'https://example.com/users/follow-test-user-2',
|
||||
'-----BEGIN PUBLIC KEY-----...-----END PUBLIC KEY-----',
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
insert into "USERS" (ID, NAME, DOMAIN, SCREEN_NAME, DESCRIPTION, PASSWORD, INBOX, OUTBOX, URL, PUBLIC_KEY, PRIVATE_KEY,
|
||||
insert into "actors" (ID, NAME, DOMAIN, SCREEN_NAME, DESCRIPTION, INBOX, OUTBOX, URL, PUBLIC_KEY, PRIVATE_KEY,
|
||||
CREATED_AT, KEY_ID, FOLLOWING, FOLLOWERS, INSTANCE)
|
||||
VALUES (8, 'test-user8', 'example.com', 'Im test-user8.', 'THis account is test-user8.',
|
||||
'5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8',
|
||||
'https://example.com/users/test-user8/inbox',
|
||||
'https://example.com/users/test-user8/outbox', 'https://example.com/users/test-user8',
|
||||
'-----BEGIN PUBLIC KEY-----...-----END PUBLIC KEY-----',
|
||||
|
@ -9,10 +8,9 @@ VALUES (8, 'test-user8', 'example.com', 'Im test-user8.', 'THis account is test-
|
|||
'https://example.com/users/test-user8#pubkey', 'https://example.com/users/test-user8/following',
|
||||
'https://example.com/users/test-user8/followers', null);
|
||||
|
||||
insert into "USERS" (ID, NAME, DOMAIN, SCREEN_NAME, DESCRIPTION, PASSWORD, INBOX, OUTBOX, URL, PUBLIC_KEY, PRIVATE_KEY,
|
||||
insert into "actors" (ID, NAME, DOMAIN, SCREEN_NAME, DESCRIPTION, INBOX, OUTBOX, URL, PUBLIC_KEY, PRIVATE_KEY,
|
||||
CREATED_AT, KEY_ID, FOLLOWING, FOLLOWERS, INSTANCE)
|
||||
VALUES (9, 'test-user9', 'follower.example.com', 'Im test-user9.', 'THis account is test-user9.',
|
||||
null,
|
||||
'https://follower.example.com/users/test-user9/inbox',
|
||||
'https://follower.example.com/users/test-user9/outbox', 'https://follower.example.com/users/test-user9',
|
||||
'-----BEGIN PUBLIC KEY-----...-----END PUBLIC KEY-----',
|
||||
|
@ -21,10 +19,10 @@ VALUES (9, 'test-user9', 'follower.example.com', 'Im test-user9.', 'THis account
|
|||
'https://follower.example.com/users/test-user9/following',
|
||||
'https://follower.example.com/users/test-user9/followers', null);
|
||||
|
||||
insert into relationships (user_id, target_user_id, following, blocking, muting, follow_request,
|
||||
insert into relationships (actor_id, target_actor_id, following, blocking, muting, follow_request,
|
||||
ignore_follow_request)
|
||||
VALUES (9, 8, true, false, false, false, false);
|
||||
|
||||
insert into POSTS (ID, USER_ID, OVERVIEW, TEXT, CREATED_AT, VISIBILITY, URL, REPLY_ID, REPOST_ID, SENSITIVE, AP_ID)
|
||||
insert into POSTS (ID, ACTOR_ID, OVERVIEW, TEXT, CREATED_AT, VISIBILITY, URL, REPLY_ID, REPOST_ID, SENSITIVE, AP_ID)
|
||||
VALUES (1239, 8, null, 'test post', 12345680, 2, 'https://example.com/users/test-user8/posts/1239', null, null, false,
|
||||
'https://example.com/users/test-user8/posts/1239');
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
insert into "USERS" (ID, NAME, DOMAIN, SCREEN_NAME, DESCRIPTION, PASSWORD, INBOX, OUTBOX, URL, PUBLIC_KEY, PRIVATE_KEY,
|
||||
insert into "actors" (ID, NAME, DOMAIN, SCREEN_NAME, DESCRIPTION, INBOX, OUTBOX, URL, PUBLIC_KEY, PRIVATE_KEY,
|
||||
CREATED_AT, KEY_ID, FOLLOWING, FOLLOWERS, INSTANCE)
|
||||
VALUES (4, 'test-user4', 'example.com', 'Im test user4.', 'THis account is test user4.',
|
||||
'5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8',
|
||||
'https://example.com/users/test-user4/inbox',
|
||||
'https://example.com/users/test-user4/outbox', 'https://example.com/users/test-user4',
|
||||
'-----BEGIN PUBLIC KEY-----...-----END PUBLIC KEY-----',
|
||||
|
@ -9,10 +8,10 @@ VALUES (4, 'test-user4', 'example.com', 'Im test user4.', 'THis account is test
|
|||
'https://example.com/users/test-user4#pubkey', 'https://example.com/users/test-user4/following',
|
||||
'https://example.com/users/test-user4/followers', null);
|
||||
|
||||
insert into "USERS" (ID, NAME, DOMAIN, SCREEN_NAME, DESCRIPTION, PASSWORD, INBOX, OUTBOX, URL, PUBLIC_KEY, PRIVATE_KEY,
|
||||
insert into "actors" (ID, NAME, DOMAIN, SCREEN_NAME, DESCRIPTION, INBOX, OUTBOX, URL, PUBLIC_KEY, PRIVATE_KEY,
|
||||
CREATED_AT, KEY_ID, FOLLOWING, FOLLOWERS, INSTANCE)
|
||||
VALUES (5, 'test-user5', 'follower.example.com', 'Im test user5.', 'THis account is test user5.',
|
||||
null,
|
||||
|
||||
'https://follower.example.com/users/test-user5/inbox',
|
||||
'https://follower.example.com/users/test-user5/outbox', 'https://follower.example.com/users/test-user5',
|
||||
'-----BEGIN PUBLIC KEY-----...-----END PUBLIC KEY-----',
|
||||
|
@ -21,11 +20,11 @@ VALUES (5, 'test-user5', 'follower.example.com', 'Im test user5.', 'THis account
|
|||
'https://follower.example.com/users/test-user5/following',
|
||||
'https://follower.example.com/users/test-user5/followers', null);
|
||||
|
||||
insert into relationships (user_id, target_user_id, following, blocking, muting, follow_request,
|
||||
insert into relationships (actor_id, target_actor_id, following, blocking, muting, follow_request,
|
||||
ignore_follow_request)
|
||||
VALUES (5, 4, true, false, false, false, false);
|
||||
|
||||
insert into POSTS (ID, "USER_ID", OVERVIEW, TEXT, "CREATED_AT", VISIBILITY, URL, "REPOST_ID", "REPLY_ID", SENSITIVE,
|
||||
insert into POSTS (ID, "actor_ID", OVERVIEW, TEXT, "CREATED_AT", VISIBILITY, URL, "REPOST_ID", "REPLY_ID", SENSITIVE,
|
||||
AP_ID)
|
||||
VALUES (1237, 4, null, 'test post', 12345680, 0, 'https://example.com/users/test-user4/posts/1237', null, null, false,
|
||||
'https://example.com/users/test-user4/posts/1237');
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
insert into "USERS" (ID, NAME, DOMAIN, SCREEN_NAME, DESCRIPTION, PASSWORD, INBOX, OUTBOX, URL, PUBLIC_KEY, PRIVATE_KEY,
|
||||
CREATED_AT, KEY_ID, FOLLOWING, FOLLOWERS, INSTANCE)
|
||||
insert into "actors" (ID, NAME, DOMAIN, SCREEN_NAME, DESCRIPTION, INBOX, OUTBOX, URL, PUBLIC_KEY, PRIVATE_KEY,
|
||||
CREATED_AT, KEY_ID, FOLLOWING, FOLLOWERS, INSTANCE)
|
||||
VALUES (6, 'test-user6', 'example.com', 'Im test-user6.', 'THis account is test-user6.',
|
||||
'5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8',
|
||||
'https://example.com/users/test-user6/inbox',
|
||||
'https://example.com/users/test-user6/outbox', 'https://example.com/users/test-user6',
|
||||
'-----BEGIN PUBLIC KEY-----...-----END PUBLIC KEY-----',
|
||||
|
@ -9,10 +8,9 @@ VALUES (6, 'test-user6', 'example.com', 'Im test-user6.', 'THis account is test-
|
|||
'https://example.com/users/test-user6#pubkey', 'https://example.com/users/test-user6/following',
|
||||
'https://example.com/users/test-user6/followers', null);
|
||||
|
||||
insert into "USERS" (ID, NAME, DOMAIN, SCREEN_NAME, DESCRIPTION, PASSWORD, INBOX, OUTBOX, URL, PUBLIC_KEY, PRIVATE_KEY,
|
||||
CREATED_AT, KEY_ID, FOLLOWING, FOLLOWERS, INSTANCE)
|
||||
insert into "actors" (ID, NAME, DOMAIN, SCREEN_NAME, DESCRIPTION, INBOX, OUTBOX, URL, PUBLIC_KEY, PRIVATE_KEY,
|
||||
CREATED_AT, KEY_ID, FOLLOWING, FOLLOWERS, INSTANCE)
|
||||
VALUES (7, 'test-user7', 'follower.example.com', 'Im test-user7.', 'THis account is test-user7.',
|
||||
null,
|
||||
'https://follower.example.com/users/test-user7/inbox',
|
||||
'https://follower.example.com/users/test-user7/outbox', 'https://follower.example.com/users/test-user7',
|
||||
'-----BEGIN PUBLIC KEY-----...-----END PUBLIC KEY-----',
|
||||
|
@ -21,11 +19,11 @@ VALUES (7, 'test-user7', 'follower.example.com', 'Im test-user7.', 'THis account
|
|||
'https://follower.example.com/users/test-user7/following',
|
||||
'https://follower.example.com/users/test-user7/followers', null);
|
||||
|
||||
insert into relationships (user_id, target_user_id, following, blocking, muting, follow_request,
|
||||
insert into relationships (actor_id, target_actor_id, following, blocking, muting, follow_request,
|
||||
ignore_follow_request)
|
||||
VALUES (7, 6, true, false, false, false, false);
|
||||
|
||||
insert into POSTS (ID, "USER_ID", OVERVIEW, TEXT, "CREATED_AT", VISIBILITY, URL, "REPOST_ID", "REPLY_ID", SENSITIVE,
|
||||
insert into POSTS (ID, "actor_ID", OVERVIEW, TEXT, "CREATED_AT", VISIBILITY, URL, "REPOST_ID", "REPLY_ID", SENSITIVE,
|
||||
AP_ID)
|
||||
VALUES (1238, 6, null, 'test post', 12345680, 1, 'https://example.com/users/test-user6/posts/1238', null, null, false,
|
||||
'https://example.com/users/test-user6/posts/1238');
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
insert into "USERS" (ID, NAME, DOMAIN, SCREEN_NAME, DESCRIPTION, PASSWORD, INBOX, OUTBOX, URL, PUBLIC_KEY, PRIVATE_KEY,
|
||||
insert into "actors" (ID, NAME, DOMAIN, SCREEN_NAME, DESCRIPTION, INBOX, OUTBOX, URL, PUBLIC_KEY, PRIVATE_KEY,
|
||||
CREATED_AT, KEY_ID, FOLLOWING, FOLLOWERS, INSTANCE)
|
||||
VALUES (11, 'test-user11', 'example.com', 'Im test-user11.', 'THis account is test-user11.',
|
||||
'5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8',
|
||||
'https://example.com/users/test-user11/inbox',
|
||||
'https://example.com/users/test-user11/outbox', 'https://example.com/users/test-user11',
|
||||
'-----BEGIN PUBLIC KEY-----...-----END PUBLIC KEY-----',
|
||||
|
@ -9,7 +8,7 @@ VALUES (11, 'test-user11', 'example.com', 'Im test-user11.', 'THis account is te
|
|||
'https://example.com/users/test-user11#pubkey', 'https://example.com/users/test-user11/following',
|
||||
'https://example.com/users/test-user11/followers', null);
|
||||
|
||||
insert into POSTS (ID, "USER_ID", OVERVIEW, TEXT, "CREATED_AT", VISIBILITY, URL, "REPOST_ID", "REPLY_ID", SENSITIVE,
|
||||
insert into POSTS (ID, actor_id, OVERVIEW, TEXT, "CREATED_AT", VISIBILITY, URL, "REPOST_ID", "REPLY_ID", SENSITIVE,
|
||||
AP_ID)
|
||||
VALUES (1242, 11, null, 'test post', 12345680, 0, 'https://example.com/users/test-user11/posts/1242', null, null, false,
|
||||
'https://example.com/users/test-user11/posts/1242');
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
insert into "USERS" (ID, NAME, DOMAIN, SCREEN_NAME, DESCRIPTION, PASSWORD, INBOX, OUTBOX, URL, PUBLIC_KEY, PRIVATE_KEY,
|
||||
CREATED_AT, KEY_ID, FOLLOWING, FOLLOWERS, INSTANCE)
|
||||
insert into "actors" (ID, NAME, DOMAIN, SCREEN_NAME, DESCRIPTION, INBOX, OUTBOX, URL, PUBLIC_KEY, PRIVATE_KEY,
|
||||
CREATED_AT, KEY_ID, FOLLOWING, FOLLOWERS, INSTANCE)
|
||||
VALUES (10, 'test-user10', 'example.com', 'Im test-user10.', 'THis account is test-user10.',
|
||||
'5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8',
|
||||
'https://example.com/users/test-user10/inbox',
|
||||
'https://example.com/users/test-user10/outbox', 'https://example.com/users/test-user10',
|
||||
'-----BEGIN PUBLIC KEY-----...-----END PUBLIC KEY-----',
|
||||
|
@ -9,7 +8,7 @@ VALUES (10, 'test-user10', 'example.com', 'Im test-user10.', 'THis account is te
|
|||
'https://example.com/users/test-user10#pubkey', 'https://example.com/users/test-user10/following',
|
||||
'https://example.com/users/test-user10/followers', null);
|
||||
|
||||
insert into POSTS (ID, "USER_ID", OVERVIEW, TEXT, "CREATED_AT", VISIBILITY, URL, "REPOST_ID", "REPLY_ID", SENSITIVE,
|
||||
insert into POSTS (ID, actor_id, OVERVIEW, TEXT, "CREATED_AT", VISIBILITY, URL, "REPOST_ID", "REPLY_ID", SENSITIVE,
|
||||
AP_ID)
|
||||
VALUES (1240, 10, null, 'test post', 12345680, 0, 'https://example.com/users/test-user10/posts/1240', null, null, false,
|
||||
'https://example.com/users/test-user10/posts/1240'),
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
insert into "USERS" (ID, NAME, DOMAIN, SCREEN_NAME, DESCRIPTION, PASSWORD, INBOX, OUTBOX, URL, PUBLIC_KEY, PRIVATE_KEY,
|
||||
insert into "actors" (ID, NAME, DOMAIN, SCREEN_NAME, DESCRIPTION, INBOX, OUTBOX, URL, PUBLIC_KEY, PRIVATE_KEY,
|
||||
CREATED_AT, KEY_ID, FOLLOWING, FOLLOWERS, INSTANCE)
|
||||
VALUES (3, 'test-user3', 'example.com', 'Im test user3.', 'THis account is test user3.',
|
||||
'5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8',
|
||||
'https://example.com/users/test-user3/inbox',
|
||||
'https://example.com/users/test-user3/outbox', 'https://example.com/users/test-user3',
|
||||
'-----BEGIN PUBLIC KEY-----...-----END PUBLIC KEY-----',
|
||||
|
@ -9,7 +8,7 @@ VALUES (3, 'test-user3', 'example.com', 'Im test user3.', 'THis account is test
|
|||
'https://example.com/users/test-user3#pubkey', 'https://example.com/users/test-user3/following',
|
||||
'https://example.com/users/test-user3/followers', null);
|
||||
|
||||
insert into POSTS (ID, "USER_ID", OVERVIEW, TEXT, "CREATED_AT", VISIBILITY, URL, "REPOST_ID", "REPLY_ID", SENSITIVE,
|
||||
insert into POSTS (ID, actor_id, OVERVIEW, TEXT, "CREATED_AT", VISIBILITY, URL, "REPOST_ID", "REPLY_ID", SENSITIVE,
|
||||
AP_ID)
|
||||
VALUES (1236, 3, null, 'test post', 12345680, 2, 'https://example.com/users/test-user3/posts/1236', null, null, false,
|
||||
'https://example.com/users/test-user3/posts/1236')
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
insert into "USERS" (ID, NAME, DOMAIN, SCREEN_NAME, DESCRIPTION, PASSWORD, INBOX, OUTBOX, URL, PUBLIC_KEY, PRIVATE_KEY,
|
||||
CREATED_AT, KEY_ID, FOLLOWING, FOLLOWERS, INSTANCE)
|
||||
insert into actors (ID, NAME, DOMAIN, SCREEN_NAME, DESCRIPTION, INBOX, OUTBOX, URL, PUBLIC_KEY, PRIVATE_KEY,
|
||||
CREATED_AT, KEY_ID, FOLLOWING, FOLLOWERS, INSTANCE)
|
||||
VALUES (1, 'test-user', 'example.com', 'Im test user.', 'THis account is test user.',
|
||||
'5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8', 'https://example.com/users/test-user/inbox',
|
||||
'https://example.com/users/test-user/inbox',
|
||||
'https://example.com/users/test-user/outbox', 'https://example.com/users/test-user',
|
||||
'-----BEGIN PUBLIC KEY-----...-----END PUBLIC KEY-----',
|
||||
'-----BEGIN PRIVATE KEY-----...-----END PRIVATE KEY-----', 12345678,
|
||||
'https://example.com/users/test-user#pubkey', 'https://example.com/users/test-user/following',
|
||||
'https://example.com/users/test-users/followers', null);
|
||||
|
||||
insert into POSTS (ID, "USER_ID", OVERVIEW, TEXT, "CREATED_AT", VISIBILITY, URL, "REPOST_ID", "REPLY_ID", SENSITIVE,
|
||||
insert into POSTS (ID, actor_id, OVERVIEW, TEXT, "CREATED_AT", VISIBILITY, URL, "REPOST_ID", "REPLY_ID", SENSITIVE,
|
||||
AP_ID)
|
||||
VALUES (1234, 1, null, 'test post', 12345680, 0, 'https://example.com/users/test-user/posts/1234', null, null, false,
|
||||
'https://example.com/users/test-user/posts/1234')
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
insert into "USERS" (ID, NAME, DOMAIN, SCREEN_NAME, DESCRIPTION, PASSWORD, INBOX, OUTBOX, URL, PUBLIC_KEY, PRIVATE_KEY,
|
||||
CREATED_AT, KEY_ID, FOLLOWING, FOLLOWERS, INSTANCE)
|
||||
insert into actors (ID, NAME, DOMAIN, SCREEN_NAME, DESCRIPTION, INBOX, OUTBOX, URL, PUBLIC_KEY, PRIVATE_KEY,
|
||||
CREATED_AT, KEY_ID, FOLLOWING, FOLLOWERS, INSTANCE)
|
||||
VALUES (2, 'test-user2', 'example.com', 'Im test user2.', 'THis account is test user2.',
|
||||
'5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8',
|
||||
'https://example.com/users/test-user2/inbox',
|
||||
'https://example.com/users/test-user2/outbox', 'https://example.com/users/test-user2',
|
||||
'-----BEGIN PUBLIC KEY-----...-----END PUBLIC KEY-----',
|
||||
|
@ -9,7 +8,7 @@ VALUES (2, 'test-user2', 'example.com', 'Im test user2.', 'THis account is test
|
|||
'https://example.com/users/test-user2#pubkey', 'https://example.com/users/test-user2/following',
|
||||
'https://example.com/users/test-user2/followers', null);
|
||||
|
||||
insert into POSTS (ID, "USER_ID", OVERVIEW, TEXT, "CREATED_AT", VISIBILITY, URL, "REPOST_ID", "REPLY_ID", SENSITIVE,
|
||||
insert into POSTS (ID, actor_id, OVERVIEW, TEXT, "CREATED_AT", VISIBILITY, URL, "REPOST_ID", "REPLY_ID", SENSITIVE,
|
||||
AP_ID)
|
||||
VALUES (1235, 2, null, 'test post', 12345680, 1, 'https://example.com/users/test-user2/posts/1235', null, null, false,
|
||||
'https://example.com/users/test-user2/posts/1235')
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
insert into posts (id, user_id, overview, text, created_at, visibility, url, repost_id, reply_id, sensitive, ap_id)
|
||||
insert into posts (id, actor_id, overview, text, created_at, visibility, url, repost_id, reply_id, sensitive, ap_id)
|
||||
VALUES (1, 1, null, 'hello', 1234455, 0, 'https://localhost/users/1/posts/1', null, null, false,
|
||||
'https://users/1/posts/1');
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
insert into "USERS" (ID, NAME, DOMAIN, SCREEN_NAME, DESCRIPTION, PASSWORD, INBOX, OUTBOX, URL, PUBLIC_KEY, PRIVATE_KEY,
|
||||
insert into "actors" (ID, NAME, DOMAIN, SCREEN_NAME, DESCRIPTION, INBOX, OUTBOX, URL, PUBLIC_KEY, PRIVATE_KEY,
|
||||
CREATED_AT, KEY_ID, FOLLOWING, FOLLOWERS, INSTANCE)
|
||||
VALUES (1, 'test-user', 'example.com', 'Im test user.', 'THis account is test user.',
|
||||
'5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8', 'https://example.com/users/test-user/inbox',
|
||||
'https://example.com/users/test-user/inbox',
|
||||
'https://example.com/users/test-user/outbox', 'https://example.com/users/test-user',
|
||||
'-----BEGIN PUBLIC KEY-----...-----END PUBLIC KEY-----',
|
||||
'-----BEGIN PRIVATE KEY-----...-----END PRIVATE KEY-----', 12345678,
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
insert into "USERS" (ID, NAME, DOMAIN, SCREEN_NAME, DESCRIPTION, PASSWORD, INBOX, OUTBOX, URL, PUBLIC_KEY, PRIVATE_KEY,
|
||||
CREATED_AT, KEY_ID, FOLLOWING, FOLLOWERS, INSTANCE)
|
||||
insert into "actors" (ID, NAME, DOMAIN, SCREEN_NAME, DESCRIPTION, INBOX, OUTBOX, URL, PUBLIC_KEY, PRIVATE_KEY,
|
||||
CREATED_AT, KEY_ID, FOLLOWING, FOLLOWERS, INSTANCE)
|
||||
VALUES (2, 'test-user2', 'example.com', 'Im test user.', 'THis account is test user.',
|
||||
'5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8',
|
||||
'https://example.com/users/test-user2/inbox',
|
||||
'https://example.com/users/test-user2/outbox', 'https://example.com/users/test-user2',
|
||||
'-----BEGIN PUBLIC KEY-----...-----END PUBLIC KEY-----',
|
||||
|
|
|
@ -12,7 +12,6 @@ data class Actor private constructor(
|
|||
val domain: String,
|
||||
val screenName: String,
|
||||
val description: String,
|
||||
val password: String? = null,
|
||||
val inbox: String,
|
||||
val outbox: String,
|
||||
val url: String,
|
||||
|
@ -24,11 +23,7 @@ data class Actor private constructor(
|
|||
val following: String? = null,
|
||||
val instance: Long? = null
|
||||
) {
|
||||
override fun toString(): String =
|
||||
"User(id=$id, name='$name', domain='$domain', screenName='$screenName', description='$description'," +
|
||||
" password=$password, inbox='$inbox', outbox='$outbox', url='$url', publicKey='$publicKey', " +
|
||||
"privateKey=$privateKey, createdAt=$createdAt, keyId='$keyId', followers=$followers," +
|
||||
" following=$following, instance=$instance)"
|
||||
|
||||
|
||||
@Component
|
||||
class UserBuilder(private val characterLimit: CharacterLimit, private val applicationConfig: ApplicationConfig) {
|
||||
|
@ -42,7 +37,6 @@ data class Actor private constructor(
|
|||
domain: String,
|
||||
screenName: String,
|
||||
description: String,
|
||||
password: String? = null,
|
||||
inbox: String,
|
||||
outbox: String,
|
||||
url: String,
|
||||
|
@ -97,7 +91,6 @@ data class Actor private constructor(
|
|||
|
||||
// ローカルユーザーはpasswordとprivateKeyをnullにしてはいけない
|
||||
if (domain == applicationConfig.url.host) {
|
||||
requireNotNull(password) { "password and privateKey must not be null for local users." }
|
||||
requireNotNull(privateKey) { "password and privateKey must not be null for local users." }
|
||||
}
|
||||
|
||||
|
@ -135,7 +128,6 @@ data class Actor private constructor(
|
|||
domain = domain,
|
||||
screenName = limitedScreenName,
|
||||
description = limitedDescription,
|
||||
password = password,
|
||||
inbox = inbox,
|
||||
outbox = outbox,
|
||||
url = url,
|
||||
|
@ -149,4 +141,24 @@ data class Actor private constructor(
|
|||
)
|
||||
}
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "Actor(" +
|
||||
"id=$id, " +
|
||||
"name='$name', " +
|
||||
"domain='$domain', " +
|
||||
"screenName='$screenName', " +
|
||||
"description='$description', " +
|
||||
"inbox='$inbox', " +
|
||||
"outbox='$outbox', " +
|
||||
"url='$url', " +
|
||||
"publicKey='$publicKey', " +
|
||||
"privateKey=$privateKey, " +
|
||||
"createdAt=$createdAt, " +
|
||||
"keyId='$keyId', " +
|
||||
"followers=$followers, " +
|
||||
"following=$following, " +
|
||||
"instance=$instance" +
|
||||
")"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
package dev.usbharu.hideout.core.domain.model.userdetails
|
||||
|
||||
data class UserDetail(
|
||||
val actorId: Long,
|
||||
val password: String,
|
||||
val autoAcceptFollowRequest: Boolean,
|
||||
val autoAcceptFolloweeFollowRequest: Boolean
|
||||
)
|
|
@ -0,0 +1,7 @@
|
|||
package dev.usbharu.hideout.core.domain.model.userdetails
|
||||
|
||||
interface UserDetailRepository {
|
||||
suspend fun save(userDetail: UserDetail): UserDetail
|
||||
suspend fun delete(userDetail: UserDetail)
|
||||
suspend fun findByActorId(actorId: Long): UserDetail?
|
||||
}
|
|
@ -16,7 +16,6 @@ class UserResultRowMapper(private val actorBuilder: Actor.UserBuilder) : ResultR
|
|||
domain = resultRow[Actors.domain],
|
||||
screenName = resultRow[Actors.screenName],
|
||||
description = resultRow[Actors.description],
|
||||
password = resultRow[Actors.password],
|
||||
inbox = resultRow[Actors.inbox],
|
||||
outbox = resultRow[Actors.outbox],
|
||||
url = resultRow[Actors.url],
|
||||
|
|
|
@ -24,7 +24,6 @@ class ActorRepositoryImpl(
|
|||
it[domain] = actor.domain
|
||||
it[screenName] = actor.screenName
|
||||
it[description] = actor.description
|
||||
it[password] = actor.password
|
||||
it[inbox] = actor.inbox
|
||||
it[outbox] = actor.outbox
|
||||
it[url] = actor.url
|
||||
|
@ -42,7 +41,6 @@ class ActorRepositoryImpl(
|
|||
it[domain] = actor.domain
|
||||
it[screenName] = actor.screenName
|
||||
it[description] = actor.description
|
||||
it[password] = actor.password
|
||||
it[inbox] = actor.inbox
|
||||
it[outbox] = actor.outbox
|
||||
it[url] = actor.url
|
||||
|
@ -68,7 +66,7 @@ class ActorRepositoryImpl(
|
|||
override suspend fun nextId(): Long = idGenerateService.generateId()
|
||||
}
|
||||
|
||||
object Actors : Table("users") {
|
||||
object Actors : Table("actors") {
|
||||
val id: Column<Long> = long("id")
|
||||
val name: Column<String> = varchar("name", length = 300)
|
||||
val domain: Column<String> = varchar("domain", length = 1000)
|
||||
|
@ -77,7 +75,6 @@ object Actors : Table("users") {
|
|||
"description",
|
||||
length = 10000
|
||||
)
|
||||
val password: Column<String?> = varchar("password", length = 255).nullable()
|
||||
val inbox: Column<String> = varchar("inbox", length = 1000).uniqueIndex()
|
||||
val outbox: Column<String> = varchar("outbox", length = 1000).uniqueIndex()
|
||||
val url: Column<String> = varchar("url", length = 1000).uniqueIndex()
|
||||
|
|
|
@ -22,7 +22,7 @@ class ExposedTimelineRepository(private val idGenerateService: IdGenerateService
|
|||
it[userId] = timeline.userId
|
||||
it[timelineId] = timeline.timelineId
|
||||
it[postId] = timeline.postId
|
||||
it[postUserId] = timeline.postActorId
|
||||
it[postActorId] = timeline.postActorId
|
||||
it[createdAt] = timeline.createdAt
|
||||
it[replyId] = timeline.replyId
|
||||
it[repostId] = timeline.repostId
|
||||
|
@ -37,7 +37,7 @@ class ExposedTimelineRepository(private val idGenerateService: IdGenerateService
|
|||
it[userId] = timeline.userId
|
||||
it[timelineId] = timeline.timelineId
|
||||
it[postId] = timeline.postId
|
||||
it[postUserId] = timeline.postActorId
|
||||
it[postActorId] = timeline.postActorId
|
||||
it[createdAt] = timeline.createdAt
|
||||
it[replyId] = timeline.replyId
|
||||
it[repostId] = timeline.repostId
|
||||
|
@ -57,7 +57,7 @@ class ExposedTimelineRepository(private val idGenerateService: IdGenerateService
|
|||
this[Timelines.userId] = it.userId
|
||||
this[Timelines.timelineId] = it.timelineId
|
||||
this[Timelines.postId] = it.postId
|
||||
this[Timelines.postUserId] = it.postActorId
|
||||
this[Timelines.postActorId] = it.postActorId
|
||||
this[Timelines.createdAt] = it.createdAt
|
||||
this[Timelines.replyId] = it.replyId
|
||||
this[Timelines.repostId] = it.repostId
|
||||
|
@ -84,7 +84,7 @@ fun ResultRow.toTimeline(): Timeline {
|
|||
userId = this[Timelines.userId],
|
||||
timelineId = this[Timelines.timelineId],
|
||||
postId = this[Timelines.postId],
|
||||
postActorId = this[Timelines.postUserId],
|
||||
postActorId = this[Timelines.postActorId],
|
||||
createdAt = this[Timelines.createdAt],
|
||||
replyId = this[Timelines.replyId],
|
||||
repostId = this[Timelines.repostId],
|
||||
|
@ -101,7 +101,7 @@ object Timelines : Table("timelines") {
|
|||
val userId = long("user_id")
|
||||
val timelineId = long("timeline_id")
|
||||
val postId = long("post_id")
|
||||
val postUserId = long("post_user_id")
|
||||
val postActorId = long("post_actor_id")
|
||||
val createdAt = long("created_at")
|
||||
val replyId = long("reply_id").nullable()
|
||||
val repostId = long("repost_id").nullable()
|
||||
|
|
|
@ -0,0 +1,60 @@
|
|||
package dev.usbharu.hideout.core.infrastructure.exposedrepository
|
||||
|
||||
import dev.usbharu.hideout.core.domain.model.userdetails.UserDetail
|
||||
import dev.usbharu.hideout.core.domain.model.userdetails.UserDetailRepository
|
||||
import org.jetbrains.exposed.dao.id.LongIdTable
|
||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq
|
||||
import org.jetbrains.exposed.sql.deleteWhere
|
||||
import org.jetbrains.exposed.sql.insert
|
||||
import org.jetbrains.exposed.sql.select
|
||||
import org.jetbrains.exposed.sql.update
|
||||
import org.springframework.stereotype.Repository
|
||||
|
||||
@Repository
|
||||
class UserDetailRepositoryImpl : UserDetailRepository {
|
||||
override suspend fun save(userDetail: UserDetail): UserDetail {
|
||||
val singleOrNull = UserDetails.select { UserDetails.actorId eq userDetail.actorId }.singleOrNull()
|
||||
if (singleOrNull == null) {
|
||||
UserDetails.insert {
|
||||
it[actorId] = userDetail.actorId
|
||||
it[password] = userDetail.password
|
||||
it[autoAcceptFollowRequest] = userDetail.autoAcceptFollowRequest
|
||||
it[autoAcceptFolloweeFollowRequest] = userDetail.autoAcceptFolloweeFollowRequest
|
||||
}
|
||||
} else {
|
||||
UserDetails.update({ UserDetails.actorId eq userDetail.actorId }) {
|
||||
it[password] = userDetail.password
|
||||
it[autoAcceptFollowRequest] = userDetail.autoAcceptFollowRequest
|
||||
it[autoAcceptFolloweeFollowRequest] = userDetail.autoAcceptFolloweeFollowRequest
|
||||
}
|
||||
}
|
||||
return userDetail
|
||||
}
|
||||
|
||||
override suspend fun delete(userDetail: UserDetail) {
|
||||
UserDetails.deleteWhere { UserDetails.actorId eq userDetail.actorId }
|
||||
}
|
||||
|
||||
override suspend fun findByActorId(actorId: Long): UserDetail? {
|
||||
return UserDetails
|
||||
.select { UserDetails.actorId eq actorId }
|
||||
.singleOrNull()
|
||||
?.let {
|
||||
UserDetail(
|
||||
it[UserDetails.actorId],
|
||||
it[UserDetails.password],
|
||||
it[UserDetails.autoAcceptFollowRequest],
|
||||
it[UserDetails.autoAcceptFolloweeFollowRequest]
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
object UserDetails : LongIdTable("user_details") {
|
||||
val actorId = long("actor_id").references(Actors.id)
|
||||
val password = varchar("password", 255)
|
||||
val autoAcceptFollowRequest = bool("auto_accept_follow_request")
|
||||
val autoAcceptFolloweeFollowRequest = bool("auto_accept_followee_follow_request")
|
||||
}
|
|
@ -2,6 +2,8 @@ package dev.usbharu.hideout.core.infrastructure.springframework.oauth2
|
|||
|
||||
import dev.usbharu.hideout.application.config.ApplicationConfig
|
||||
import dev.usbharu.hideout.application.external.Transaction
|
||||
import dev.usbharu.hideout.core.domain.exception.FailedToGetResourcesException
|
||||
import dev.usbharu.hideout.core.domain.model.userdetails.UserDetailRepository
|
||||
import dev.usbharu.hideout.core.query.ActorQueryService
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import org.springframework.security.core.userdetails.UserDetails
|
||||
|
@ -13,6 +15,7 @@ import org.springframework.stereotype.Service
|
|||
class UserDetailsServiceImpl(
|
||||
private val actorQueryService: ActorQueryService,
|
||||
private val applicationConfig: ApplicationConfig,
|
||||
private val userDetailRepository: UserDetailRepository,
|
||||
private val transaction: Transaction
|
||||
) :
|
||||
UserDetailsService {
|
||||
|
@ -21,11 +24,17 @@ class UserDetailsServiceImpl(
|
|||
throw UsernameNotFoundException("$username not found")
|
||||
}
|
||||
transaction.transaction {
|
||||
val findById = actorQueryService.findByNameAndDomain(username, applicationConfig.url.host)
|
||||
val findById = try {
|
||||
actorQueryService.findByNameAndDomain(username, applicationConfig.url.host)
|
||||
} catch (e: FailedToGetResourcesException) {
|
||||
throw UsernameNotFoundException("$username not found")
|
||||
}
|
||||
val userDetails = userDetailRepository.findByActorId(findById.id)
|
||||
?: throw UsernameNotFoundException("${findById.id} not found.")
|
||||
UserDetailsImpl(
|
||||
id = findById.id,
|
||||
username = findById.name,
|
||||
password = findById.password,
|
||||
password = userDetails.password,
|
||||
enabled = true,
|
||||
accountNonExpired = true,
|
||||
credentialsNonExpired = true,
|
||||
|
|
|
@ -3,6 +3,8 @@ package dev.usbharu.hideout.core.service.user
|
|||
import dev.usbharu.hideout.application.config.ApplicationConfig
|
||||
import dev.usbharu.hideout.core.domain.model.actor.Actor
|
||||
import dev.usbharu.hideout.core.domain.model.actor.ActorRepository
|
||||
import dev.usbharu.hideout.core.domain.model.userdetails.UserDetail
|
||||
import dev.usbharu.hideout.core.domain.model.userdetails.UserDetailRepository
|
||||
import dev.usbharu.hideout.core.query.ActorQueryService
|
||||
import dev.usbharu.hideout.core.service.instance.InstanceService
|
||||
import org.jetbrains.exposed.exceptions.ExposedSQLException
|
||||
|
@ -18,7 +20,8 @@ class UserServiceImpl(
|
|||
private val actorQueryService: ActorQueryService,
|
||||
private val actorBuilder: Actor.UserBuilder,
|
||||
private val applicationConfig: ApplicationConfig,
|
||||
private val instanceService: InstanceService
|
||||
private val instanceService: InstanceService,
|
||||
private val userDetailRepository: UserDetailRepository
|
||||
) :
|
||||
UserService {
|
||||
|
||||
|
@ -38,7 +41,6 @@ class UserServiceImpl(
|
|||
domain = applicationConfig.url.host,
|
||||
screenName = user.screenName,
|
||||
description = user.description,
|
||||
password = hashedPassword,
|
||||
inbox = "$userUrl/inbox",
|
||||
outbox = "$userUrl/outbox",
|
||||
url = userUrl,
|
||||
|
@ -49,7 +51,9 @@ class UserServiceImpl(
|
|||
followers = "$userUrl/followers",
|
||||
keyId = "$userUrl#pubkey"
|
||||
)
|
||||
return actorRepository.save(userEntity)
|
||||
val save = actorRepository.save(userEntity)
|
||||
userDetailRepository.save(UserDetail(nextId, hashedPassword, true, true))
|
||||
return save
|
||||
}
|
||||
|
||||
@Transactional
|
||||
|
|
|
@ -38,7 +38,7 @@ create table if not exists user_details
|
|||
(
|
||||
id bigserial primary key,
|
||||
actor_id bigint not null unique,
|
||||
password varchar(255) null,
|
||||
password varchar(255) not null,
|
||||
auto_accept_follow_request boolean not null,
|
||||
auto_accept_followee_follow_request boolean not null,
|
||||
constraint fk_user_details_actor_id__id foreign key (actor_id) references actors (id) on delete restrict on update restrict
|
||||
|
|
|
@ -36,7 +36,6 @@ object UserBuilder {
|
|||
domain = domain,
|
||||
screenName = screenName,
|
||||
description = description,
|
||||
password = password,
|
||||
inbox = inbox,
|
||||
outbox = outbox,
|
||||
url = url,
|
||||
|
@ -70,7 +69,6 @@ object UserBuilder {
|
|||
domain = domain,
|
||||
screenName = screenName,
|
||||
description = description,
|
||||
password = null,
|
||||
inbox = inbox,
|
||||
outbox = outbox,
|
||||
url = url,
|
||||
|
|
Loading…
Reference in New Issue