sdwilsh / hass-truenas

TrueNAS integration for Home Assistant
MIT License
39 stars 11 forks source link

Add api key auth #14

Closed MatthewFlamm closed 3 years ago

MatthewFlamm commented 3 years ago

This PR adds api key authentication including config flow. Since the config flow now creates entries with different data, a new version is created and old entries are migrated.

Currently auth_mode is included in the config entry since it makes the config_flow portion more readable IMO, i.e. we can just use dict.update in the second form rather than pulling out individual items. It is currently unused other than in config flow. This is really marginal, so I'm fine taking it out.

I tested the api authorization on a test ha server on my TrueNAS server, but I did not test the migration on a live server.

Fixes #4