Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add http provider for rate limit config #362

Closed

Conversation

rbx-luxie
Copy link

@rbx-luxie rbx-luxie commented Sep 13, 2022

We want to have a method to load the rate limit config dynamically. This PR adds a simple http provider for feeding rate limit config to the Ratelimit service intervally.
Related github issue: #201

@rbx-luxie rbx-luxie force-pushed the add-config-http-provider branch 2 times, most recently from f4b2937 to 6d4a205 Compare September 15, 2022 03:52
@rbx-luxie rbx-luxie marked this pull request as ready for review September 15, 2022 03:54
src/provider/provider.go Outdated Show resolved Hide resolved
src/provider/provider.go Outdated Show resolved Hide resolved
src/provider/provider.go Outdated Show resolved Hide resolved
src/provider/provider.go Outdated Show resolved Hide resolved
@rbx-luxie rbx-luxie force-pushed the add-config-http-provider branch 2 times, most recently from 2060c5e to 820da06 Compare September 15, 2022 23:38
Signed-off-by: Lu Xie <luxie@roblox.com>
Comment on lines +532 to +544
### From http provider

The Ratelimit service allows to load configuration from a http server. The endpoint can be configured via the settings package with the following environment variables:

```
HTTP_PROVIDER_ENABLED default:"false"
HTTP_PROVIDER_ENDPOINT
HTTP_PROVIDER_SUBPATH default:""
HTTP_PROVIDER_POLL_INTERVAL default:"10"
HTTP_PROVIDER_POLL_TIMEOUT default:"10"
```

Configuration will be reloaded intervally according to the value of `HTTP_POLL_INTERVAL` (second). `HTTP_PROVIDER_SUBPATH` is an array which allows you to have multiple endpoints for different config files.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a lot more documentation. Can you fully specify the proposed protocol and then we can go from there? Thanks.

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@github-actions github-actions bot added the stale label Oct 30, 2022
@github-actions
Copy link

github-actions bot commented Nov 6, 2022

This pull request has been automatically closed because it has not had activity in the last 37 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@github-actions github-actions bot closed this Nov 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants