For our Smart Home Security System
we need to be able to identify people and devices
and check their access rights.
This is a key part of the system
and is our 'single source of truth.'
It integrates with the Dwyl authentication system using
auth_plug
and stores as little personal information as possible.
This is a simple Phoenix-Based REST service made of three key parts:
Devices
Devices can be added and removed from the system. They can be NFC tags or more complicated devices like phones. These devices are automatically associated with the logged in user.
Locks
(Called doors internally - we should refractor this at some point).
Add locks to the system and add or remove users access to them. Locks are
uniquely identified and associated with users through the keyholders
table.
Access
Looks up a user and lock and determines whether to grant access or not.
git clone https://github.com/dwyl/smart-home-auth
AUTH_API_KEY
Follow the instructions to get your API Key
To start the Phoenix server:
mix deps.get
config/dev.exs
mix ecto.setup
mix phx.server
insomnia.json
is an export of the Insomnia
workspace used to develop the API.
It should have most routes and authentication configured.
We recommend using Insomnia for development, see: https://github.com/dwyl/learn-insomnia