Wykres commitów

132 Commity (259b7d72dd8cf8e44c1d95a9440dfa44c44f5fd8)

Autor SHA1 Wiadomość Data
Ryan Barrett 259b7d72dd
start on conditional opt in
* add Protocol.DEFAULT_ENABLED_PROTOCOLS
* add User.enabled_protocols
* move common.is_enabled to Protocol.is_enabled_to, include opt out/in
2024-04-17 16:43:10 -07:00
Ryan Barrett 393605bde9
change ATProto.ABBREV to bsky
🤞, for #961
2024-04-17 06:54:16 -07:00
Ryan Barrett 12a3bf0862
noop: add messages to asserts in ids, atproto 2024-04-15 16:44:33 -07:00
Ryan Barrett a70702776c
atproto: switch to Bluesky butterfly logo
also minor user page language tweak
2024-04-15 14:53:54 -07:00
Ryan Barrett 374af3aa5c
atproto polls: use common.USER_ALLOWLIST 2024-04-15 14:08:36 -07:00
Ryan Barrett e913ad1f53
ATProto.convert: refetch subject for cid if we don't have it 2024-04-15 07:31:05 -07:00
Ryan Barrett f840c8b784
temporarily disable is_enabled checks in ATProto/ActivityPub.convert
for manual testing
2024-04-14 14:50:02 -07:00
Ryan Barrett 5ec2159546
user page: link to bridged Bluesky profile
for #825
2024-04-12 08:46:59 -07:00
Ryan Barrett 133d640f1d
improve rendering of ATProto interactions on user pages
for #825
2024-04-11 15:02:15 -07:00
Ryan Barrett 0d549dc039
atproto: fix log message 2024-04-11 14:21:30 -07:00
Ryan Barrett 561c763fd4
atproto handle resolution: test, comments, minor refactoring
for snarfed/granary@d4bff45637
2024-04-10 16:34:50 -07:00
Ryan Barrett bf296802d8
pass from_user through to convert() in a few more places 2024-04-10 15:16:37 -07:00
Ryan Barrett 7009267bb0
use new handle_or_id kwarg in common.is_enabled calls 2024-04-10 11:49:53 -07:00
Ryan Barrett 056644d19e
add handle_or_id kwarg to common.is_enabled
for allowlist of test users while testing a given pair of protocols
2024-04-10 11:40:17 -07:00
Ryan Barrett 4ed45e5af5
atproto: pass new ndb_client kwarg to DatastoreStorage constructor
for snarfed/lexrpc#8
2024-03-31 18:50:01 -07:00
Ryan Barrett 5a1dda151c
ATProto.create_for: better support for local testing 2024-03-24 08:59:54 -04:00
Ryan Barrett 048cd17ba5
bug fix for pds_for change in e86763f: don't use Object.as1 since that infinite loops 2024-03-14 21:16:09 -07:00
Ryan Barrett 878bbde328
atproto: handle bsky.app URLs in load, not fetch 2024-03-14 15:40:25 -07:00
Ryan Barrett 9b2bb9ef37
make ATProto.load([DID]) return the profile record by default
add did_doc kwarg to make it return the DID doc instead
2024-03-13 16:08:08 -07:00
Ryan Barrett 69e4b039e9
atproto: update authed_as, actor authz checks in poll_* 2024-03-13 15:41:03 -07:00
Ryan Barrett bad7052663
atproto: add delete support 2024-03-13 14:47:48 -07:00
Ryan Barrett d667c8ece4
atproto: add update support 2024-03-13 14:40:31 -07:00
Ryan Barrett 7bf29d411f
atproto: only enable indieweb.org and snarfed.org, for now 2024-03-13 13:07:30 -07:00
Ryan Barrett be56539eb2
ATProto.send: explicitly ignore accepts, undos 2024-03-12 20:48:23 -07:00
Ryan Barrett aea4880e6f
ATProto.convert: fill in strongRef URIs with DIDs as well as CID
also error handling in ATProto.fetch for failed getRecord requests
2024-03-12 14:45:48 -07:00
Ryan Barrett cf4d105c3e
atproto: when creating new commits, fetch remote objects' CIDs if necessary
fixes sending likes, reposts, etc to ATProto
2024-03-12 11:12:34 -07:00
Ryan Barrett 51254f67de
atproto: tweak profile label, add bridgy-fed- 2024-03-11 15:31:31 -07:00
Ryan Barrett 95e46c5ebb
Revert "cache outbound HTTP request responses, locally to each inbound request"
This reverts commit 30debfc8fa.

seemed promising, but broke in production. Saw a lot of `IncompleteRead`s on both GETs and POSTs. Rolled back for now.

```
('Connection broken: IncompleteRead(9172 bytes read, -4586 more expected)', IncompleteRead(9172 bytes read, -4586 more expected))
...
File "oauth_dropins/webutil/util.py", line 1673, in call
  resp = getattr((session or requests), fn)(url, *args, **kwargs)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "requests_cache/session.py", line 102, in get
  return self.request('GET', url, params=params, **kwargs)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "requests_cache/session.py", line 158, in request
  return super().request(method, url, *args, headers=headers, **kwargs)  # type: ignore
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "requests/sessions.py", line 589, in request
  resp = self.send(prep, **send_kwargs)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "requests_cache/session.py", line 205, in send
  response = self._send_and_cache(request, actions, cached_response, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "requests_cache/session.py", line 233, in _send_and_cache
  self.cache.save_response(response, actions.cache_key, actions.expires)
File "requests_cache/backends/base.py", line 89, in save_response
  cached_response = CachedResponse.from_response(response, expires=expires)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "requests_cache/models/response.py", line 102, in from_response
  obj.raw = CachedHTTPResponse.from_response(response)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "requests_cache/models/raw_response.py", line 69, in from_response
  _ = response.content  # This property reads, decodes, and stores response content
      ^^^^^^^^^^^^^^^^
File "requests/models.py", line 899, in content
  self._content = b"".join(self.iter_content(CONTENT_CHUNK_SIZE)) or b""
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "requests/models.py", line 818, in generate
  raise ChunkedEncodingError(e)
```
2024-03-11 15:31:30 -07:00
Ryan Barrett 30debfc8fa
cache outbound HTTP request responses, locally to each inbound request
using requests-cache. pretty straightforward! for #588
2024-03-08 12:34:49 -08:00
Ryan Barrett 0101cf04ea
atproto: fetch records from AppView (api.bsky.app) instead of PDSes
fixes #688
2024-03-04 16:35:31 -08:00
Ryan Barrett 396c3a64f3
ATProto.fetch: support bsky.app URLs 2024-03-02 16:50:01 -08:00
Ryan Barrett c2b8db8687
atproto: self label profiles with 'bridged-from-[protocol]'
fixes #827
2024-03-01 13:31:59 -08:00
Ryan Barrett d2865fdb86
add common.ENABLED_BRIDGES, check before conversion and /bridge-user 2024-02-28 12:07:06 -08:00
Ryan Barrett 3bcef0d37d
follow UI: specific error message for trying to follow bridged accounts
thanks for the nudge @campegg!
2024-01-25 17:05:26 -08:00
Ryan Barrett 03315891aa
drop a lot of g.user
for #690
2023-11-25 20:23:19 -08:00
Ryan Barrett 1591dfb641
pass user to Protocol.send/convert instead of using g.user
for #690
2023-11-25 20:07:14 -08:00
Ryan Barrett db2668ffab
activitypub.postprocess_as2_actor: handle user without handle
fixes https://console.cloud.google.com/errors/detail/CIT9-r3d-MKW5AE;time=P30D?project=bridgy-federated
2023-11-23 22:09:11 -08:00
Ryan Barrett bee313fb67
drop User.atproto_did, switch to using copies 2023-11-15 19:08:06 -08:00
Ryan Barrett 4d095fa3d9
misc cleanup
* remove obsolete TODOs, commented out code
* remove obsolete circular imports of per-protocol modules
* minimize Object put in Protocol.load
* remove duplicated Protocol.load tests in test_activitypub
* re-enable rest of ActivityPubUtilsTest.test_postprocess_as2_idempotent
* drop default cls=Web in TestCase.make_user
2023-11-15 14:23:08 -08:00
Ryan Barrett 5d1aadb869
ATProto.send: use type as collection, convert to record early to catch errors 2023-11-14 19:55:20 -08:00
Ryan Barrett d237d9611c
atproto: store extra `cid` field in Object.bsky, populate in record strongRefs 2023-11-14 19:24:37 -08:00
Ryan Barrett 95631396b7
atproto: fill in createdAt
for snarfed/granary@a0795b8c34
2023-11-14 15:24:51 -08:00
Ryan Barrett 81838df113
atproto.poll_posts: store record, not #postView 2023-11-14 14:21:22 -08:00
Ryan Barrett a5b5078729
ATProto: first pass at polling posts (timelines)
for #694
2023-11-14 12:30:14 -08:00
Ryan Barrett 9c5adab4f4
ATProto.send: support likes, reposts, follows
snarfed/bridgy-fed#717
2023-11-14 10:56:52 -08:00
Ryan Barrett 00fb4dd14d
move test_atproto.KEY to testutil.ATPROTO_KEY 2023-11-13 14:08:21 -08:00
Ryan Barrett a08a76c672
Object.resolve_ids bug fix: handle both protocol LABEL and ABBREV 2023-11-12 10:33:08 -08:00
Ryan Barrett 2be1229488
ATProto.send: store copy id in base object 2023-11-09 14:09:45 -08:00
Ryan Barrett 4d44363693
fold Object.as_bsky into ATProto.convert, translate ids 2023-11-02 17:41:31 -07:00
Ryan Barrett def5638a64
Protocol.translate: distinguish between object and user ids 2023-11-02 13:08:24 -07:00