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

OAuth integration #128

Merged
merged 45 commits into from
Sep 3, 2024
Merged

OAuth integration #128

merged 45 commits into from
Sep 3, 2024

Conversation

matthieusieben
Copy link
Contributor

@matthieusieben matthieusieben commented May 31, 2024

Running locally:

  1. Run pnpm i && pnpm build && pnpm dev from atproto's feat-oauth-client branch
  2. Copy the "🗼 Ozone service DID" value printed in the outpur
  3. From this branch: NEXT_PUBLIC_PLC_DIRECTORY_URL="http://localhost:2582" NEXT_PUBLIC_SOCIAL_APP_URL="http://localhost:2584" NEXT_PUBLIC_OZONE_SERVICE_DID="<ENTER_COPIED_OZONE_DID_HERE>" y dev
  4. Visit http://127.0.0.1:3000 (make sure to use 127.0.0.1 and not localhost). Alternatively, start a reverse proxy using: ngrok http 3000 and visit the proxy's URL instead

Copy link

render bot commented May 31, 2024

Copy link

render bot commented May 31, 2024

Copy link
Contributor

@foysalit foysalit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving some comments after reviewing nearly 60% of the changes. Will do another pass once you get the rebased changes in.
Again, apologies for the huge conflict you're handling right now and LMK if I can help!

package.json Outdated Show resolved Hide resolved
lib/util.ts Outdated Show resolved Hide resolved
lib/clsx.ts Outdated Show resolved Hide resolved
app/actions/ModActionPanel/QuickAction.tsx Outdated Show resolved Hide resolved
app/actions/ModActionPanel/QuickAction.tsx Outdated Show resolved Hide resolved
app/oauth-client.json/route.ts Show resolved Hide resolved
Copy link
Contributor

@foysalit foysalit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow this is a massive piece of work! thank you for powering through the conflict resolution and it looks quite good. left some comments and questions but nothing major popped out.

would love to get an extra pair of eyes from @devinivy and then do some testing with our mod team before creating a distro with this so let's hold on to merging until we get a distro out this week. will come back and approve once that's done.

app/actions/ModActionPanel/QuickAction.tsx Outdated Show resolved Hide resolved
components/shell/ConfigurationContext.tsx Show resolved Hide resolved
app/layout.tsx Outdated Show resolved Hide resolved
app/repositories/[id]/[...record]/page-content.tsx Outdated Show resolved Hide resolved
app/subject-status/page.tsx Show resolved Hide resolved
components/config/server-config.tsx Show resolved Hide resolved
components/list/Lists.tsx Show resolved Hide resolved
components/mod-event/ItemTitle.tsx Show resolved Hide resolved
components/shell/AuthContext.tsx Outdated Show resolved Hide resolved
components/shell/ExternalLabelersContext.tsx Show resolved Hide resolved
Copy link
Contributor

@foysalit foysalit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

@arcalinea arcalinea temporarily deployed to oauth-matthieu - ozone-staging PR #128 August 30, 2024 12:46 — with Render Destroyed
@@ -9,10 +9,16 @@ export async function getConfig(): Promise<OzoneConfig> {
if (labelerDid) {
doc = await resolveDidDocData(labelerDid)
const labelerUrl = doc && getServiceUrlFromDoc(doc, 'atproto_labeler')
if (labelerUrl) {
meta = await getOzoneMeta(labelerUrl)
if (process.env.NODE_ENV === 'development' && doc && labelerUrl) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't existence of labelerUrl imply that doc exists? not clear why we need to check for && doc here too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is solely for the purpose of making this work with yarn dev

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with dev-env from atproto, there is no .well-known file, so the getOzoneMeta results in a 404.

I'm open to any other solution for this :-)

export const PLC_DIRECTORY_URL =
process.env.NEXT_PUBLIC_PLC_DIRECTORY_URL || `https://plc.directory`
process.env.NEXT_PUBLIC_PLC_DIRECTORY_URL ||
(process.env.NODE_ENV === 'development'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if hardcoding these based on NODE_ENV is very useful. next.js easily picks up local .env files and that also makes it quite easy to easily change these locally without having to change code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to add more context, it makes total sense that when developing locally, we'd want to point to local atproto dev env but often, I point at staging or production to check UI things which is adds extra step when committing changes etc. so, this is more of a devex consideration.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this so that it works with yarn dev without any additional .env file whatsoever. I am happy to remove this if that breaks your flow.

* 🐛 Allow Only/Exclude/Indifferent filters for appeal status

* 🐛 Fix page title

* Line up logic with surrounding code

Co-authored-by: devin ivy <[email protected]>

---------

Co-authored-by: devin ivy <[email protected]>
@arcalinea arcalinea temporarily deployed to oauth-matthieu - ozone-staging PR #128 September 3, 2024 14:39 — with Render Destroyed
@matthieusieben matthieusieben merged commit 77a3c9b into main Sep 3, 2024
2 of 3 checks passed
@matthieusieben matthieusieben deleted the oauth-matthieu branch September 3, 2024 14:40
@matthieusieben matthieusieben mentioned this pull request Sep 3, 2024
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

Successfully merging this pull request may close these issues.

4 participants