Monday, May 6, 2024
HomeGolangA person administration and authentication server written in Golang

A person administration and authentication server written in Golang


GoTrue is a person administration and authentication server written in Go that powers Supabase‘s options resembling:

  • Issuing JWTs
  • Row Stage Safety with PostgREST
  • Consumer administration
  • Sign up with e mail, password, magic hyperlink, telephone quantity
  • Sign up with exterior suppliers (Google, Apple, Fb, Discord, …)

It’s initially based mostly on the wonderful GoTrue codebase by Netlify, nevertheless each have diverged considerably in options and capabilities.

Fast Begin

Create a .env file to retailer your personal customized env vars. See instance.env

  1. Begin the native postgres database in a postgres container: docker-compose -f docker-compose-dev.yml up postgres
  2. Construct the gotrue binary: make construct . You must see an output like this:
go construct -ldflags "-X github.com/supabase/gotrue/cmd.Model=`git rev-parse HEAD`"
GOOS=linux GOARCH=arm64 go construct -ldflags "-X github.com/supabase/gotrue/cmd.Model=`git rev-parse HEAD`" -o gotrue-arm64
  1. Execute the gotrue binary: ./gotrue

In case you have docker put in

Create a .env.docker file to retailer your personal customized env vars. See instance.docker.env

  1. make construct
  2. make dev
  3. docker ps ought to present 2 docker containers (gotrue_postgresql and gotrue_gotrue)
  4. That’s it! Go to the well being checkendpoint to verify that gotrue is working.

Operating in manufacturing

Operating an authentication server in manufacturing is just not a simple feat. We suggest utilizing Supabase Auth which will get common safety updates.

In any other case, please be sure you setup a course of to promptly replace to the newest model. You are able to do that by following this repository, particularly the Releases and Safety Advisories sections.

Backward compatibility

GoTrue makes use of the Semantic Versioning scheme. Listed below are some additional clarifications on backward compatibility ensures:

Go API compatibility

GoTrue is just not meant for use as a Go library. There are not any ensures on backward API compatibility when used this fashion regardless which model quantity adjustments.

Patch

Modifications to the patch model ensures backward compatibility with:

  • Database objects (tables, columns, indexes, capabilities).
  • REST API
  • JWT construction
  • Configuration
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments