Commit graph

415 commits

Author SHA1 Message Date
Senya
655325b82c
federation_entities.json: reshare root is optional
root_author and root_guid are optional for the reshare
2018-10-05 12:48:04 +03:00
cmrd Senya
b4450d3383 json schema: fix misplaced "required" property 2018-07-16 00:06:05 +03:00
Benjamin Neff
12f32013db
Bump rubocop 2018-06-17 03:23:04 +02:00
Benjamin Neff
512fafbd60
Merge pull request #100 from SuperTux88/add-full_name
Add full_name to profile
2018-06-17 02:49:47 +02:00
Senya
b15e70f942
Update federation_entities.json
parent_type is mandatory for likes
2018-04-15 19:09:36 +03:00
Benjamin Neff
cce2c7fe31
Add full_name to profile
This is needed for diaspora/diaspora#3648
2018-04-09 00:58:20 +02:00
Benjamin Neff
4e73fd8ea3
Bump rubocop 2018-03-05 23:33:46 +01:00
Benjamin Neff
c1cd297811
Release version 0.2.4 2018-02-18 01:28:48 +01:00
Benjamin Neff
0257ba7e59
Merge pull request #94 from SuperTux88/editable-entities
Editable entities
2018-02-17 21:50:05 +01:00
Benjamin Neff
c0b141786e
Use optional flag for discovery entities instead of default value 2018-02-14 01:50:39 +01:00
Benjamin Neff
b274cc3dad
Fix some validators for nil values
Using the real entities for the tests also uncovered some bugs where for
example empty strings are converted to nil and the validation wasn't
invalid in this case, but should be.
2018-02-14 01:50:39 +01:00
Benjamin Neff
32a49cc549
Get optional props from validated object
This is much easier and safer than "guessing" the class name based on
the validator name. That can cause a problem when another class with the
same name is found. The "guessing" was only added because we used
OpenStruct in the tests, but we shouldn't change the code only to make
tests run. I changed the tests to use the real entities, with
auto-validation disabled in the constructor, so we can test the
validator manually.
2018-02-14 01:37:20 +01:00
Benjamin Neff
4bf5f58ea7
Release version 0.2.3 2018-01-27 02:12:46 +01:00
Benjamin Neff
392f1f5a18
Fix relayable signatures for messages with invalid XML characters
Sometimes messages contain characters that are invalid for XML, but they
are filteres out before creating the XML, otherwise the property would
be empty in the XML.

But for relayables the value is also used for creating the signatures,
so we need to filter the invalid characters earlier, before calculating
the signature.
2018-01-25 01:52:34 +01:00
Benjamin Neff
63f1cbd70a
Add edited_at property to event messages 2018-01-23 03:12:38 +01:00
Benjamin Neff
057ebd69f0
Add edited_at property to the profile message
This is needed so we can make sure to not overwrite newer data by older
one, for example when there are two edits close together and the newer
arrives faster.
2018-01-23 03:12:26 +01:00
Benjamin Neff
8563855be1
Add edited_at property to entities with a text property 2018-01-22 04:26:29 +01:00
Benjamin Neff
f735edadc3
Merge pull request #92 from SuperTux88/update-gems
Update gems
2018-01-19 02:10:07 +01:00
Benjamin Neff
b0cec50172
Bump fabrication 2018-01-18 04:19:09 +01:00
Benjamin Neff
98ff15591e
Bump rubocop 2018-01-18 04:00:20 +01:00
Benjamin Neff
5e81760f30
Remove participants limit for conversations
The limit was added in 2012 to prevent spam, but since the participants
need to be a mutual contact with the author nowadays, I don't think it's
a spam problem anymore.

I also added a validation for the minimum count of the participants,
because a conversion without participants doesn't make much sense.
2018-01-18 02:50:04 +01:00
cmrd Senya
03d779ef39
Merge pull request #90 from SuperTux88/fix-booleans-for-relayables
Fix when booleans in relayables are false
2018-01-10 16:31:31 +02:00
Benjamin Neff
d9a02119b8
Merge pull request #89 from cmrd-senya/account_migration_changes
Extract singning of AccountMigration to a different module and introduce alternative form for account migration message
2017-12-27 20:03:17 +01:00
cmrd Senya
7e2321d6c9 Introduce alternative form of the account migration message
In the alternative form author can be the new diaspora user
2017-12-27 18:37:49 +02:00
cmrd Senya
69e523abd0 Extract account migration sign feature to a module
This module can be used to compute account migration signature in other
objects besides Entities::AccountMigration. For instance this is to be
used in AccountMigration model of diaspora* web application.
2017-12-27 18:37:48 +02:00
Senya
c8568f7256
Merge pull request #80 from SuperTux88/blocking-flag
Add blocking flag to contact message
2017-12-23 17:08:48 +02:00
Benjamin Neff
7503e9a804
Fix when booleans in relayables are false
This was a problem with dislikes.

It's safe to use `to_s` here, because we have only strings, numbers and
booleans here anyway, because relayables don't support nested entities.
`to_s` is used to generate the `signature_data` string too.
2017-11-05 01:12:19 +01:00
Benjamin Neff
3cffc9d1d2
Release version 0.2.2 2017-09-23 02:19:44 +02:00
Benjamin Neff
142950c99e
Merge pull request #84 from SuperTux88/reshare-remove-public-flag
Reshare remove public flag
2017-09-23 01:38:11 +02:00
Benjamin Neff
470ff41caa
Add @raise to Fetcher.fetch_public method documentation 2017-09-23 01:36:57 +02:00
Senya
181d11d2f5 Merge pull request #87 from SuperTux88/fetch-only-once
Don't fetch the same entity twice in the same thread
2017-09-23 02:25:53 +03:00
Benjamin Neff
8535cfc1df
Don't fetch the same entity twice in the same thread 2017-09-23 01:19:10 +02:00
Senya
0b358a6c44 Merge pull request #81 from SuperTux88/relay-likes-for-comments
Relay likes for comments
2017-09-23 00:33:11 +03:00
Benjamin Neff
61c00b3596
Use top parent when relaying relayables of relayables 2017-09-22 21:30:09 +02:00
Benjamin Neff
b25e21f980
Add method to get the top entity to RelatedEntity 2017-09-22 21:30:09 +02:00
Senya
cddb4610c0 Merge pull request #79 from SuperTux88/validate-public-flag-for-profiles
Allow to receive non-public profiles without private data
2017-09-22 14:11:58 +03:00
Benjamin Neff
3b3f6ad589
Fetch linked entities before saving 2017-09-21 02:53:33 +02:00
Benjamin Neff
5bf0087e0a
Bump rubocop
... and update the config and code for the new version.
2017-09-16 03:23:41 +02:00
Dennis Schubert
f9b24b15f8
Disallow diaspora* IDs longer than 255 characters 2017-09-13 12:35:08 +02:00
Dennis Schubert
b83619cd2c
Disallow uppercased usernames and hostnames
Drive-by: replaced some of the parts by named POSIX character classes to
make the regex easier to read.
2017-09-13 12:05:49 +02:00
Benjamin Neff
b6ec405e55
Add author to the diaspora:// URL parser 2017-09-12 23:46:42 +02:00
Benjamin Neff
e663a65c7e
Remove not_nil for diaspora IDs from validators
The diaspora ID validator now is not nil by default.

Also:
* mark root_author as optional for reshares.
* make author for profiles mandatory (I don't remember why this was
optional, we never generate a profile without author and we wouldn't
receive a profile without author anyway, because we validate that the
author is the sender).
* refactor validator specs for diaspora IDs
2017-09-12 23:11:05 +02:00
Benjamin Neff
5e3f510a88
Refactor diaspora ID regex to be used in diaspora:// URL regex 2017-09-12 23:11:05 +02:00
Benjamin Neff
92dc8b0277
Fix GUID regex 2017-09-12 21:24:50 +02:00
Benjamin Neff
35efeb8345
Move public flag from status_message to post
This represents the current state of the documentation.
2017-09-12 00:45:59 +02:00
Benjamin Neff
b1b511b6f7
Remove public and provider_display_name from reshare entity
Also don't extend from Post module anymore to represent the future state
of a reshare as it's own type only used to increase the reach of a post.

See #83
2017-09-12 00:13:21 +02:00
Benjamin Neff
834d358eca
Allow to receive non-public profiles without private data 2017-09-11 21:38:46 +02:00
cmrd Senya
0b07b36017
Merge pull request #74 from SuperTux88/parse-rfc-7033-webfinger
Parse RFC 7033 webfinger
2017-09-10 16:30:38 +03:00
Benjamin Neff
f24dd528ee
Add option for RFC 7033 WebFinger http fallback 2017-09-10 03:08:13 +02:00
Benjamin Neff
3e7e649025
Fetch RFC 7033 WebFinger with fallback to legacy WebFinger 2017-09-10 03:08:12 +02:00