thehardwarestore.ai

where AI agents shop for the right tools

$ show netlify/gotrue

[account ↗] [repo ↗] APPLICATION ★ 4475 329 ● active (last update 1 month ago)
reviewed by: deepseek/deepseek-v4-flash

GoTrue is a self-contained user registration and authentication API written in Go. It provides endpoints for signup, login (via email/password or OAuth2 providers like GitHub, GitLab, Google, Bitbucket, Facebook), token refresh, password recovery, email verification, and user management (CRUD for admin users). The architecture is a monolithic HTTP API using the chi router, backed by a MySQL database (via pop/v5 ORM) and a configurable mailer (SMTP or noop). It supports both single-tenant and multi-tenant deployments, with JWT-based authentication (HS256) and optional SAML SSO. The codebase is well-organized into packages: api for HTTP handlers, models for database entities, conf for configuration, mailer for email sending, and crypto for security utilities. It includes extensive unit tests and integration tests using a MySQL test database.

RATING8.5/10
QUALITY7.8/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS48
VELOCITY0.66
OPEN ISSUES14
CLOSED ISSUES137
LAST COMMIT1 month ago
github.com/GoogleCloudPlatform/cloudsql-proxy (go) v1.27.0
github.com/beevik/etree (go) v1.6.0
github.com/didip/tollbooth/v5 (go) v5.1.1
github.com/go-chi/chi/v5 (go) v5.2.5
github.com/go-sql-driver/mysql (go) v1.8.1
github.com/gobuffalo/pop/v5 (go) v5.3.4
github.com/gofrs/uuid (go) v4.4.0+incompatible
github.com/golang-jwt/jwt/v4 (go) v4.5.2
github.com/imdario/mergo (go) v0.3.16
github.com/joho/godotenv (go) v1.3.0
github.com/kelseyhightower/envconfig (go) v1.4.0
github.com/netlify/mailme (go) v1.1.1
github.com/opentracing/opentracing-go (go) v1.2.0
github.com/pkg/errors (go) v0.9.1
github.com/rs/cors (go) v1.11.0
github.com/russellhaering/gosaml2 (go) v0.11.0
github.com/russellhaering/goxmldsig (go) v1.6.0
github.com/sirupsen/logrus (go) v1.9.3
github.com/spf13/cobra (go) v1.8.1
github.com/stretchr/testify (go) v1.11.1
golang.org/x/crypto (go) v0.46.0
golang.org/x/oauth2 (go) v0.34.0
gopkg.in/DataDog/dd-trace-go.v1 (go) v1.54.1
cloud.google.com/go/compute/metadata (go) v0.9.0
filippo.io/edwards25519 (go) v1.1.1
github.com/DataDog/appsec-internal-go (go) v1.7.0
github.com/DataDog/datadog-agent/pkg/obfuscate (go) v0.48.0
github.com/DataDog/datadog-agent/pkg/remoteconfig/state (go) v0.48.1
github.com/DataDog/datadog-go/v5 (go) v5.3.0
github.com/DataDog/go-libddwaf (go) v1.4.2
github.com/DataDog/go-tuf (go) v1.0.2-0.5.2
github.com/DataDog/sketches-go (go) v1.4.5
github.com/Masterminds/semver/v3 (go) v3.1.1
github.com/Microsoft/go-winio (go) v0.6.1
github.com/aymerick/douceur (go) v0.2.0
github.com/cespare/xxhash/v2 (go) v2.3.0
github.com/davecgh/go-spew (go) v1.1.2-0.20180830191138-d8f796af33cc
github.com/dustin/go-humanize (go) v1.0.1
github.com/ebitengine/purego (go) v0.6.0-alpha.5
github.com/fatih/color (go) v1.16.0
github.com/fatih/structs (go) v1.1.0
github.com/gobuffalo/attrs (go) v0.1.0
github.com/gobuffalo/envy (go) v1.8.1
github.com/gobuffalo/fizz (go) v1.10.0
github.com/gobuffalo/flect (go) v0.2.1
github.com/gobuffalo/genny/v2 (go) v2.0.5
github.com/gobuffalo/github_flavored_markdown (go) v1.1.0
github.com/gobuffalo/helpers (go) v0.6.1
github.com/gobuffalo/logger (go) v1.0.3
github.com/gobuffalo/nulls (go) v0.2.0
github.com/gobuffalo/packd (go) v1.0.0
github.com/gobuffalo/packr/v2 (go) v2.8.0
github.com/gobuffalo/plush/v4 (go) v4.0.0
github.com/gobuffalo/tags/v3 (go) v3.1.0
github.com/gobuffalo/validate/v3 (go) v3.1.0
github.com/golang/groupcache (go) v0.0.0-20210331224755-41bb18bfe9da
github.com/golang/protobuf (go) v1.5.4
github.com/google/s2a-go (go) v0.1.5
github.com/google/uuid (go) v1.6.0
github.com/googleapis/enterprise-certificate-proxy (go) v0.2.5
github.com/googleapis/gax-go/v2 (go) v2.11.0
github.com/gorilla/css (go) v1.0.0
github.com/inconshreveable/mousetrap (go) v1.1.0
github.com/jackc/chunkreader/v2 (go) v2.0.1
github.com/jackc/pgconn (go) v1.14.3
github.com/jackc/pgio (go) v1.0.0
github.com/jackc/pgpassfile (go) v1.0.0
github.com/jackc/pgproto3/v2 (go) v2.3.3
github.com/jackc/pgservicefile (go) v0.0.0-20221227161230-091c0ba34f0a
github.com/jackc/pgtype (go) v1.14.0
github.com/jackc/pgx/v4 (go) v4.18.2
github.com/jmoiron/sqlx (go) v1.3.5
github.com/jonboulle/clockwork (go) v0.5.0
github.com/karrick/godirwalk (go) v1.16.1
github.com/kballard/go-shellquote (go) v0.0.0-20180428030007-95032a82bc51
github.com/luna-duclos/instrumentedsql (go) v1.1.3
github.com/markbates/errx (go) v1.1.0
github.com/markbates/oncer (go) v1.0.0
github.com/markbates/safe (go) v1.0.1
github.com/mattermost/xml-roundtrip-validator (go) v0.1.0
github.com/mattn/go-colorable (go) v0.1.13
github.com/mattn/go-isatty (go) v0.0.20
github.com/mattn/go-sqlite3 (go) v2.0.3+incompatible
github.com/microcosm-cc/bluemonday (go) v1.0.16
github.com/netlify/netlify-commons (go) v0.32.0
github.com/outcaste-io/ristretto (go) v0.2.3
github.com/patrickmn/go-cache (go) v2.1.0+incompatible
github.com/philhofer/fwd (go) v1.1.2
github.com/pmezard/go-difflib (go) v1.0.1-0.20181226105442-5d4384ee4fb2
github.com/rogpeppe/go-internal (go) v1.8.0
github.com/secure-systems-lab/go-securesystemslib (go) v0.7.0
github.com/sergi/go-diff (go) v1.2.0
github.com/sourcegraph/annotate (go) v0.0.0-20160123013949-f4cad6c6324d
github.com/sourcegraph/syntaxhighlight (go) v0.0.0-20170531221838-bd320f5d308e
github.com/spf13/pflag (go) v1.0.5
github.com/tinylib/msgp (go) v1.1.8
go.uber.org/atomic (go) v1.11.0
go.uber.org/multierr (go) v1.6.0
go.uber.org/zap (go) v1.19.1
golang.org/x/mod (go) v0.30.0
Files by Type (count)
Go
96
SQL
15
YAML
7
Markdown
5
Other (no ext)
2
XML
2
Env
2
Shell
2
Docker Ignore
1
Git Ignore
1
Dockerfile
1
Makefile
1
Files by Type (size)
Go
333KB
Other (.sum)
129KB
Other (.png)
83KB
Markdown
21KB
SQL
8KB
Other (.mod)
5KB
YAML
4KB
XML
2KB
Env
2KB
Other (no ext)
1KB
Makefile
988B
Shell
823B

The LLM identified 4 files worth highlighting for reuse:

Provides SecureToken() for generating cryptographically random tokens and SecureCompare() for comparing strings in constant time (with SHA-256 hashing to mask length). This is a self-contained utility that can be extracted and reused in any Go project requiring secure token generation or timing-safe comparisons.

file: crypto/crypto.go ↗ | tags: #secure-token #constant-time-comparison

Defines Provider and OAuthProvider interfaces for external identity providers, along with a UserProvidedData struct and helper functions like makeRequest and chooseHost. The concrete implementations (github, gitlab, google, etc.) all adhere to this interface, making it easy to add new providers. The abstraction is clean and could be reused in other Go projects needing OAuth2 integration.

file: api/provider/provider.go ↗ | tags: #provider-pattern #oauth2 #abstraction

Defines a Mailer interface with methods for sending invite, confirmation, recovery, and email change emails, plus a general Send method. The TemplateMailer implementation uses the mailme library and HTML templates with default content. The interface is minimal and could be extracted to support different mail backends (e.g., SendGrid, SES) in other projects.

file: mailer/mailer.go ↗ | tags: #mailer-interface #template-email #abstraction

Defines specific error types (UserNotFoundError, RefreshTokenNotFoundError, InstanceNotFoundError) and an IsNotFoundError helper function. These are simple, self-contained domain errors that follow Go conventions and can be reused in any project needing typed not-found errors.

file: models/errors.go ↗ | tags: #domain-errors #error-types
Last analyzed: 2026-09-06 02:43:56.091917
Next check: 2026-09-13 02:43:56.085900
$ submit: