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

validate chargeBoxId for WS connections (#1526) #1527

Merged
merged 7 commits into from
Aug 4, 2024

Conversation

goekay
Copy link
Member

@goekay goekay commented Aug 1, 2024

No description provided.

@goekay goekay linked an issue Aug 1, 2024 that may be closed by this pull request
4 tasks
@goekay goekay force-pushed the 1526-validate-chargeboxid-for-ws-connections branch from 223ca79 to e9ab4ac Compare August 1, 2024 17:26
Copy link
Contributor

@juherr juherr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the new regex is too restrictive and will break instances.

@goekay
Copy link
Member Author

goekay commented Aug 1, 2024

I think the new regex is too restrictive and will break instances.

fair enough, and i was fearing this as well.

new suggestion: instead of whitelisting what is allowed in the regex, i could blacklist what should not appear in the regex. i am thinking something like [^=/()<>]* i.e. every character with the exception of =/()<> is allowed.

@juherr
Copy link
Contributor

juherr commented Aug 2, 2024

The blacklist solution sounds better.

But even if I'll be surprised that a charger uses one of this chars somewhere you need a way to block the upgrade if a charger uses one of them in the database.
Otherwise some users will lost the charger without any way to change its configuration.

@goekay
Copy link
Member Author

goekay commented Aug 3, 2024

But even if I'll be surprised that a charger uses one of this chars somewhere you need a way to block the upgrade if a charger uses one of them in the database.
Otherwise some users will lost the charger without any way to change its configuration.

i wonder how big that percentage is. if we are about to lose a minority (for ex 0.1%) of installations, i would be okay to make that sacrifice.

i can put the new logic behind a config, but i then i would like to have it enabled by default. installations that have problems can still opt out, while accepting the risks.

@juherr
Copy link
Contributor

juherr commented Aug 3, 2024

It can be enabled by default but I think it must be possible to disable it or block the upgrade if one station doesn't respect the convention.
Otherwise the hardware will be totally lost with no way to restore it.

@goekay goekay requested a review from juherr August 3, 2024 16:14
juherr

This comment was marked as outdated.

Copy link
Contributor

@juherr juherr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except the ui fix which should be extended everywhere a displayed data comes from a station (maybe in another pr?).

@goekay
Copy link
Member Author

goekay commented Aug 3, 2024

yes, there will be another issue and another PR.

@goekay goekay merged commit a79983f into master Aug 4, 2024
45 checks passed
@goekay goekay deleted the 1526-validate-chargeboxid-for-ws-connections branch August 4, 2024 08:55
goekay added a commit that referenced this pull request Aug 6, 2024
goekay added a commit that referenced this pull request Aug 6, 2024
goekay added a commit that referenced this pull request Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validate chargeBoxId for WS connections
2 participants