Numbers that nearly went public
Have you saved a password to a repository? This lesson shows why deleting it is not enough, and how to choose who reads it.
The scene
On Monday a plumber in work clothes handed Najla a court envelope at the public window, where people hand in papers, with a phone number pencilled on the back. The envelope had brought his summons: he was a witness, due before the judge on Wednesday morning. "My number's new; I don't know it. I hear you send reminders." Najla copied it to the week's witness list and promised a message Tuesday evening.
Faris, the new employee, handled reminders. At 3:40, after closing time, he opened his copy of the website's public repository, which publishes the court's page. He added a file of witnesses and numbers, as the messages take their times from the repository's hearing schedule, pasted under it the long string the messaging service issued for his program, and saved a . New to the service, he called Hussam from the IT office before he .
Hussam read the , stopping at the numbers. "This is a : anyone online can read it, account or not; only its owners write in it. That string is an : a program uses it instead of a password to act in the owner's name, so whoever finds it can message people as the court."
Ibrahim, the head clerk, came in and read the list. "They gave us these numbers for a reminder, not for strangers to call."
"Can't I just delete a mistake after pushing?" Faris asked.
Hussam scrolled back to last year's commits. "Mine. I put the court's email password in a file by mistake and deleted it an hour later." He opened the commit before the deletion: the whole password. "Deleting adds a commit, but the old one stays in the history, and anyone who made a that hour has a copy. So I changed the password that day."
"Numbers, tokens and passwords are , and belong outside every repository. Put the numbers on the messaging service's own page; it does the sending."
Faris undid the commit, still on his computer, and entered the list on the service's page.
On Tuesday morning Leila, a lawyer, proposed a line for the name of the witness's employer on the attendance form template. That week the court had moved its templates into a , seen only by those on its list, while drafts were unfinished, so she could no longer take a of it.
Hussam opened the names list on the court's account, a shared one no single person owns, and Ibrahim chose who would write in the templates: Najla, Faris, and Leila, now that this was her only way in.
"I'll add you as a ," Hussam told Leila, meaning someone with a set level of access. Hers was writing without administration, enough to open a and a . "First turn on two-step sign-in. It asks for a phone code besides your password, so a stolen password alone can't write in our templates as you."
She turned it on by phone and accepted his invitation.
At six on Tuesday evening, under a customer's sink, the plumber felt his phone buzz: "Reminder: your hearing is tomorrow, Wednesday, at 9:00." He wiped his hand on his shirt and read it. His number was nowhere on the web.
The idea
What a repository saves stays in its history; you decide who reads it.
- : anyone reads it; its owners write in it.
- : only the people on its list see it.
- : someone given a level of access: read, write or administer in an organisation. Two-step sign-in protects their account from a stolen password.
- : passwords, tokens, people's information. Keep it out: deleting it leaves the earlier commit.
- : a string a program uses instead of a password, acting in its owner's name.
If a secret reaches a repository others read, assume it exposed and change or revoke it.
Try it yourself
- In a private window, open an old of someone else's public repository: you can read it without an account.
- Start a new repository and read GitHub's notes under public and private.
- In your repository, find who has access and how to invite a . A personal account has one level: write.
- In account settings, read the two-step sign-in methods. The page asks what a token may do and when it expires; look, but create nothing.
To see an invitation as received, you need a second account.
Where this fits
Now you choose who reads and writes in your repository; the last lesson reads a stranger's from a link.