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

Add POST /firewall/update/:id #30

Open
3 tasks
AOx0 opened this issue Sep 21, 2024 · 2 comments
Open
3 tasks

Add POST /firewall/update/:id #30

AOx0 opened this issue Sep 21, 2024 · 2 comments

Comments

@AOx0
Copy link
Owner

AOx0 commented Sep 21, 2024

Allows to overwrite the value stored for the rule with id :id.
Ideally this allows to update fields of the struct, but can be also used to completely replace the existing rule by another one.

  • Add request type
  • Handle request
  • Make it available from the API.
@AOx0
Copy link
Owner Author

AOx0 commented Sep 23, 2024

This may be blocked by #35 since it requires special handling when updating a rule by something that does not concern to the same OSI Layer.

@AOx0
Copy link
Owner Author

AOx0 commented Sep 27, 2024

Other thing to consider is that IDs will no longer be a direct index into the array. Hence rules may need to be compared by its fields, which is not great

@AOx0 AOx0 mentioned this issue Oct 21, 2024
8 tasks
@AOx0 AOx0 added this to adam Nov 11, 2024
enriquegomeztagle added a commit that referenced this issue Nov 27, 2024
Related to #30

Add POST /firewall/update/:id endpoint to update firewall rules by ID.

* Add a new request type `UpdateRule` to the `Request` and `Response` enums in `message/src/firewall.rs`.
* Add a new route for `POST /firewall/update/:id` in the `rules` router in `controller/src/firewall/mod.rs`.
* Add a new handler function `update_rule` for the `POST /firewall/update/:id` route in `controller/src/firewall/mod.rs`.
* Implement the logic to update the rule in the `update_rule` function in `controller/src/firewall/mod.rs`.
* Add a new match arm for `Request::UpdateRule` in the `handle_message` function in `firewall/src/main.rs`.
* Implement the logic to update the rule in the `handle_message` function in `firewall/src/main.rs`.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/AOx0/adam/issues/30?shareId=XXXX-XXXX-XXXX-XXXX).
enriquegomeztagle added a commit that referenced this issue Nov 28, 2024
Related to #30

Add POST /firewall/update/:id endpoint to update firewall rules by ID.

* Add a new request type `UpdateRule` to the `Request` and `Response` enums in `message/src/firewall.rs`.
* Add a new route for `POST /firewall/update/:id` in the `rules` router in `controller/src/firewall/mod.rs`.
* Add a new handler function `update_rule` for the `POST /firewall/update/:id` route in `controller/src/firewall/mod.rs`.
* Implement the logic to update the rule in the `update_rule` function in `controller/src/firewall/mod.rs`.
* Add a new match arm for `Request::UpdateRule` in the `handle_message` function in `firewall/src/main.rs`.
* Implement the logic to update the rule in the `handle_message` function in `firewall/src/main.rs`.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/AOx0/adam/issues/30?shareId=XXXX-XXXX-XXXX-XXXX).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants