Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make API key less likely to be logged #83

Merged

Conversation

EvanHahn
Copy link
Contributor

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.

Internal tests passed.

Fixes #82.

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 <#82>.
@EvanHahn EvanHahn requested review from kasrak and jbbakst March 23, 2019 00:17
@EvanHahn EvanHahn merged commit 45661dd into master Mar 25, 2019
@EvanHahn EvanHahn deleted the evanhahn-defineSensitivePropertiesWithObject.defineProperties branch March 25, 2019 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants