-
Notifications
You must be signed in to change notification settings - Fork 407
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
Response contains my API key #82
Comments
That's surprising! Is that happening from this line? console.log('Retrieved', record.get('Ingredient')); Or another one? |
Yes, if I console log the whole record. Here's a working example. If you could see the console logs you could see my API key https://glitch.com/edit/#!/scaretable-page-request?path=server.js:43:51 |
ahh it's not the server response, it's just the way the SDK is formatting the stuff for me to use. |
Correct, that's not in the server response, but rather in the in-memory representation on the client. That said, it is fixable. I.e. we can probably fix it so that accidentally logging any objects returned by the SDK does not reveal the API key. |
Ah cool, yeah that would be a great service for us using the API to teach and livestream. |
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>.
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>.
We believe we've fixed this in #83 and will deploy a new version of Airtable.js soon! |
A fix for this has been published in |
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>.
Right now when I do:
The response (that's console logged here) contains something that looks like this:
This causes some issues when I'm working on for example doing live coding or demo projects (I work in developer education). This happened to a colleague of mine and he had to reset his key.
The text was updated successfully, but these errors were encountered: