Initial commit on Forgejo
Fresh repository history for elektrine/tarakan hosted at https://git.elektrine.com/elektrine/tarakan.
This commit is contained in:
commit
af6077b9c3
455 changed files with 78366 additions and 0 deletions
17
test/tarakan_web/oauth_rate_limit_test.exs
Normal file
17
test/tarakan_web/oauth_rate_limit_test.exs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
defmodule TarakanWeb.OAuthRateLimitTest do
|
||||
use TarakanWeb.ConnCase
|
||||
|
||||
test "OAuth routes are rate limited per client IP" do
|
||||
for _ <- 1..20 do
|
||||
conn = get(build_conn(), ~p"/auth/github")
|
||||
assert conn.status == 302
|
||||
end
|
||||
|
||||
conn = get(build_conn(), ~p"/auth/github")
|
||||
assert conn.status == 429
|
||||
assert text_response(conn, 429) =~ "too many requests"
|
||||
|
||||
conn = get(build_conn(), ~p"/auth/gitlab")
|
||||
assert conn.status == 429
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue