• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / supabase-py / 40728893581
98%

Build:
DEFAULT BRANCH: main
Ran 28 Oct 2026 04:44PM UTC
Jobs 36
Files 159
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

28 Oct 2026 04:44PM UTC coverage: 94.762% (+0.03%) from 94.736%
40728893581

push

github

web-flow
fix(auth): stop the admin API from sharing the client's header dict (#1645)

Supersedes #1406. Same bug, fixed one layer down. Credit to
@AdityaMedidala for finding and diagnosing it in #1404 / #1406.

## The bug

`GoTrueBaseAPI.__init__` stored the caller's dict by reference:

```python
self._headers = headers
```

and `GoTrueClient.__init__` hands the admin API its own `_headers`:

```python
self.admin = AsyncGoTrueAdminAPI(url=..., headers=self._headers, ...)
```

So `client._headers is client.admin._headers`. Any in-place rewrite of
the client's `Authorization` header rewrote the admin one too.

The `supabase` wrapper does exactly that on every auth event:

```python
# supabase/_async/client.py, _listen_to_auth_events
self.auth._headers["Authorization"] = auth_header   # the user's token
```

Result: a client built with the `service_role` key loses admin rights
the moment a user signs in.

## Reproduced against a local Supabase instance

```
admin.list_users() before sign-in : OK
admin.list_users() after  sign-in : AuthApiError: User not allowed
admin/_client share one dict      : True
```

After this change:

```
admin.list_users() before sign-in : OK
admin.list_users() after  sign-in : OK
admin hdr is service_role         : True
admin/_client share one dict      : False
```

## Why here and not in the wrapper

#1406 fixes it in `supabase/_async/client.py` by copying the admin dict
and re-asserting the key on every auth event. That works, but it leaves
the sharp edge in place: anyone constructing `GoTrueClient` or
`GoTrueAdminAPI` directly still gets the aliased dict, and any future
in-place header write reintroduces the bug.

Copying on the way in is one line, needs no wrapper changes at all, and
makes in-place mutation safe by construction. I verified the wrapper
needs no edit: `_listen_to_auth_events` is the only in-place `_headers`
mutation in either package, and the wrapper already updates
`options.headers`, postgrest and storage explicitly,... (continued)

11614 of 12256 relevant lines covered (94.76%)

5.82 hits per line

Coverage Regressions

Lines Coverage ∆ File
3
91.67
0.0% src/supabase_auth/_sync/gotrue_base_api.py
Jobs
ID Job ID Ran Files Coverage
1 run-ubuntu-latest-3.10-auth - 40728893581.1 28 Oct 2026 04:45PM UTC 54
93.44
GitHub Action Run
2 run-ubuntu-latest-3.11-postgrest - 40728893581.2 28 Oct 2026 04:45PM UTC 38
97.1
GitHub Action Run
3 run-ubuntu-latest-3.12-auth - 40728893581.3 28 Oct 2026 04:45PM UTC 54
93.44
GitHub Action Run
4 run-ubuntu-latest-3.13-postgrest - 40728893581.4 28 Oct 2026 04:45PM UTC 38
97.1
GitHub Action Run
5 run-ubuntu-latest-3.13-functions - 40728893581.5 28 Oct 2026 04:44PM UTC 18
97.1
GitHub Action Run
6 run-ubuntu-latest-3.10-postgrest - 40728893581.6 28 Oct 2026 04:45PM UTC 38
97.1
GitHub Action Run
7 run-ubuntu-latest-3.14-auth - 40728893581.7 28 Oct 2026 04:45PM UTC 54
93.46
GitHub Action Run
8 run-ubuntu-latest-3.11-functions - 40728893581.8 28 Oct 2026 04:44PM UTC 18
97.1
GitHub Action Run
9 run-ubuntu-latest-3.10-functions - 40728893581.9 28 Oct 2026 04:44PM UTC 18
97.1
GitHub Action Run
10 run-ubuntu-latest-3.12-supabase - 40728893581.10 28 Oct 2026 04:44PM UTC 20
96.67
GitHub Action Run
11 run-ubuntu-latest-3.14-supabase - 40728893581.11 28 Oct 2026 04:44PM UTC 20
96.65
GitHub Action Run
12 run-ubuntu-latest-3.14-realtime - 40728893581.12 28 Oct 2026 04:46PM UTC 17
86.21
GitHub Action Run
13 run-ubuntu-latest-3.14-functions - 40728893581.13 28 Oct 2026 04:44PM UTC 18
97.1
GitHub Action Run
14 run-ubuntu-latest-3.9-storage - 40728893581.14 28 Oct 2026 04:45PM UTC 36
93.61
GitHub Action Run
15 run-ubuntu-latest-3.12-functions - 40728893581.15 28 Oct 2026 04:44PM UTC 18
97.1
GitHub Action Run
16 run-ubuntu-latest-3.9-auth - 40728893581.16 28 Oct 2026 04:45PM UTC 54
93.39
GitHub Action Run
17 run-ubuntu-latest-3.13-realtime - 40728893581.17 28 Oct 2026 04:46PM UTC 17
87.17
GitHub Action Run
18 run-ubuntu-latest-3.12-realtime - 40728893581.18 28 Oct 2026 04:45PM UTC 17
87.17
GitHub Action Run
19 run-ubuntu-latest-3.13-supabase - 40728893581.19 28 Oct 2026 04:44PM UTC 20
96.67
GitHub Action Run
20 run-ubuntu-latest-3.11-realtime - 40728893581.20 28 Oct 2026 04:46PM UTC 17
87.17
GitHub Action Run
21 run-ubuntu-latest-3.10-storage - 40728893581.21 28 Oct 2026 04:45PM UTC 36
93.54
GitHub Action Run
22 run-ubuntu-latest-3.9-functions - 40728893581.22 28 Oct 2026 04:44PM UTC 18
97.32
GitHub Action Run
23 run-ubuntu-latest-3.14-postgrest - 40728893581.23 28 Oct 2026 04:45PM UTC 38
97.1
GitHub Action Run
24 run-ubuntu-latest-3.11-auth - 40728893581.24 28 Oct 2026 04:45PM UTC 54
93.49
GitHub Action Run
25 run-ubuntu-latest-3.10-realtime - 40728893581.25 28 Oct 2026 04:46PM UTC 17
87.17
GitHub Action Run
26 run-ubuntu-latest-3.9-postgrest - 40728893581.26 28 Oct 2026 04:45PM UTC 38
97.16
GitHub Action Run
27 run-ubuntu-latest-3.14-storage - 40728893581.27 28 Oct 2026 04:46PM UTC 36
93.52
GitHub Action Run
28 run-ubuntu-latest-3.9-realtime - 40728893581.28 28 Oct 2026 04:46PM UTC 17
87.28
GitHub Action Run
29 run-ubuntu-latest-3.12-storage - 40728893581.29 28 Oct 2026 04:46PM UTC 36
93.54
GitHub Action Run
30 run-ubuntu-latest-3.10-supabase - 40728893581.30 28 Oct 2026 04:44PM UTC 20
96.67
GitHub Action Run
31 run-ubuntu-latest-3.11-supabase - 40728893581.31 28 Oct 2026 04:44PM UTC 20
96.67
GitHub Action Run
32 run-ubuntu-latest-3.13-auth - 40728893581.32 28 Oct 2026 04:45PM UTC 54
93.49
GitHub Action Run
33 run-ubuntu-latest-3.9-supabase - 40728893581.33 28 Oct 2026 04:44PM UTC 20
96.6
GitHub Action Run
34 run-ubuntu-latest-3.12-postgrest - 40728893581.34 28 Oct 2026 04:45PM UTC 38
97.1
GitHub Action Run
35 run-ubuntu-latest-3.11-storage - 40728893581.35 28 Oct 2026 04:46PM UTC 36
93.54
GitHub Action Run
36 run-ubuntu-latest-3.13-storage - 40728893581.36 28 Oct 2026 04:45PM UTC 36
93.54
GitHub Action Run
Source Files on build 40728893581
  • Tree
  • List 159
  • Changed 5
  • Source Changed 0
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #40728893581
  • 6b531317 on github
  • Prev Build on main (#40728177166)
  • Next Build on main (#40729529814)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc