Skip to content

Commit 7ff716b

Browse files
nicokempecstockton
andauthored
docs: polish readme, update example.env, and gitignore (#2173)
## What kind of change does this PR introduce? Docs update / configuration cleanup ## What is the current behavior? * README contained inconsistent wording, capitalization, and formatting. * `example.env` provider sections weren’t fully normalized (e.g., brand naming). * `.idea` IDE files were not ignored, risking accidental commits. ## What is the new behavior? * README polished for clarity and consistency (terminology, grammar, branding). * `example.env` updated with cleaner provider sections and improved comments (e.g., explicit **Twitter (X)** naming). * `.gitignore` updated to exclude `.idea` directories. * Inherited features section: updated the outdated note on JWT signing. It now reflects current Supabase Auth behavior: asymmetric signing keys (RS256 by default, ECC/Ed25519 optional) are supported and recommended, while HS256 remains for compatibility. ## Additional context This PR improves documentation and developer ergonomics only. Read through the readme because I wanted to contribute to the project and just updated everything that didn't look right. No functional or runtime changes. --------- Co-authored-by: Chris Stockton <180184+cstockton@users.noreply.github.com>
1 parent 6b382ae commit 7ff716b

File tree

3 files changed

+41
-37
lines changed

3 files changed

+41
-37
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ coverage.out
1212

1313
.DS_Store
1414
.vscode
15+
.idea
1516
www/dist/
1617
www/.DS_Store
1718
www/node_modules

README.md

Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ It is originally based on the excellent
1616

1717
If you wish to contribute to the project, please refer to the [contributing guide](/CONTRIBUTING.md).
1818

19-
## Table Of Contents
19+
## Table of Contents
2020

2121
- [Quick Start](#quick-start)
2222
- [Running in Production](#running-in-production)
@@ -25,9 +25,9 @@ If you wish to contribute to the project, please refer to the [contributing guid
2525

2626
## Quick Start
2727

28-
Create a `.env` file to store your own custom env vars. See [`example.env`](example.env)
28+
Create a `.env` file to store your own custom environment variables. See [`example.env`](example.env)
2929

30-
1. Start the local postgres database in a postgres container: `docker-compose -f docker-compose-dev.yml up postgres`
30+
1. Start the local Postgres database in a Postgres container: `docker-compose -f docker-compose-dev.yml up postgres`
3131
2. Build the auth binary: `make build` . You should see an output like this:
3232

3333
```bash
@@ -37,22 +37,22 @@ GOOS=linux GOARCH=arm64 go build -ldflags "-X github.com/supabase/auth/cmd.Versi
3737

3838
3. Execute the auth binary: `./auth`
3939

40-
### If you have docker installed
40+
### If you have Docker installed
4141

4242
Create a `.env.docker` file to store your own custom env vars. See [`example.docker.env`](example.docker.env)
4343

4444
1. `make build`
4545
2. `make dev`
46-
3. `docker ps` should show 2 docker containers (`auth-auth-1` and `auth-postgres-1`)
47-
4. That's it! Visit the [health checkendpoint](http://localhost:9999/health) to confirm that auth is running.
46+
3. `docker ps` should show two Docker containers (`auth-auth-1` and `auth-postgres-1`)
47+
4. That's it! Visit the [health check endpoint](http://localhost:9999/health) to confirm that auth is running.
4848

4949
## Running in production
5050

5151
Running an authentication server in production is not an easy feat. We
5252
recommend using [Supabase Auth](https://supabase.com/auth) which gets regular
5353
security updates.
5454

55-
Otherwise, please make sure you setup a process to promptly update to the
55+
Otherwise, please make sure you set up a process to promptly update to the
5656
latest version. You can do that by following this repository, specifically the
5757
[Releases](https://github.com/supabase/auth/releases) and [Security
5858
Advisories](https://github.com/supabase/auth/security/advisories) sections.
@@ -65,8 +65,8 @@ further clarifications on backward compatibility guarantees:
6565
**Go API compatibility**
6666

6767
Auth is not meant to be used as a Go library. There are no guarantees on
68-
backward API compatibility when used this way regardless which version number
69-
changes.
68+
backward API compatibility when used this way regardless of which version
69+
number changes.
7070

7171
**Patch**
7272

@@ -145,9 +145,12 @@ comprehensive list of those features:
145145
3. Super admin via the `is_super_admin` column.
146146
4. Group information in JWTs via `GOTRUE_JWT_ADMIN_GROUP_NAME` and other
147147
configuration fields.
148-
5. Symmetrics JWTs. In the future it is very likely that Auth will begin
149-
issuing asymmetric JWTs (subject to configuration), so do not rely on the
150-
assumption that only HS256 signed JWTs will be issued long term.
148+
5. JWT signing. Supabase Auth supports asymmetric keys (RS256 by default;
149+
ECC/Ed25519 optional). HS256 is still supported for compatibility, but
150+
migrating to asymmetric keys is recommended for easier validation and
151+
rotation. Future deprecations will be announced in the changelog. See the
152+
[JWT Signing Keys](https://supabase.com/docs/guides/auth/signing-keys) and
153+
[JWTs guide](https://supabase.com/docs/guides/auth/jwts) for details.
151154

152155
Note that this is not an exhaustive list and it may change.
153156

@@ -158,7 +161,7 @@ compatibility with Auth:
158161

159162
1. Do not modify the schema managed by Auth. You can see all of the
160163
migrations in the `migrations` directory.
161-
2. Do not rely on schema and structure of data in the database. Always use
164+
2. Do not rely on the schema and the structure of data in the database. Always use
162165
Auth APIs and JWTs to infer information about users.
163166
3. Always run Auth behind a TLS-capable proxy such as a load balancer, CDN,
164167
nginx or other similar software.
@@ -180,7 +183,7 @@ The base URL your site is located at. Currently used in combination with other s
180183

181184
`URI_ALLOW_LIST` - `string`
182185

183-
A comma separated list of URIs (e.g. `"https://foo.example.com,https://*.foo.example.com,https://bar.example.com"`) which are permitted as valid `redirect_to` destinations. Defaults to []. Supports wildcard matching through globbing. e.g. `https://*.foo.example.com` will allow `https://a.foo.example.com` and `https://b.foo.example.com` to be accepted. Globbing is also supported on subdomains. e.g. `https://foo.example.com/*` will allow `https://foo.example.com/page1` and `https://foo.example.com/page2` to be accepted.
186+
A comma-separated list of URIs (e.g. `"https://foo.example.com,https://*.foo.example.com,https://bar.example.com"`) which are permitted as valid `redirect_to` destinations. Defaults to []. Supports wildcard matching through globbing. e.g. `https://*.foo.example.com` will allow `https://a.foo.example.com` and `https://b.foo.example.com` to be accepted. Globbing is also supported on subdomains. e.g. `https://foo.example.com/*` will allow `https://foo.example.com/page1` and `https://foo.example.com/page2` to be accepted.
184187

185188
For more common glob patterns, check out the [following link](https://pkg.go.dev/github.com/gobwas/glob#Compile).
186189

@@ -195,19 +198,19 @@ When signup is disabled the only way to create new users is through invites. Def
195198

196199
`GOTRUE_EXTERNAL_EMAIL_ENABLED` - `bool`
197200

198-
Use this to disable email signups (users can still use external oauth providers to sign up / sign in)
201+
Use this to disable email signups (users can still use external OAuth providers to sign up / sign in)
199202

200203
`GOTRUE_EXTERNAL_PHONE_ENABLED` - `bool`
201204

202-
Use this to disable phone signups (users can still use external oauth providers to sign up / sign in)
205+
Use this to disable phone signups (users can still use external OAuth providers to sign up / sign in)
203206

204207
`GOTRUE_RATE_LIMIT_HEADER` - `string`
205208

206209
Header on which to rate limit the `/token` endpoint.
207210

208211
`GOTRUE_RATE_LIMIT_EMAIL_SENT` - `string`
209212

210-
Rate limit the number of emails sent per hr on the following endpoints: `/signup`, `/invite`, `/magiclink`, `/recover`, `/otp`, & `/user`.
213+
Rate limit the number of emails sent per hour on the following endpoints: `/signup`, `/invite`, `/magiclink`, `/recover`, `/otp`, & `/user`.
211214

212215
`GOTRUE_PASSWORD_MIN_LENGTH` - `int`
213216

@@ -217,7 +220,7 @@ Minimum password length, defaults to 6.
217220

218221
`GOTRUE_SECURITY_REFRESH_TOKEN_ROTATION_ENABLED` - `bool`
219222

220-
If refresh token rotation is enabled, auth will automatically detect malicious attempts to reuse a revoked refresh token. When a malicious attempt is detected, gotrue immediately revokes all tokens that descended from the offending token.
223+
If refresh token rotation is enabled, auth will automatically detect malicious attempts to reuse a revoked refresh token. When a malicious attempt is detected, GoTrue immediately revokes all tokens that descended from the offending token.
221224

222225
`GOTRUE_SECURITY_REFRESH_TOKEN_REUSE_INTERVAL` - `string`
223226

@@ -247,7 +250,7 @@ Controls what endpoint Netlify can access this API on.
247250

248251
`API_EXTERNAL_URL` - `string` **required**
249252

250-
The URL on which Gotrue might be accessed at.
253+
The URL on which GoTrue might be accessed at.
251254

252255
`REQUEST_ID_HEADER` - `string`
253256

@@ -307,7 +310,7 @@ Auth has basic observability built in. It is able to export
307310

308311
To enable tracing configure these variables:
309312

310-
`GOTRUE_TRACING_ENABLED` - `boolean`
313+
`GOTRUE_TRACING_ENABLED` - `bool`
311314

312315
`GOTRUE_TRACING_EXPORTER` - `string` only `opentelemetry` supported
313316

@@ -498,7 +501,7 @@ To try out external authentication with Apple locally, you will need to do the f
498501
3. Generate the crt and key file. See [here](https://www.freecodecamp.org/news/how-to-get-https-working-on-your-local-development-environment-in-5-minutes-7af615770eec/) for more information.
499502
4. Generate the `GOTRUE_EXTERNAL_APPLE_SECRET` by following this [post](https://medium.com/identity-beyond-borders/how-to-configure-sign-in-with-apple-77c61e336003)!
500503

501-
### E-Mail
504+
### Email
502505

503506
Sending email is not required, but highly recommended for password recovery.
504507
If enabled, you must provide the required values below.
@@ -546,7 +549,7 @@ If you do not require email confirmation, you may set this to `true`. Defaults t
546549

547550
`MAILER_OTP_EXP` - `number`
548551

549-
Controls the duration an email link or otp is valid for.
552+
Controls the duration an email link or OTP is valid for.
550553

551554
`MAILER_URLPATHS_INVITE` - `string`
552555

@@ -831,15 +834,15 @@ If you do not require phone confirmation, you may set this to `true`. Defaults t
831834

832835
`SMS_MAX_FREQUENCY` - `number`
833836

834-
Controls the minimum amount of time that must pass before sending another sms otp. The value is the number of seconds. Defaults to 60 (1 minute)).
837+
Controls the minimum amount of time that must pass before sending another SMS OTP. The value is the number of seconds. Defaults to 60 (1 minute).
835838

836839
`SMS_OTP_EXP` - `number`
837840

838-
Controls the duration an sms otp is valid for.
841+
Controls the duration an SMS OTP is valid for.
839842

840843
`SMS_OTP_LENGTH` - `number`
841844

842-
Controls the number of digits of the sms otp sent.
845+
Controls the number of digits of the SMS OTP sent.
843846

844847
`SMS_PROVIDER` - `string`
845848

@@ -866,7 +869,7 @@ Whether captcha middleware is enabled
866869

867870
`SECURITY_CAPTCHA_PROVIDER` - `string`
868871

869-
for now the only options supported are: `hcaptcha` and `turnstile`
872+
for now the only options supported are: hCaptcha and Turnstile
870873

871874
- `SECURITY_CAPTCHA_SECRET` - `string`
872875
- `SECURITY_CAPTCHA_TIMEOUT` - `string`
@@ -1121,7 +1124,7 @@ Returns:
11211124
}
11221125
```
11231126

1124-
Verify a phone signup or sms otp. Type should be set to `sms`.
1127+
Verify a phone signup or SMS OTP. Type should be set to `sms`.
11251128

11261129
```json
11271130
{
@@ -1171,7 +1174,7 @@ or show an account confirmed/welcome message in the case of `signup`, or direct
11711174

11721175
### **POST /otp**
11731176

1174-
One-Time-Password. Will deliver a magiclink or sms otp to the user depending on whether the request body contains an "email" or "phone" key.
1177+
One-Time-Password. Will deliver a magic link or SMS OTP to the user depending on whether the request body contains an "email" or "phone" key.
11751178

11761179
If `"create_user": true`, user will not be automatically signed up if the user doesn't exist.
11771180

@@ -1217,7 +1220,7 @@ Returns:
12171220
{}
12181221
```
12191222

1220-
when clicked the magic link will redirect the user to `<SITE_URL>#access_token=x&refresh_token=y&expires_in=z&token_type=bearer&type=magiclink` (see `/verify` above)
1223+
When the magic link is clicked, it will redirect to `<SITE_URL>#access_token=x&refresh_token=y&expires_in=z&token_type=bearer&type=magiclink` (see `/verify` above)
12211224

12221225
### **POST /recover**
12231226

@@ -1314,7 +1317,7 @@ Returns:
13141317
### **PUT /user**
13151318

13161319
Update a user (Requires authentication). Apart from changing email/password, this
1317-
method can be used to set custom user data. Changing the email will result in a magiclink being sent out.
1320+
method can be used to set custom user data. Changing the email will result in a magic link being sent out.
13181321

13191322
```json
13201323
{
@@ -1367,7 +1370,7 @@ headers: {
13671370
Logout a user (Requires authentication).
13681371

13691372
This will revoke all refresh tokens for the user. Remember that the JWT tokens
1370-
will still be valid for stateless auth until they expires.
1373+
will still be valid for stateless auth until they expire.
13711374

13721375
### **GET /authorize**
13731376

@@ -1383,11 +1386,11 @@ scopes=<optional additional scopes depending on the provider (email and name are
13831386

13841387
Redirects to provider and then to `/callback`
13851388

1386-
For apple specific setup see: <https://github.com/supabase/auth#apple-oauth>
1389+
For Apple-specific setup see: <https://github.com/supabase/auth#apple-oauth>
13871390

13881391
### **GET /callback**
13891392

1390-
External provider should redirect to here
1393+
External provider should redirect to this endpoint
13911394

13921395
Redirects to `<GOTRUE_SITE_URL>#access_token=<access_token>&refresh_token=<refresh_token>&provider_token=<provider_oauth_token>&expires_in=3600&provider=<provider_name>`
13931396
If additional scopes were requested then `provider_token` will be populated, you can use this to fetch additional data from the provider or interact with their services

example.env

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ GOTRUE_EXTERNAL_FIGMA_CLIENT_ID=""
114114
GOTRUE_EXTERNAL_FIGMA_SECRET=""
115115
GOTRUE_EXTERNAL_FIGMA_REDIRECT_URI="https://localhost:9999/callback"
116116

117-
# Gitlab OAuth config
117+
# GitLab OAuth config
118118
GOTRUE_EXTERNAL_GITLAB_ENABLED="false"
119119
GOTRUE_EXTERNAL_GITLAB_CLIENT_ID=""
120120
GOTRUE_EXTERNAL_GITLAB_SECRET=""
@@ -126,7 +126,7 @@ GOTRUE_EXTERNAL_GOOGLE_CLIENT_ID=""
126126
GOTRUE_EXTERNAL_GOOGLE_SECRET=""
127127
GOTRUE_EXTERNAL_GOOGLE_REDIRECT_URI="http://localhost:9999/callback"
128128

129-
# Github OAuth config
129+
# GitHub OAuth config
130130
GOTRUE_EXTERNAL_GITHUB_ENABLED="false"
131131
GOTRUE_EXTERNAL_GITHUB_CLIENT_ID=""
132132
GOTRUE_EXTERNAL_GITHUB_SECRET=""
@@ -144,7 +144,7 @@ GOTRUE_EXTERNAL_NOTION_CLIENT_ID=""
144144
GOTRUE_EXTERNAL_NOTION_SECRET=""
145145
GOTRUE_EXTERNAL_NOTION_REDIRECT_URI="https://localhost:9999/callback"
146146

147-
# Twitter OAuth1 config
147+
# Twitter (X) OAuth1 config
148148
GOTRUE_EXTERNAL_TWITTER_ENABLED="false"
149149
GOTRUE_EXTERNAL_TWITTER_CLIENT_ID=""
150150
GOTRUE_EXTERNAL_TWITTER_SECRET=""
@@ -169,7 +169,7 @@ GOTRUE_EXTERNAL_KEYCLOAK_SECRET=""
169169
GOTRUE_EXTERNAL_KEYCLOAK_REDIRECT_URI="http://localhost:9999/callback"
170170
GOTRUE_EXTERNAL_KEYCLOAK_URL="https://keycloak.example.com/auth/realms/myrealm"
171171

172-
# Linkedin OAuth config
172+
# LinkedIn OAuth config
173173
GOTRUE_EXTERNAL_LINKEDIN_ENABLED="true"
174174
GOTRUE_EXTERNAL_LINKEDIN_CLIENT_ID=""
175175
GOTRUE_EXTERNAL_LINKEDIN_SECRET=""

0 commit comments

Comments
 (0)