Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document read-only endpoints that don't require auth #63

Open
gaearon opened this issue Feb 6, 2024 · 4 comments
Open

Document read-only endpoints that don't require auth #63

gaearon opened this issue Feb 6, 2024 · 4 comments

Comments

@gaearon
Copy link
Contributor

gaearon commented Feb 6, 2024

We need to:

  • Make it clear how obtain a bearer token (the docs are currently vague about this)
  • Split APIs into read-only and requiring auth. Make that distinction clear. Possibly even with icons in the sidebar
  • Integrate this information into the runnable HTTP widget. Make it easy to get bearer token right there for any API call or, for publicly available APIs, not require it at all
  • Make sure the instructions and code snippets for any public API don't force you to enter the token. Just like our PWI is able to access those endpoints without logging in
@bnewbold
Copy link
Contributor

bnewbold commented Feb 7, 2024

which APIs do and don't require auth: we've discussed adding this a machine-readable metadata in the Lexicons themselves, which would help a bunch. We would want to enumerate the specific OAuth scopes required, and have a clear set and naming for the "network services" which implement the endpoints, so we probably don't want to block on this protocol work getting finished.

In a more informal way, I started adding a few annotations in description fields. but we could also just split up the docs or add tags or something to make it easier.

But maybe even more than "which actually don't require auth" it would be most helpful to have a currated set of public endpoints that are recommended and easy to work with.

@gaearon
Copy link
Contributor Author

gaearon commented Feb 7, 2024

What's the general flow for hitting the endpoint without auth? I think the MVP here is just to explain it somewhere since right now the docs make it feel like you have to always log in.

@bnewbold
Copy link
Contributor

bnewbold commented Feb 7, 2024

ahhhh, you know, yeah, we really should document this and haven't, both for beginners and experienced devs.

the main stuff we are both probably thinking about are the Bluesky (app.bsky.*) endpoints, which are best hit on the public-optimized version of the API: https://public.api.bsky.app.

some of the lower-level stuff can go to relay (https://bsky.network) or individual PDS instances (hostname varies).

some low-hanging fruit:

# fetch single profile by handle (or DID)
http get "https://public.api.bsky.app/xrpc/app.bsky.actor.getProfile?actor=bnewbold.net"

# fetch author feed by handle (or DID); this method has a few interesting query params for filtering
http get "https://public.api.bsky.app/xrpc/app.bsky.feed.getAuthorFeed?actor=bnewbold.net"

# search posts
http get "https://public.api.bsky.app/xrpc/app.bsky.feed.searchPosts?q=moss"

# search accounts/profiles
http get "https://public.api.bsky.app/xrpc/app.bsky.actor.searchActors?q=london"

# get a public feed; this does NOT currently work (requires auth) but we should probably make it work (make auth optional), if the upstream feed generator supports it (and have caching in the path)
http get "https://public.api.bsky.app/xrpc/app.bsky.feed.getFeed?feed=at%3A%2F%2Fdid%3Aplc%3As6jnht6koorxz7trghirytmf%2Fapp.bsky.feed.generator%2Fatproto&limit=30"

@boly38
Copy link

boly38 commented May 17, 2024

my 2 cents : doc and bearer token - first @gaearon bullet - has a dedicated issue : #62

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants