andreas-stuerz / opn-cli

CLI for OPNsense Firewall using API Requests
BSD 2-Clause "Simplified" License
45 stars 8 forks source link

fix uppercase endpoint_params #32

Closed darkounet closed 1 year ago

darkounet commented 1 year ago

If Alias name is uppercase, method getAliasUUID isn't working.

Example with Alias GLOBAL_BL_API

the endpoint_params in lowercase : KO - firewall/alias/getaliasuuid/global_bl_api opn-cli firewall alias show GLOBAL_BL_API

+------+------+------+-------+----------+-------------+------------+---------+---------+
| uuid | name | type | proto | counters | description | updatefreq | content | enabled |
+------+------+------+-------+----------+-------------+------------+---------+---------+
+------+------+------+-------+----------+-------------+------------+---------+---------+

the same with the real Alias name : OK - firewall/alias/getaliasuuid/GLOBAL_BL_API opn-cli firewall alias show GLOBAL_BL_API +--------------------------------------+---------------+------+-------+----------+------------------------+------------+-------------------------------------------------------------------+---------+ | uuid | name | type | proto | counters | description | updatefreq | content | enabled | +--------------------------------------+---------------+------+-------+----------+------------------------+------------+-------------------------------------------------------------------+---------+ | a6987428-1142-493d-9b15-80detgrt0f8433 | GLOBAL_BL_API | host | | | Blacklist | | BL_1,BL_2 | 1 | +--------------------------------------+---------------+------+-------+----------+------------------------+------------+-------------------------------------------------------------------+---------+

darkounet commented 1 year ago

if we can't have the UUID we can't update an existing Alias

with message :

Error: {'result': 'failed'}

codecov[bot] commented 1 year ago

Codecov Report

Base: 100.00% // Head: 100.00% // No change to project coverage :thumbsup:

Coverage data is based on head (938c991) compared to base (f00172c). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #32 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 114 114 Lines 4440 4440 ========================================= Hits 4440 4440 ``` | [Impacted Files](https://codecov.io/gh/andeman/opn-cli/pull/32?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Andreas+St%C3%BCrz) | Coverage Δ | | |---|---|---| | [opnsense\_cli/api/client.py](https://codecov.io/gh/andeman/opn-cli/pull/32/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Andreas+St%C3%BCrz#diff-b3Buc2Vuc2VfY2xpL2FwaS9jbGllbnQucHk=) | `100.00% <100.00%> (ø)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Andreas+St%C3%BCrz). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Andreas+St%C3%BCrz)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

andreas-stuerz commented 1 year ago

Thank you for fixing that bug 👍