Skip to content

Commit 8430113

Browse files
authored
feat: rename gotrue to auth (#1340)
Renames the repo, images and most code places referencing GoTrue to Auth. Configs will remain to be prefixed `GOTRUE` for backward compatibility.
1 parent 7ac7586 commit 8430113

File tree

163 files changed

+440
-485
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+440
-485
lines changed

.github/workflows/mirror.yml

-37
This file was deleted.

.github/workflows/publish.yml

+5
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ jobs:
2727
ghcr.io/supabase/gotrue
2828
436098097459.dkr.ecr.us-east-1.amazonaws.com/gotrue
2929
646182064048.dkr.ecr.us-east-1.amazonaws.com/gotrue
30+
supabase/auth
31+
public.ecr.aws/supabase/auth
32+
ghcr.io/supabase/auth
33+
436098097459.dkr.ecr.us-east-1.amazonaws.com/auth
34+
646182064048.dkr.ecr.us-east-1.amazonaws.com/auth
3035
flavor: |
3136
latest=false
3237
tags: |

.github/workflows/test.yml

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ on:
55
push:
66
branches:
77
- master
8-
- saml
9-
- zerosessionidfix
108
tags: ['*']
119

1210
jobs:

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ vendor/
33
gotrue
44
gotrue-arm64
55
gotrue.exe
6+
auth
7+
auth-arm64
8+
auth.exe
69

710
coverage.out
811

.releaserc

+1-9
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
{
22
"branches": [
3-
"master",
4-
{
5-
"name": "lastsigninatfix",
6-
"prerelease": true
7-
},
8-
{
9-
"name": "mfa",
10-
"prerelease": true
11-
}
3+
"master"
124
],
135
"plugins": [
146
"@semantic-release/commit-analyzer",

CONTRIBUTING.md

+32-32
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ Please help us keep all our projects open and inclusive. Kindly follow our [Code
88

99
## Quick Start
1010

11-
GoTrue has a development container setup that makes it easy to get started contributing. This setup only requires that [Docker](https://www.docker.com/get-started) is setup on your system. The development container setup includes a PostgreSQL container with migrations already applied and a container running GoTrue that will perform a hot reload when changes to the source code are detected.
11+
Auth has a development container setup that makes it easy to get started contributing. This setup only requires that [Docker](https://www.docker.com/get-started) is setup on your system. The development container setup includes a PostgreSQL container with migrations already applied and a container running GoTrue that will perform a hot reload when changes to the source code are detected.
1212

13-
If you would like to run GoTrue locally or learn more about what these containers are doing for you, continue reading the [Setup and Tooling](#setup-and-tooling) section below. Otherwise, you can skip ahead to the [How To Verify that GoTrue is Available](#how-to-verify-that-gotrue-is-available) section to learn about working with and developing GoTrue.
13+
If you would like to run Auth locally or learn more about what these containers are doing for you, continue reading the [Setup and Tooling](#setup-and-tooling) section below. Otherwise, you can skip ahead to the [How To Verify that GoTrue is Available](#how-to-verify-that-auth-is-available) section to learn about working with and developing GoTrue.
1414

15-
Before using the containers, you will need to make sure an `.env.docker` file exists by making a copy of `example.docker.env` and configuring it for your needs. The set of env vars in `example.docker.env` only contain the necessary env vars for gotrue to start in a docker environment. For the full list of env vars, please refer to `example.env` and copy over the necessary ones into your `.env.docker` file.
15+
Before using the containers, you will need to make sure an `.env.docker` file exists by making a copy of `example.docker.env` and configuring it for your needs. The set of env vars in `example.docker.env` only contain the necessary env vars for auth to start in a docker environment. For the full list of env vars, please refer to `example.env` and copy over the necessary ones into your `.env.docker` file.
1616

1717
The following are some basic commands. A full and up to date list of commands can be found in the project's `Makefile` or by running `make help`.
1818

@@ -50,12 +50,12 @@ make docker-build
5050

5151
## Setup and Tooling
5252

53-
GoTrue -- as the name implies -- is a user registration and authentication API developed in [Go](https://go.dev).
53+
Auth -- as the name implies -- is a user registration and authentication API developed in [Go](https://go.dev).
5454

5555
It connects to a [PostgreSQL](https://www.postgresql.org) database in order to store authentication data, [Soda CLI](https://gobuffalo.io/en/docs/db/toolbox) to manage database schema and migrations,
5656
and runs inside a [Docker](https://www.docker.com/get-started) container.
5757

58-
Therefore, to contribute to GoTrue you will need to install these tools.
58+
Therefore, to contribute to Auth you will need to install these tools.
5959

6060
### Install Tools
6161

@@ -91,25 +91,25 @@ If you are on macOS Catalina you may [run into issues installing Soda with Brew]
9191
go install github.com/gobuffalo/pop/soda@latest
9292
```
9393

94-
- Clone the GoTrue [repository](https://github.com/supabase/gotrue)
94+
- Clone the Auth [repository](https://github.com/supabase/auth)
9595

9696
```
97-
git clone https://github.com/supabase/gotrue
97+
git clone https://github.com/supabase/auth
9898
```
9999

100-
### Install GoTrue
100+
### Install Auth
101101

102102
To begin installation, be sure to start from the root directory.
103103

104-
- `cd gotrue`
104+
- `cd auth`
105105

106106
To complete installation, you will:
107107

108108
- Install the PostgreSQL Docker image
109109
- Create the DB Schema and Migrations
110110
- Setup a local `.env` for environment variables
111-
- Compile GoTrue
112-
- Run the GoTrue binary executable
111+
- Compile Auth
112+
- Run the Auth binary executable
113113

114114
#### Installation Steps
115115

@@ -159,7 +159,7 @@ Status: Downloaded newer image for postgres:14
159159
f709b97d83fddc3b099e4f2ddc4cb2fbf68052e7a8093332bec57672f38cfa36
160160
```
161161

162-
You should then see in Docker that `gotrue_postgresql` is running on `port: 5432`.
162+
You should then see in Docker that `auth_postgresql` is running on `port: 5432`.
163163

164164
> **Important** If you happen to already have a local running instance of Postgres running on the port `5432` because you
165165
> may have installed via [homebrew on OSX](https://formulae.brew.sh/formula/postgresql) then be certain to stop the process using:
@@ -168,7 +168,7 @@ You should then see in Docker that `gotrue_postgresql` is running on `port: 5432
168168
>
169169
> If you need to run the test environment on another port, you will need to modify several configuration files to use a different custom port.
170170
171-
3. Next compile the GoTrue binary:
171+
3. Next compile the Auth binary:
172172

173173
```
174174
make build
@@ -180,10 +180,10 @@ make build
180180
make migrate_test
181181
```
182182

183-
You should see log messages that indicate that the GoTrue migrations were applied successfully:
183+
You should see log messages that indicate that the Auth migrations were applied successfully:
184184

185185
```terminal
186-
INFO[0000] GoTrue migrations applied successfully
186+
INFO[0000] Auth migrations applied successfully
187187
DEBU[0000] after status
188188
[POP] 2021/12/15 10:44:36 sql - SELECT EXISTS (SELECT schema_migrations.* FROM schema_migrations AS schema_migrations WHERE version = $1) | ["20210710035447"]
189189
[POP] 2021/12/15 10:44:36 sql - SELECT EXISTS (SELECT schema_migrations.* FROM schema_migrations AS schema_migrations WHERE version = $1) | ["20210722035447"]
@@ -201,39 +201,39 @@ Version Name Status
201201
That lists each migration that was applied. Note: there may be more migrations than those listed.
202202

203203
4. Create a `.env` file in the root of the project and copy the following config in [example.env](example.env)
204-
5. In order to have GoTrue connect to your PostgreSQL database running in Docker, it is important to set a connection string like:
204+
5. In order to have Auth connect to your PostgreSQL database running in Docker, it is important to set a connection string like:
205205

206206
```
207207
DATABASE_URL="postgres://supabase_auth_admin:root@localhost:5432/postgres"
208208
```
209209

210-
> Important: GoTrue requires a set of SMTP credentials to run, you can generate your own SMTP credentials via an SMTP provider such as AWS SES, SendGrid, MailChimp, SendInBlue or any other SMTP providers.
210+
> Important: Auth requires a set of SMTP credentials to run, you can generate your own SMTP credentials via an SMTP provider such as AWS SES, SendGrid, MailChimp, SendInBlue or any other SMTP providers.
211211
212-
6. Then finally Start GoTrue
213-
7. Verify that GoTrue is Available
212+
6. Then finally Start Auth
213+
7. Verify that Auth is Available
214214

215-
### Starting GoTrue
215+
### Starting Auth
216216

217-
Start GoTrue by running the executable:
217+
Start Auth by running the executable:
218218

219219
```
220-
./gotrue
220+
./auth
221221
```
222222

223-
This command will re-run migrations and then indicate that GoTrue has started:
223+
This command will re-run migrations and then indicate that Auth has started:
224224

225225
```
226-
INFO[0000] GoTrue API started on: localhost:9999
226+
INFO[0000] Auth API started on: localhost:9999
227227
```
228228

229-
### How To Verify that GoTrue is Available
229+
### How To Verify that Auth is Available
230230

231-
To test that your GoTrue is up and available, you can query the `health` endpoint at `http://localhost:9999/health`. You should see a response similar to:
231+
To test that your Auth is up and available, you can query the `health` endpoint at `http://localhost:9999/health`. You should see a response similar to:
232232

233233
```json
234234
{
235-
"description": "GoTrue is a user registration and authentication API",
236-
"name": "GoTrue",
235+
"description": "Auth is a user registration and authentication API",
236+
"name": "Auth",
237237
"version": ""
238238
}
239239
```
@@ -430,7 +430,7 @@ make migrate_test
430430

431431
## Testing
432432

433-
Currently, we don't use a separate test database, so the same database created when installing GoTrue to run locally is used.
433+
Currently, we don't use a separate test database, so the same database created when installing Auth to run locally is used.
434434

435435
The following commands should help in setting up a database and running the tests:
436436

@@ -485,10 +485,10 @@ export GOTRUE_DB_DATABASE_URL="postgres://supabase_auth_admin:root@localhost:743
485485

486486
```
487487
# Command line into bash on the PostgreSQL container
488-
docker exec -it gotrue_postgresql bash
488+
docker exec -it auth_postgresql bash
489489
490490
# Removes Container
491-
docker container rm -f gotrue_postgresql
491+
docker container rm -f auth_postgresql
492492
493493
# Removes volume
494494
docker volume rm postgres_data
@@ -537,5 +537,5 @@ Since implementing an additional OAuth provider consists of making api calls to
537537

538538
## License
539539

540-
By contributing to GoTrue, you agree that your contributions will be licensed
540+
By contributing to Auth, you agree that your contributions will be licensed
541541
under its [MIT license](LICENSE).

Dockerfile.dev

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ENV GOOS=linux
55

66
RUN apk add --no-cache make git bash
77

8-
WORKDIR /go/src/github.com/supabase/gotrue
8+
WORKDIR /go/src/github.com/supabase/auth
99

1010
# Pulling dependencies
1111
COPY ./Makefile ./go.* ./

Makefile

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.PHONY: all build deps dev-deps image migrate test vet sec format unused
22
CHECK_FILES?=./...
3-
FLAGS?=-ldflags "-X github.com/supabase/gotrue/internal/utilities.Version=`git describe --tags`" -buildvcs=false
3+
FLAGS?=-ldflags "-X github.com/supabase/auth/internal/utilities.Version=`git describe --tags`" -buildvcs=false
44
DEV_DOCKER_COMPOSE:=docker-compose-dev.yml
55

66
help: ## Show this help.
@@ -10,7 +10,7 @@ all: vet sec static build ## Run the tests and build the binary.
1010

1111
build: deps ## Build the binary.
1212
CGO_ENABLED=0 go build $(FLAGS)
13-
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build $(FLAGS) -o gotrue-arm64
13+
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build $(FLAGS) -o auth-arm64
1414

1515
dev-deps: ## Install developer dependencies
1616
@go install github.com/gobuffalo/pop/soda@latest
@@ -62,14 +62,14 @@ down: ## Shutdown the development containers
6262

6363
docker-test: ## Run the tests using the development containers
6464
docker-compose -f $(DEV_DOCKER_COMPOSE) up -d postgres
65-
docker-compose -f $(DEV_DOCKER_COMPOSE) run gotrue sh -c "make migrate_test"
66-
docker-compose -f $(DEV_DOCKER_COMPOSE) run gotrue sh -c "make test"
65+
docker-compose -f $(DEV_DOCKER_COMPOSE) run auth sh -c "make migrate_test"
66+
docker-compose -f $(DEV_DOCKER_COMPOSE) run auth sh -c "make test"
6767
docker-compose -f $(DEV_DOCKER_COMPOSE) down -v
6868

6969
docker-build: ## Force a full rebuild of the development containers
7070
docker-compose -f $(DEV_DOCKER_COMPOSE) build --no-cache
7171
docker-compose -f $(DEV_DOCKER_COMPOSE) up -d postgres
72-
docker-compose -f $(DEV_DOCKER_COMPOSE) run gotrue sh -c "make migrate_dev"
72+
docker-compose -f $(DEV_DOCKER_COMPOSE) run auth sh -c "make migrate_dev"
7373
docker-compose -f $(DEV_DOCKER_COMPOSE) down
7474

7575
docker-clean: ## Remove the development containers and volumes

0 commit comments

Comments
 (0)