-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make API key less likely to be logged (#83)
Before this change: const at = new Airtable({ apiKey: 'keyXyz' }) console.log(at) // => Class { _apiKey: 'keyXyz', ... } After this change: const at = new Airtable({ apiKey: 'keyXyz' }) console.log(at) // => Class { ... } This is accomplished with `Object.defineProperties`. By default, properties defined this way aren't enumerable, making it more difficult to accidentally log them. Addresses <Airtable/airtable.js#82>.
- Loading branch information
1 parent
85e1420
commit 8372b46
Showing
2 changed files
with
39 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
'use strict'; | ||
|
||
var Airtable = require('../lib/airtable'); | ||
|
||
describe('Airtable', function () { | ||
it("doesn't include the API key as an enumerable property", function () { | ||
var fakeAirtable = new Airtable({apiKey: 'keyXyz'}); | ||
|
||
Object.values(fakeAirtable).forEach(function (value) { | ||
expect(value).not.toEqual('keyXyz'); | ||
}); | ||
}); | ||
}); |