Skip to content

Conversation

4cecoder
Copy link

@4cecoder 4cecoder commented Oct 24, 2024

Related to #24

Update references from gotrue-go to auth-go in the codebase.

  • client.go

    • Update import paths to reference auth-go instead of gotrue-go.
    • Update the Client struct to use the auth-go client.
    • Update the NewClient function to initialize the auth-go client.
    • Update the SignInWithEmailPassword, SignInWithPhonePassword, EnableTokenAutoRefresh, RefreshToken, and UpdateAuthSession methods to use auth-go types and methods.
  • client_test.go

    • Update import paths to reference auth-go instead of gotrue-go.
    • Update the NewClient function calls to initialize the auth-go client.
    • Update the test functions (TestFrom, TestRpc, TestStorage, and TestFunctions) to use auth-go types and methods.
  • go.mod

    • Remove gotrue-go dependency.
    • Add auth-go dependency.
  • README.md

    • Update the features section to mention auth-go instead of gotrue-go.
  • test/remote_client.go

    • Update import paths to reference auth-go instead of gotrue-go.
    • Update the NewClient function call to initialize the auth-go client.
    • Update the SignInWithEmailPassword method call to use auth-go types and methods.

For more details, open the Copilot Workspace session.

Related to supabase-community#24

Update references from `gotrue-go` to `auth-go` in the codebase.

* **client.go**
  - Update import paths to reference `auth-go` instead of `gotrue-go`.
  - Update the `Client` struct to use the `auth-go` client.
  - Update the `NewClient` function to initialize the `auth-go` client.
  - Update the `SignInWithEmailPassword`, `SignInWithPhonePassword`, `EnableTokenAutoRefresh`, `RefreshToken`, and `UpdateAuthSession` methods to use `auth-go` types and methods.

* **client_test.go**
  - Update import paths to reference `auth-go` instead of `gotrue-go`.
  - Update the `NewClient` function calls to initialize the `auth-go` client.
  - Update the test functions (`TestFrom`, `TestRpc`, `TestStorage`, and `TestFunctions`) to use `auth-go` types and methods.

* **go.mod**
  - Remove `gotrue-go` dependency.
  - Add `auth-go` dependency.

* **README.md**
  - Update the features section to mention `auth-go` instead of `gotrue-go`.

* **test/remote_client.go**
  - Update import paths to reference `auth-go` instead of `gotrue-go`.
  - Update the `NewClient` function call to initialize the `auth-go` client.
  - Update the `SignInWithEmailPassword` method call to use `auth-go` types and methods.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/supabase-community/supabase-go/issues/24?shareId=XXXX-XXXX-XXXX-XXXX).
- Add email/phone signup and signin tests
- Implement token refresh and session management tests
- Add user info retrieval and logout tests
- Update to use auth-go types and requests
@4cecoder
Copy link
Author

@akmalcm how do we like the updates to this PR?

@4cecoder
Copy link
Author

This pull request includes multiple changes to the Supabase Go client, primarily focusing on updating the authentication integration and improving the codebase by removing unnecessary comments and making the code more concise. The most important changes include switching from gotrue-go to auth-go for authentication, updating the associated imports and client initialization, and enhancing the test suite with new authentication tests.

Authentication Integration Update:

  • Updated the authentication integration from gotrue-go to auth-go in the README.md file and across the codebase. [1] [2] [3] [4]

Codebase Improvements:

  • Removed unnecessary comments and streamlined the client.go file for better readability. [1] [2] [3] [4]

Test Suite Enhancements:

  • Added new tests for authentication functions using the auth-go package in the client_test.go file.

Dependency Updates:

  • Updated the go.mod file to include the new auth-go dependency and removed the old gotrue-go dependency.

Miscellaneous:

  • Updated example usage in test/remote_client.go to reflect the new authentication integration. [1] [2]

Copy link

@akmalcm akmalcm left a comment

Choose a reason for hiding this comment

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

looks good to me, will need repo's contributor to review too

)

func TestFrom(t *testing.T) {
client, err := supabase.NewClient(API_URL, API_KEY, nil)

Choose a reason for hiding this comment

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

Why prefer supa over supabase? The latter feels better to me.

Copy link
Author

Choose a reason for hiding this comment

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

You're right. It was to quickly distinguish my old closet from a new revision.

@viniciuspalma
Copy link

What's blocking this change?

@0x113
Copy link

0x113 commented Jan 25, 2025

It would be good to merge this PR if contributors are good with it.

@felangga
Copy link

Merge this PR please 🙏

@o4f6bgpac3
Copy link

Please merge this PR.

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.

7 participants