mirror of
https://github.com/atom/atom.git
synced 2026-01-22 21:38:10 -05:00
Add getters and setters for the keychain
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
"guid": "0.0.10",
|
||||
"jasmine-focused": "~0.15.0",
|
||||
"mkdirp": "0.3.5",
|
||||
"keytar": "0.13.0",
|
||||
"less-cache": "0.10.0",
|
||||
"nslog": "0.1.0",
|
||||
"oniguruma": "0.24.0",
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
crypto = require 'crypto'
|
||||
ipc = require 'ipc'
|
||||
keytar = require 'keytar'
|
||||
os = require 'os'
|
||||
path = require 'path'
|
||||
remote = require 'remote'
|
||||
@@ -352,9 +353,13 @@ class Atom
|
||||
getVersion: ->
|
||||
app.getVersion()
|
||||
|
||||
# Public: Get the name of the github token in the keychain
|
||||
getGitHubTokenName: ->
|
||||
'Atom GitHub API Token'
|
||||
# Public: Set the the github token in the keychain
|
||||
setGitHubAuthToken: (token) ->
|
||||
keytar.replacePassword('Atom GitHub API Token', 'github', token)
|
||||
|
||||
# Public: Get the github token from the keychain
|
||||
getGitHubAuthToken: ->
|
||||
keytar.getPassword('Atom GitHub API Token', 'github')
|
||||
|
||||
# Public: Get the directory path to Atom's configuration area.
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user