custom-components / authenticated

A platform which allows you to get information about sucessfull logins to Home Assistant.
MIT License
82 stars 28 forks source link

Allow for CIDR notation in IP exclude list #44

Closed claytonjn closed 5 years ago

claytonjn commented 5 years ago

This would allow user to exclude their entire local subnet (e.g. - "192.168.1.0/24"). Also, I have a lot of entries from 108.177.70.0/24 and 108.177.71.0/24, which belong to Google and I assume are due to Assistant integration (not using Nabu Casa). CIDR notation is a lot cleaner than adding each of the 510 addresses in those ranges...

claytonjn commented 5 years ago

Crap, I thought I tested this thoroughly but I just got a notification that should have been excluded... 🤔

claytonjn commented 5 years ago

I think I'm missing something. Can I test the exclude list by deleting .ip_authenticated.yaml, clearing persistent notifications, and rebooting?

ludeeus commented 5 years ago

It's actually become a lot smarter in the newer versions, so that will not trigger a new notification. Only new IP's added to .sorage/auth during runtime are considered new.

reasons:

claytonjn commented 5 years ago

So is the exclusion list not being used in newer versions? I reverted back to the latest release and added a bunch of IPs to the list but still got notifications.

ludeeus commented 5 years ago

It should. That is a bug.

ludeeus commented 5 years ago

I have pushed a fix for excluded IP's now, but that completely messed with this PR. If you still want to add this, please rebase your branch, or open a new PR :)

claytonjn commented 5 years ago

Sorry for the delay...I wanted to give it a few days to make sure everything was working. I merged the changes into my branch, but in the diff it's showing the whole file being replaced for some reason. Want me to just open a new PR?

ludeeus commented 5 years ago

The reason is the quotes, during the last restructure I enabled auto black formating in the devcontainer, this PR is fine as is