speakfriend
offers simple, straightforward password management for R
users and advocates.
Password management is what Emily
Riederer calls a “first-mile
task,”
the kind an R champion should make as simple as possible, as early as
possible, to empower and engage their community. speakfriend
builds on
the powerful and flexible keyring
package to help community developers
do just that.
RStudio’s keyring package provides secure password management for R, as Sharon Machlis outlines in this excellent article.
speakfriend
adds 4 elements targeted to the beginner:
keyring
shows the same featureless prompt
no matter what’s being asked. This can be confusing for new users
who need to know clearly whether R needs their master password or
an individual system password, and why.speakfriend
will offer to create one first, and explain what it’s
doing.speakfriend
strives to give the user as
much information as is helpful. For example if an action that
requires interactivity is being run outside an interactive session
(e.g. unlocking the keyring), speakfriend
will fail and tell the
user exactly what function they need to run.speakfriend
uses just one keyring
and stores just one password per system. This is all many users
need. keyring
allows more options, outlined below under
Nomenclature.speakfriend
is not yet available on
CRAN. You can install it from
GitHub with:
# install.packages("devtools")
devtools::install_github("BenjaminWolfe/speakfriend")
speakfriend
has just 11 exported functions:
library(speakfriend)
create_keyring() # creates keyring, leaves it in unlocked state
has_keyring() # checks for existence of keyring
lock_keyring() # locks keyring, does not require master password
keyring_locked() # checks if keyring is locked
unlock_keyring() # prompts for master password, unlocks keyring
list_keys() # lists keys
set_key("system_name") # prompts for individual password, sets key
has_key("system_name") # checks for existence of key for a given system
get_key("system_name") # returns individual password
drop_key("system_name") # forgets individual password
drop_keyring() # e.g. if you forgot your master password
speakfriend
is named after a scene in J.R.R. Tolkien’s The Fellowship
of the
Ring.
The party comes upon an enormous stone door with an elven inscription:
The Doors of Durin, Lord of Moria. Speak, friend, and enter.
They tried several passwords, spells, and gestures, until finally it occurred to Gandalf that it was a simple riddle. They needed only to say the elven word for “friend” and the door would open.
speakfriend
aims for a similar level of simplicity; one might say you
type speakfriend
, and enter
. And as the Doors of Durin once allowed
unfettered trade
between the words of the Dwarves and the Elves, hopefully this package
will help you develop a thriving community of R users.
I considered and avoided using Tolkien analogies in a more heavy-handed
way, beyond perhaps the preceding paragraph. For clarity I instead
retained the original keyring
analogy (see below).
In the keyring
analogy, a key stores one username-password
combination. You might need more than one key per system, if you use
more than one username to access it. A keyring is a store for one or
more keys. So, conceivably, you could have multiple personas on your
machine, each with their own keyring, each accessing multiple systems.
keyring
allows other possibilities as well. You could have multiple
keys for a given system, all on the same keyring. Or you could use no
keyring at all; this would allow you to keep any number of keys, just
the same, but without a master password to lock them.
speakfriend
requires users to use a keyring. You can still use
multiple keyrings with options(keyring_keyring = "your_keyring")
, but
you can use the package without specifying anything about keyrings.
speakfriend
does not currently allow multiple usernames per system,
again as a bid for simplicity. For any given system, you simply call
get_key("system_name")
to get the user’s one password for that sytem.
The speakfriend
hex logo uses the Party
Business font by
Nancy Lorenz. A die-hard LotR fan might note (and do well in noting)
that the font is inspired by the handwriting of Bilbo Baggins, a humble
hobbit, rather than that of the legendary elves who forged the Doors of
Durin. On that note, though, this package really should be for the
Bilbos of the world. Besides, elvish fonts are hard to come by, and this
one is license-free.
I did make one modification to the original font. Lorenz’s “k” has a crossbar that makes it look a bit like an “r.” And “spearfriend” would have made for a rather imposing R package.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.