Skip to content

Commit 3149241

Browse files
authored
Merge branch 'master' into scim
2 parents 577f469 + 5318552 commit 3149241

Some content is hidden

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

77 files changed

+4017
-977
lines changed

.github/workflows/release.yml

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
permissions:
1919
contents: write
2020
pull-requests: write
21+
id-token: write
2122
outputs:
2223
MAIN_RELEASE_VERSION: ${{ steps.versions.outputs.MAIN_RELEASE_VERSION }}
2324
RELEASE_VERSION: ${{ steps.versions.outputs.RELEASE_VERSION }}
@@ -90,16 +91,15 @@ jobs:
9091
set -ex
9192
9293
RELEASE_VERSION=$RELEASE_VERSION make deps
93-
RELEASE_VERSION=$RELEASE_VERSION make all
94+
RELEASE_VERSION=$RELEASE_VERSION make all build-strip
95+
9496
ln -s auth gotrue
9597
tar -czvf auth-v$RELEASE_VERSION-x86.tar.gz auth gotrue migrations/
9698
mv auth-arm64 auth
9799
tar -czvf auth-v$RELEASE_VERSION-arm64.tar.gz auth gotrue migrations/
98100
99-
# Create a "supafast" tarball that can be used by supabase-admin-api to upgrade Auth quickly
100-
rm gotrue
101-
mv auth gotrue
102-
tar -czvf auth-v$RELEASE_VERSION.supafast-arm64.tar.gz gotrue migrations/
101+
mv auth-arm64-strip auth
102+
tar -cf - auth gotrue migrations/ | xz -T0 -9e -C crc64 > auth-v$RELEASE_VERSION-arm64.tar.xz
103103
104104
- name: Generate checksums
105105
if: ${{ steps.release.outputs.release_created == 'true' || steps.release.outputs.prs_created == 'true' }}
@@ -110,7 +110,7 @@ jobs:
110110
local hash_type=$1
111111
local hash_cmd=$2
112112
echo "### ${hash_type}" >> checksums.txt
113-
for file in auth-v$RELEASE_VERSION*.tar.gz; do
113+
for file in auth-v$RELEASE_VERSION*.tar.{gz,xz}; do
114114
echo "\`$file\`:" >> checksums.txt
115115
echo "\`\`\`" >> checksums.txt
116116
$hash_cmd "$file" | awk '{print $1}' >> checksums.txt
@@ -124,6 +124,24 @@ jobs:
124124
generate_checksums "SHA1" "sha1sum"
125125
generate_checksums "SHA256" "sha256sum"
126126
127+
- name: GitHub OIDC Auth
128+
if: ${{ steps.release.outputs.release_created == 'true' || steps.release.outputs.prs_created == 'true' }}
129+
uses: aws-actions/[email protected]
130+
with:
131+
aws-region: ap-southeast-1
132+
role-to-assume: arn:aws:iam::${{ secrets.SHARED_SERVICES_AWS_ACCOUNT_ID }}:role/supabase-github-oidc-role
133+
role-session-name: shared-services-jump
134+
135+
- name: Assume destination role
136+
uses: aws-actions/[email protected]
137+
if: ${{ steps.release.outputs.release_created == 'true' || steps.release.outputs.prs_created == 'true' }}
138+
with:
139+
aws-region: ap-southeast-1
140+
role-to-assume: arn:aws:iam::${{ secrets.SHARED_SERVICES_AWS_ACCOUNT_ID }}:role/supabase-auth-artifacts-role-7656c95
141+
role-skip-session-tagging: true
142+
role-session-name: upload-assets
143+
role-chaining: true
144+
127145
- name: Upload release artifacts
128146
if: ${{ steps.release.outputs.release_created == 'true' || steps.release.outputs.prs_created == 'true' }}
129147
run: |
@@ -135,7 +153,7 @@ jobs:
135153
CHECKSUM_CONTENT=$(cat checksums.txt)
136154
137155
RELEASE_NOTES=$(printf "This is a release candidate. See release-please PR #%s for context.\n\n%s\n" "$PR_NUMBER" "$CHECKSUM_CONTENT")
138-
156+
139157
GH_TOKEN='${{ github.token }}' gh release \
140158
create $RELEASE_NAME \
141159
--title "v$RELEASE_VERSION" \
@@ -171,7 +189,10 @@ jobs:
171189
FULL_NOTES=$(printf "%s\n\n%s\n" "$EXISTING_NOTES" "$CHECKSUM_CONTENT")
172190
GH_TOKEN='${{ github.token }}' gh release edit $RELEASE_NAME -n "$FULL_NOTES"
173191
174-
GH_TOKEN='${{ github.token }}' gh release upload $RELEASE_NAME ./auth-v$RELEASE_VERSION-x86.tar.gz ./auth-v$RELEASE_VERSION-arm64.tar.gz ./auth-v$RELEASE_VERSION.supafast-arm64.tar.gz
192+
GH_TOKEN='${{ github.token }}' gh release upload $RELEASE_NAME ./auth-v$RELEASE_VERSION-x86.tar.gz ./auth-v$RELEASE_VERSION-arm64.tar.gz ./auth-v$RELEASE_VERSION-arm64.tar.xz
193+
194+
# Upload to Supabase internal bucket
195+
aws s3 cp ./auth-v$RELEASE_VERSION-arm64.tar.xz s3://supabase-internal-artifacts/auth/$RELEASE_VERSION/
175196
176197
publish:
177198
needs:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ gotrue-arm64
55
gotrue.exe
66
auth
77
auth-arm64
8+
auth-arm64-strip
89
auth.exe
910

1011
coverage.out

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
# Changelog
22

3+
## [2.179.0](https://github.com/supabase/auth/compare/v2.178.0...v2.179.0) (2025-08-28)
4+
5+
6+
### Features
7+
8+
* add oauth2 client support ([#2098](https://github.com/supabase/auth/issues/2098)) ([8fae015](https://github.com/supabase/auth/commit/8fae01581d122bba95a3742dc212284f9a21dc4d))
9+
* experimental own linking domains per provider ([#2119](https://github.com/supabase/auth/issues/2119)) ([747bf3b](https://github.com/supabase/auth/commit/747bf3b15fd9e371c9330e75fe2e5de8b89ce14d))
10+
* fetch email from snapchat oauth provider if available for consistency ([#2110](https://github.com/supabase/auth/issues/2110)) ([7507822](https://github.com/supabase/auth/commit/750782246e736093131ba2eb1015fc73083d99ab))
11+
* implement link identity with oidc / native sign in ([#2108](https://github.com/supabase/auth/issues/2108)) ([5f0ec87](https://github.com/supabase/auth/commit/5f0ec8709231c57b57aa06160e18bc9e52ec9002))
12+
* implements email-less accounts with oauth ([#2105](https://github.com/supabase/auth/issues/2105)) ([9a61dae](https://github.com/supabase/auth/commit/9a61dae788311a086ce8e72b52c21e031857adf7))
13+
* introduce request-scoped background tasks & async mail sending ([#2126](https://github.com/supabase/auth/issues/2126)) ([2c8ea61](https://github.com/supabase/auth/commit/2c8ea6113ae7381106ed7c67d7a45f7ef87195c7))
14+
* refactor mailer client wiring and add validation wrapper ([#2130](https://github.com/supabase/auth/issues/2130)) ([68c40a6](https://github.com/supabase/auth/commit/68c40a6a494029d8d704b14abbe85171a7dc8d12))
15+
* support multiple `aud` for the external providers ([#2117](https://github.com/supabase/auth/issues/2117)) ([ca5792e](https://github.com/supabase/auth/commit/ca5792e41a48f20a395646015c28ce272355bf63))
16+
* use `slices.Contains` instead of for loops ([#2111](https://github.com/supabase/auth/issues/2111)) ([9f22682](https://github.com/supabase/auth/commit/9f2268263118713d3390ce4617ccf21bc2c031eb))
17+
18+
19+
### Bug Fixes
20+
21+
* add `id-token` permission to ci ([#2143](https://github.com/supabase/auth/issues/2143)) ([79209c0](https://github.com/supabase/auth/commit/79209c0e35afa82ec8822a343108d6a690e14229))
22+
* add missing param ([#2125](https://github.com/supabase/auth/issues/2125)) ([c0b75f6](https://github.com/supabase/auth/commit/c0b75f66229410e6e5fbc7cd1ae9066cec54c5d7))
23+
* change s3 artifact upload role ([#2145](https://github.com/supabase/auth/issues/2145)) ([767e371](https://github.com/supabase/auth/commit/767e37131aa01bf6cb27dbc62b2928e7cc701893))
24+
* remove requirement of empty content-type on 204 ([#2128](https://github.com/supabase/auth/issues/2128)) ([ecc97e0](https://github.com/supabase/auth/commit/ecc97e0fac7cb1bd736ef6db435a0a5fb224e954))
25+
* run release-please again ([#2144](https://github.com/supabase/auth/issues/2144)) ([2560f14](https://github.com/supabase/auth/commit/2560f14ef6ee35f84b7c592290647e0d1c8a3932))
26+
* stripped binary now includes version ([#2147](https://github.com/supabase/auth/issues/2147)) ([609f169](https://github.com/supabase/auth/commit/609f169f505a1f5750fbbf5e9d477cfb4d879eff))
27+
* update copyright year in LICENSE ([#2142](https://github.com/supabase/auth/issues/2142)) ([67fe0b0](https://github.com/supabase/auth/commit/67fe0b0230b147048dc2b9f546df72af5b3bc362))
28+
329
## [2.178.0](https://github.com/supabase/auth/compare/v2.177.0...v2.178.0) (2025-08-05)
430

531

CONTRIBUTING.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ docker-compose -f docker-compose-dev.yml build postgres
122122
docker-compose -f docker-compose-dev.yml up postgres
123123
```
124124

125-
You should then see in Docker that `auth_postgresql` is running on `port: 5432`.
125+
You should then see in Docker that `auth-postgres-1` is running on `port: 5432`.
126126

127127
> **Important** If you happen to already have a local running instance of Postgres running on the port `5432` because you
128128
> may have installed via [homebrew on macOS](https://formulae.brew.sh/formula/postgresql) then be certain to stop the process using:
@@ -461,17 +461,12 @@ export GOTRUE_DB_DATABASE_URL="postgres://supabase_auth_admin:root@localhost:743
461461

462462
## Helpful Docker Commands
463463

464-
```
465-
// file: docker-compose-dev.yml
466-
container_name: auth_postgres
467-
```
468-
469464
```zsh
470465
# Command line into bash on the PostgreSQL container
471-
docker exec -it auth_postgres bash
466+
docker exec -it auth-postgres-1 bash
472467

473468
# Removes Container
474-
docker container rm -f auth_postgres
469+
docker container rm -f auth-postgres-1
475470

476471
# Removes volume
477472
docker volume rm postgres_data

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021 Supabase <[email protected]>
3+
Copyright (c) 2021-2025 Supabase <[email protected]>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Makefile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
.PHONY: all build deps dev-deps image migrate test vet sec format unused
22
CHECK_FILES?=./...
33

4-
FLAGS=-ldflags "-X github.com/supabase/auth/internal/utilities.Version=`git describe --tags`" -buildvcs=false
54
ifdef RELEASE_VERSION
6-
FLAGS=-ldflags "-X github.com/supabase/auth/internal/utilities.Version=v$(RELEASE_VERSION)" -buildvcs=false
5+
VERSION=v$(RELEASE_VERSION)
6+
else
7+
VERSION=$(shell git describe --tags)
78
endif
89

10+
FLAGS=-ldflags "-X github.com/supabase/auth/internal/utilities.Version=$(VERSION)" -buildvcs=false
11+
912
ifneq ($(shell docker compose version 2>/dev/null),)
1013
DOCKER_COMPOSE=docker compose
1114
else
@@ -23,6 +26,13 @@ build: deps ## Build the binary.
2326
CGO_ENABLED=0 go build $(FLAGS)
2427
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build $(FLAGS) -o auth-arm64
2528

29+
build-strip: deps ## Build a stripped binary, for which the version file needs to be rewritten.
30+
echo "package utilities" > internal/utilities/version.go
31+
echo "const Version = \"$(VERSION)\"" >> internal/utilities/version.go
32+
33+
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build \
34+
$(FLAGS) -ldflags "-s -w" -o auth-arm64-strip
35+
2636
dev-deps: ## Install developer dependencies
2737
@go install github.com/gobuffalo/pop/soda@latest
2838
@go install github.com/securego/gosec/v2/cmd/gosec@latest

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Create a `.env.docker` file to store your own custom env vars. See [`example.doc
4343

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

4949
## Running in production

cmd/admin_cmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func adminCreateUser(config *conf.GlobalConfiguration, args []string) {
6666
defer db.Close()
6767

6868
aud := getAudience(config)
69-
if user, err := models.IsDuplicatedEmail(db, args[0], aud, nil); user != nil {
69+
if user, err := models.IsDuplicatedEmail(db, args[0], aud, nil, config.Experimental.ProvidersWithOwnLinkingDomain); user != nil {
7070
logrus.Fatalf("Error creating new user: user already exists")
7171
} else if err != nil {
7272
logrus.Fatalf("Error checking user email: %+v", err)

cmd/serve_cmd.go

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,17 @@ func serve(ctx context.Context) {
5353
opts := []api.Option{
5454
api.NewLimiterOptions(config),
5555
}
56-
a := api.NewAPIWithVersion(config, db, utilities.Version, opts...)
57-
ah := reloader.NewAtomicHandler(a)
58-
logrus.WithField("version", a.Version()).Infof("GoTrue API started on: %s", addr)
5956

6057
baseCtx, baseCancel := context.WithCancel(context.Background())
6158
defer baseCancel()
6259

60+
var wg sync.WaitGroup
61+
defer wg.Wait() // Do not return to caller until this goroutine is done.
62+
63+
a := api.NewAPIWithVersion(config, db, utilities.Version, opts...)
64+
ah := reloader.NewAtomicHandler(a)
65+
logrus.WithField("version", a.Version()).Infof("GoTrue API started on: %s", addr)
66+
6367
httpSrv := &http.Server{
6468
Addr: addr,
6569
Handler: ah,
@@ -70,9 +74,6 @@ func serve(ctx context.Context) {
7074
}
7175
log := logrus.WithField("component", "api")
7276

73-
var wg sync.WaitGroup
74-
defer wg.Wait() // Do not return to caller until this goroutine is done.
75-
7677
if watchDir != "" {
7778
wg.Add(1)
7879
go func() {
@@ -98,7 +99,10 @@ func serve(ctx context.Context) {
9899

99100
<-ctx.Done()
100101

101-
defer baseCancel() // close baseContext
102+
// This must be done after httpSrv exits, otherwise you may potentially
103+
// have 1 or more inflight http requests blocked until the shutdownCtx
104+
// is canceled.
105+
defer baseCancel()
102106

103107
shutdownCtx, shutdownCancel := context.WithTimeout(context.Background(), time.Minute)
104108
defer shutdownCancel()

docker-compose-dev.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
version: "3.9"
21
services:
32
auth:
4-
container_name: auth
53
depends_on:
64
- postgres
75
build:
@@ -19,7 +17,6 @@ services:
1917
build:
2018
context: .
2119
dockerfile: Dockerfile.postgres.dev
22-
container_name: auth_postgres
2320
ports:
2421
- '5432:5432'
2522
volumes:

0 commit comments

Comments
 (0)