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
Show file tree
Hide file tree
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
Upgrade management API file. Drop outdated definitions.
  • Loading branch information
gigovich committed Mar 13, 2023
commit 459e5d12c095a14286f5f5e2378679201990c161
69 changes: 19 additions & 50 deletions management/server/http/api/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -395,20 +395,21 @@ components:
enum: [ "name","description","disabled","flow","sources","destinations" ]
required:
- path
PolicyPatchOperation:
allOf:
- $ref: '#/components/schemas/PatchMinimum'
- type: object
properties:
path:
description: Polocy field to update in form /<field>
type: string
enum: [ "name","description","disabled","meta","query" ]
required:
- path
PolicyMeta:
PolicyRule:
type: object
properties:
id:
description: Rule ID
type: string
name:
description: Rule name identifier
type: string
description:
description: Rule friendly description
type: string
disabled:
description: Rules status
type: boolean
sources:
description: policy source groups
type: array
Expand All @@ -427,6 +428,7 @@ components:
description: port of the service or range of the ports, and optional protocol (by default TCP)
type: string
required:
- name
- sources
- destinations
- action
Expand All @@ -446,9 +448,11 @@ components:
query:
description: Policy Rego query
type: string
meta:
description: Policy meta object for policy UI editor
$ref: '#/components/schemas/PolicyMeta'
rules:
description: Policy rule object for policy UI editor
type: array
items:
$ref: '#/components/schemas/PolicyRule'
required:
- name
- description
Expand Down Expand Up @@ -1407,41 +1411,6 @@ paths:
"$ref": "#/components/responses/forbidden"
'500':
"$ref": "#/components/responses/internal_error"
patch:
summary: Update information about a Rule
tags: [ Rules ]
security:
- BearerAuth: [ ]
parameters:
- in: path
name: id
required: true
schema:
type: string
description: The Rule ID
requestBody:
description: Update Rule request using a list of json patch objects
content:
'application/json':
schema:
type: array
items:
$ref: '#/components/schemas/RulePatchOperation'
responses:
'200':
description: A Rule object
content:
application/json:
schema:
$ref: '#/components/schemas/Rule'
'400':
"$ref": "#/components/responses/bad_request"
'401':
"$ref": "#/components/responses/requires_authentication"
'403':
"$ref": "#/components/responses/forbidden"
'500':
"$ref": "#/components/responses/internal_error"
delete:
summary: Delete a Rule
tags: [ Rules ]
Expand Down
105 changes: 40 additions & 65 deletions management/server/http/api/types.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading