commit | 4bc04e14721b384d129dc5832782d97d9f72a45e | [log] [tgz] |
---|---|---|
author | Ankur <ataly@google.com> | Tue Jun 09 11:51:30 2015 -0700 |
committer | Ankur <ataly@google.com> | Tue Jun 09 11:51:32 2015 -0700 |
tree | 87516a88a952a63783fefc309e7c9dd560e2f813 | |
parent | b23d9c6e075e468fc8fb72ad070b232a3e8c7da2 [diff] |
"physical-lock": Send and receive keys This CL adds the following three commands to the physical-lock CLI. - 'scanusers': Scans the neighborhood for physical-lock users. Physical-lock users advertise themselves over the neighborhood using the user identity encapsulated in their default blessings. Here, user identity is defined as the portion of the blessing after 'dev.v.io/u' if the blessing name matches 'dev.v.io/u'; otherwise it is the entire blessing name. The user names obtained via this command would be supplied to the 'sendkey' command to send physical-lock keys to other users. - 'recvkey': Sets up the client to receive physical-lock keys from other users. On receiving a key it asks for permission before saving it. - 'sendkey': Send a specific key to another physical-lock user present in the neighborhood. The specific key to send is identified based on the name of the lock supplied as an argument to this command. The user is one of the names returned by a prior 'scanusers' call. Change-Id: Ieb921ed703e59cedf1b9f33c69c6d016578e76d5
This is an example application built on the Vanadium stack.
Conventions
Features to add to the Lock server:
AuditLog(startTime, endTime time.Time) []AuditLog | error type AuditLog struct { Blessing string Action LockStatus Timestamp time.Time }
We'd also have to work out how to control access to this AuditLog. One option is to use caveats - so when “making” a new key one can choose to insert the “noadmin” caveat?
Features to add to the Lock client:
sendkey
Apologies for this unconventional, possibly unreadable circuit representation. Putting it down so that the author can remember! TODO(ashankar): Clean it up!
The pin number assignments here work both for RaspberryPi Model B/B+ and RaspberryPi2-ModelB.
---(Pin 1)-------/\/\(10KΩ)/\/\---------(COM port of magnetic switch) \ \----/\/\(1KΩ)/\/\---------(Pin 15 = GPIO22) \ \----(LED)-----| | | (N.O. port of magnetic switch)--| | | (-ve terminal of active buzzer)--| | | | (Pin 6 = GND)--| ---(Pin 11 = GPIO17)-----------(+ terminal of active buzzer)
To build for the RaspberryPi setup with the circuitry mentioned above:
v23 go get -u github.com/davecheney/gpio V23_PROFILE=arm v23 go install v.io/x/lock/lockd scp $V23_ROOT/release/projects/physical-lock/go/bin/lockd <rpi_scp_location>
If building without the arm
profile, there are no physical switches/relays and instead a simulated hardware is used that uses the interrupt signal (SIGINT) to simulate locking/unlocking externally.