Commits
Adds some basic stuff to the Accounts context, including the session upsert
Covers Discovery, PAR, session, etc.
```
iex(8)> {:ok, server} = AnnotAt.Atproto.OAuth.Discovery.discover(id.pds_endpoint)
{:ok,
%AnnotAt.Atproto.OAuth.ServerMetadata{
issuer: "https://bsky.social",
authorization_endpoint: "https://bsky.social/oauth/authorize",
token_endpoint: "https://bsky.social/oauth/token",
par_endpoint: "https://bsky.social/oauth/par",
scopes_supported: ["atproto", "transition:email", "transition:generic",
"transition:chat.bsky"],
revocation_endpoint: "https://bsky.social/oauth/revoke"
}}
```
Might've diverged a bit from my original plan. Verified in IEx
```
iex(2)> AnnotAt.Atproto.Identity.resolve_handle("atproto.com")
{:ok,
%AnnotAt.Atproto.Identity{
did: "did:plc:ewvi7nxzyoun6zhxrhs64oiz",
handle: "atproto.com",
pds_endpoint: "https://enoki.us-east.host.bsky.network"
}}
iex(3)> AnnotAt.Atproto.Identity.resolve_handle("jola.dev")
{:ok,
%AnnotAt.Atproto.Identity{
did: "did:plc:bvraa6gajy4tfr3eh2sisdkr",
handle: "jola.dev",
pds_endpoint: "https://shaggymane.us-west.host.bsky.network"
}}
```
Avoided using Ecto.Changeset to make it easier to move this out at a later point
First batch of atproto related code. Roughly inspired by `atex` and lots of digging. Going to want to go over this code again properly cause it's all scary crypto stuff. Wouldn't normally want that kind of code "handrolled" but it's all fairly standard and eg assent doesn't support atproto, so here we are.
Covers Discovery, PAR, session, etc.
```
iex(8)> {:ok, server} = AnnotAt.Atproto.OAuth.Discovery.discover(id.pds_endpoint)
{:ok,
%AnnotAt.Atproto.OAuth.ServerMetadata{
issuer: "https://bsky.social",
authorization_endpoint: "https://bsky.social/oauth/authorize",
token_endpoint: "https://bsky.social/oauth/token",
par_endpoint: "https://bsky.social/oauth/par",
scopes_supported: ["atproto", "transition:email", "transition:generic",
"transition:chat.bsky"],
revocation_endpoint: "https://bsky.social/oauth/revoke"
}}
```
Might've diverged a bit from my original plan. Verified in IEx
```
iex(2)> AnnotAt.Atproto.Identity.resolve_handle("atproto.com")
{:ok,
%AnnotAt.Atproto.Identity{
did: "did:plc:ewvi7nxzyoun6zhxrhs64oiz",
handle: "atproto.com",
pds_endpoint: "https://enoki.us-east.host.bsky.network"
}}
iex(3)> AnnotAt.Atproto.Identity.resolve_handle("jola.dev")
{:ok,
%AnnotAt.Atproto.Identity{
did: "did:plc:bvraa6gajy4tfr3eh2sisdkr",
handle: "jola.dev",
pds_endpoint: "https://shaggymane.us-west.host.bsky.network"
}}
```
First batch of atproto related code. Roughly inspired by `atex` and lots of digging. Going to want to go over this code again properly cause it's all scary crypto stuff. Wouldn't normally want that kind of code "handrolled" but it's all fairly standard and eg assent doesn't support atproto, so here we are.