Unable to reload limit rate

Open
#2,305 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
go

Research direction

Start by tracing the Auth hot-reload path and the limiterOpts initialization described in the report, then reproduce the issue with a hot_reload/aaaa.env file containing GOTRUE_RATE_LIMIT_EMAIL_SENT. Done means reloading the file updates api.limiterOpts and the Email limit reflects the new value.

Written by the indexing model from the issue text.

Description

bug

Bug report

When using the Supabase local development environment, I am utilizing the Auth "reload" feature (with the hot_reload directory being watched).I added a new environment file named aaaa.env containing the following configuration: GOTRUE_RATE_LIMIT_EMAIL_SENT="200000000". Although the logs indicate that the project successfully detected and read the aaaa.env file, the api.limiterOpts remains unchanged. In other words, the GOTRUE_RATE_LIMIT_EMAIL_SENT setting failed to take effect after the reload.

Describe the bug

Image

Upon reviewing the source code, I discovered that the previous limiterOpts were already set via the following loop: for _, o := range opt { o.apply(api) }.

Because of this, api.limiterOpts is no longer null, which prevents the new configuration values from being assigned or updated.

To Reproduce

1、Create a directory named hot_reload.

2、Start the Auth service in debug mode, setting the watch_dir to the hot_reload directory.

3、Create a file named aaaa.env inside the hot_reload directory with the content: GOTRUE_RATE_LIMIT_EMAIL_SENT="200000000".

Image

4、Observe the Email value within api.limiterOpts to check if it has been updated to reflect the new environment variable.

Expected behavior

Image

Screenshots

System information

  • OS: 26.0 (25A8353)

Additional context

Do I need to fix this bug?

Dominant language
Go
Stars
2.6k
Forks
764
Avg merge
5d 3h
Merged PRs (30d)
39

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from supabase/auth

All issues in supabase/auth

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.