-
Notifications
You must be signed in to change notification settings - Fork 38
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
Remove basic auth #31
Conversation
Your Render PR Server URL is https://ozone-staging-pr-31.onrender.com. Follow its progress at https://dashboard.render.com/web/srv-cnj3ou0l6cac738c52n0. |
Your Render PR Server URL is https://ozone-sandbox-pr-31.onrender.com. Follow its progress at https://dashboard.render.com/web/srv-cnj3ouol6cac738c52q0. |
const { data } = await client.api.com.atproto.identity.resolveHandle( | ||
{ | ||
handle: id, | ||
}, | ||
{ headers: client.proxyHeaders() }, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we want to proxy this one— ozone doesn't have an API endpoint for com.atproto.identity.resolveHandle
.
const { data } = await client.api.app.bsky.feed.getFeedGenerator( | ||
{ | ||
feed: uri, | ||
}, | ||
{ headers: client.proxyHeaders() }, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may need to add this one here to get it proxying properly https://github.com/bluesky-social/atproto/pull/2252/files#diff-e787216db65c3802a97fa55cc04d32c031daa93d27c4340e4f98ed66cea95134
await clientManager.api.com.atproto.admin.deleteCommunicationTemplate( | ||
{ | ||
id: templateId, | ||
}, | ||
{ | ||
headers: clientManager.adminHeaders(), | ||
encoding: 'application/json', | ||
}, | ||
{ id: templateId }, | ||
{ encoding: 'application/json' }, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we lost the headers on this one.
const { data } = await client.api.app.bsky.graph.getList( | ||
{ | ||
list: uri, | ||
limit: 1, | ||
}, | ||
{ headers: client.proxyHeaders() }, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may need to add this one here to get ozone to handle the request: https://github.com/bluesky-social/atproto/pull/2252/files#diff-e787216db65c3802a97fa55cc04d32c031daa93d27c4340e4f98ed66cea95134
const { data } = await client.api.app.bsky.actor.getProfiles( | ||
{ | ||
actors, | ||
}, | ||
{ headers: client.proxyHeaders() }, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another one I think we'll need to add here to get ozone to handle it https://github.com/bluesky-social/atproto/pull/2252/files#diff-e787216db65c3802a97fa55cc04d32c031daa93d27c4340e4f98ed66cea95134
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few things to sync on the backend side of things, but 👏 this is awesome!
lib/client.ts
Outdated
const adminToken = override ?? this.session.adminToken | ||
return { authorization: `Basic ${btoa(`admin:${adminToken}`)}` } | ||
proxyHeaders(override?: string): Record<string, string> { | ||
const proxy = override ?? process.env.ATPROTO_PROXY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this environment variable need to be prefixed with NEXT_PUBLIC_
in order to make it into the build?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another thought, perhaps we should make the env var more descriptive about what it is. I believe the idea here is to specify the ozone DID and service id. So maybe it should be something like OZONE_SERVICE_DID
. Any thoughts @dholms ?
// Check validity of admin token | ||
await agent.api.com.atproto.admin.getRepo( | ||
{ did: login.did }, | ||
{ headers: this.adminHeaders(adminToken) }, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We actually might want to keep a check similar to this: your PDS is going to let you login, but the ozone service may not let you use it due to ACLs.
No description provided.