Skip to content

Conversation

@soneda-yuya
Copy link
Contributor

@soneda-yuya soneda-yuya commented Oct 24, 2025

Overview

This branch integrates the Re:Earth Accounts API client
package to replace the self-implemented authentication
system, improving the authentication architecture and
removing code duplication.

Key Changes

Authentication System Refactoring:

  • Replaced self-implemented auth logic with
    github.com/reearth/reearth-accounts/server client
    package
  • Updated auth middleware to use the new accounts API
    client
  • Modified user queries to fetch data from accounts
    service (GetMe endpoint)
  • Added auth transport layer for proper token handling

Notable Files Changed:

  • server/internal/adapter/accounts/auth_transport.go:
    New auth transport implementation
  • server/internal/app/auth_client.go: Refactored to use
    accounts API client
  • server/internal/adapter/gql/resolver_user.go: Updated
    user resolver methods
  • Multiple middleware and context files updated for new
    auth flow

Dependency Updates:

  • Added github.com/reearth/reearth-accounts/server as a
    dependency
  • Updated related Go modules and dependencies

Impact

  • Centralizes authentication logic through the accounts
    service
  • Removes maintenance burden of custom auth
    implementation
  • Improves consistency across Re:Earth services
  • Sets foundation for future auth features from the
    accounts service

What I've done

What I haven't done

How I tested

Which point I want you to review particularly

Memo

@soneda-yuya soneda-yuya changed the title chore(server): import reearth-accounts/server feat(server): use reearth-accounts api client pkg instead of using self implementation Oct 28, 2025
@soneda-yuya soneda-yuya marked this pull request as ready for review October 29, 2025 06:18
@soneda-yuya soneda-yuya requested a review from pyshx as a code owner October 29, 2025 06:18
Copilot AI review requested due to automatic review settings October 29, 2025 06:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR migrates from an internal accounts infrastructure to using the external reearth-accounts server client library. The changes involve replacing custom GraphQL client code with a standardized client library and updating dependencies.

Key Changes:

  • Replaced internal server/internal/infrastructure/accounts package with github.com/reearth/reearth-accounts/server/pkg/gqlclient
  • Added new dependency: github.com/reearth/reearth-accounts/server v0.0.0-20251029041058-19ad61a40385
  • Updated numerous Go dependencies to newer versions
  • Generated mock for user.Repo interface using go-mock

Reviewed Changes

Copilot reviewed 21 out of 22 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
server/pkg/user/mockrepo/mockrepo.go Generated mock implementation for user repository
server/internal/infrastructure/accounts/* Removed internal accounts infrastructure (client, repos, models)
server/internal/adapter/gql/resolver.go Updated to use external gqlclient.Client
server/internal/app/*.go Updated imports and client initialization
server/go.mod Added reearth-accounts dependency and updated dependencies
server/go.sum Updated dependency checksums

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants