-
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: check ip against allow list (#240)
* feat: check ip against allow list * feat: add allow_list field to tenant * fix: cleanup * fix: handle more responses from :inet.peername * fix: bump version * fix: info contains both a tenant and a user * fix: filter CIDRs in one pass * fix: add field to OpenAPI spec * fix: cleanup * fix: nit * fix: fail closed on bad addresses * fix: filter_cidrs will now handle any addr type * feat: validate ranges in allow_list and respond with bad ranges found * fix: remove "translate error" text for nicer error messages * fix: render more fields * fix: use except with Jason.Encoder * fix: better error message * fix: error message * fix: Telem.client_join when address not allowed * feat: check allow_list in NativeHandler * fix: add allow_list field to docs * fix: open API spec allow_list type and examples * fix: more concise spec Co-authored-by: Stas <[email protected]> * fix: handle ssl ports too * fix: simplify spec --------- Co-authored-by: Stas <[email protected]>
- Loading branch information
Showing
17 changed files
with
210 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.0.12 | ||
1.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
priv/repo/migrations/20231229010413_add_tenant_allow_list.exs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
defmodule Supavisor.Repo.Migrations.AddTenantAllowList do | ||
use Ecto.Migration | ||
|
||
def change do | ||
alter table("tenants", prefix: "_supavisor") do | ||
add(:allow_list, {:array, :string}, null: false, default: ["0.0.0.0/0", "::/0"]) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
defmodule Supavisor.HandlerHelpersTest do | ||
use ExUnit.Case | ||
doctest Supavisor.HandlerHelpers | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
defmodule Supavisor.Tenants.TenantTest do | ||
use ExUnit.Case | ||
doctest Supavisor.Tenants.Tenant | ||
end |
Oops, something went wrong.