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 rego default policy #700

Merged
merged 26 commits into from
Mar 13, 2023
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
c86cf8a
Add Rego default policy processing to handle rules
gigovich Feb 17, 2023
4ea6e26
Add default Rego policy
gigovich Feb 17, 2023
cc32dd2
Create correct Rego package and query to filter peers by rules
gigovich Feb 20, 2023
3514cff
Use policy as rule replacement.
gigovich Feb 21, 2023
bec3805
Add account manager CRUD methods and start implement server handlers.
gigovich Feb 22, 2023
4091244
Add API declarations. Improve policies.
gigovich Feb 23, 2023
9f5d2f2
Finish handlers for policies processing.
gigovich Feb 27, 2023
14e9909
Fix account mocks
gigovich Feb 27, 2023
e476f20
Add migration from Rules to new policies in account loading.
gigovich Feb 27, 2023
eb1dda7
Test for file store. Broken tests in management.
gigovich Feb 28, 2023
0605b3f
WIP tests, policy
gigovich Mar 1, 2023
db6345e
Fix all management tests
gigovich Mar 2, 2023
4a36fb8
After rebase fixes
gigovich Mar 2, 2023
2951fed
WIP user policy conversion in the rules http handler.
gigovich Mar 2, 2023
45e65dd
Fix tests, for rules handler.
gigovich Mar 3, 2023
cf3c868
Drop Rules methods for account manager. Fix tests.
gigovich Mar 3, 2023
459e5d1
Upgrade management API file. Drop outdated definitions.
gigovich Mar 3, 2023
7ed4311
Fix Codacy issues.
gigovich Mar 3, 2023
8d2b09d
After review fixes.
gigovich Mar 4, 2023
59a7f7b
After rebase fixes.
gigovich Mar 6, 2023
6bbe590
Fix rule update handler and tests.
gigovich Mar 6, 2023
fa9d4bc
Review fixes
gigovich Mar 9, 2023
339a45c
Fix test after review
gigovich Mar 9, 2023
85558c3
Fix network map build schema
gigovich Mar 9, 2023
5678d83
Fix test to handle random order of peers in network map
gigovich Mar 9, 2023
e5ba74a
After review fixes.
gigovich Mar 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix test to handle random order of peers in network map
  • Loading branch information
gigovich committed Mar 13, 2023
commit 5678d83c40c24141d789546af9a1dc0c228917b7
5 changes: 3 additions & 2 deletions management/server/policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ func TestAccount_getPeersByPolicy(t *testing.T) {
account.Policies = append(account.Policies, rule)

peers, firewallRules := account.getPeersByPolicy("peer1")
expected := []*Peer{account.Peers["peer2"], account.Peers["peer3"]}
assert.Equal(t, peers, expected)
assert.Len(t, peers, 2)
assert.Contains(t, peers, account.Peers["peer2"])
assert.Contains(t, peers, account.Peers["peer3"])

epectedFirewallRules := []*FirewallRule{
{PeerID: "peer1", PeerIP: "10.20.0.1", Direction: "dst", Action: "accept", Port: ""},
Expand Down