-
Notifications
You must be signed in to change notification settings - Fork 389
Making it possible to run integration tests against any Firebase project #22
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Just a couple of minor stuff.
test/integration/utils.js
Outdated
} | ||
|
||
var apiKey = process.argv[2]; | ||
if (apiKey == undefined) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typeof apiKey === 'undefined'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
test/integration/utils.js
Outdated
return serviceAccount.project_id; | ||
} | ||
|
||
function getApiKey() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: add javadoc for this function like you did for the ones above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes seem pretty straightforward. I'd address @bojeil-google's comments then this LGTM.
On a side note, with the hardcoded API key here being removed, is there any concern over that project being discovered and used maliciously?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They would need to get hold of the service account credentials which are not exposed here and can only be obtained via the Firebase Console.
Thanks for the reviews. I've made the suggested changes. As @bojeil-google mentioned, it seems there's no risk in exposing the API key. See http://stackoverflow.com/questions/37482366/is-it-safe-to-expose-firebase-apikey-to-the-public for more details. |
* Implement the App Check API
* Refactor CryptoSigner (#21) * Refactor Crypto Signer * Introduce new CryptoSignerError type * reorder imports * PR fixes * PR clean up * feat(fac): Implement the App Check API (#22) * Implement the App Check API * Add AppCheck public API (#23) * Add AppCheck public API * Add AppCheck public api unit tests * Add FAC Verify Token API (#26) * (feat): Add FAC Verify token API - Re-try with all the keys when kid is not present in the token header. - Add JWKS key fetcher - Add public API for FAC verify token * Add ref docs and unit tests * PR fixes * Update api extractor report * Add more tests for token-verifier * export jwks key pairs * PR fixes * More PR fixes * Update src/app-check/index.ts Co-authored-by: Kevin Cheung <[email protected]> Co-authored-by: Kevin Cheung <[email protected]> * Add App ID Co-authored-by: Kevin Cheung <[email protected]>
* Refactor CryptoSigner (#21) * Refactor Crypto Signer * Introduce new CryptoSignerError type * reorder imports * PR fixes * PR clean up * feat(fac): Implement the App Check API (#22) * Implement the App Check API * Add AppCheck public API (#23) * Add AppCheck public API * Add AppCheck public api unit tests * Add FAC Verify Token API (#26) * (feat): Add FAC Verify token API - Re-try with all the keys when kid is not present in the token header. - Add JWKS key fetcher - Add public API for FAC verify token * Add ref docs and unit tests * PR fixes * Update api extractor report * Add more tests for token-verifier * export jwks key pairs * PR fixes * More PR fixes * Update src/app-check/index.ts Co-authored-by: Kevin Cheung <[email protected]> Co-authored-by: Kevin Cheung <[email protected]> * Add App ID Co-authored-by: Kevin Cheung <[email protected]>
Currently integration tests are run against a specific Firebase project (admin-sdks-integration). This enables running integration tests against any Firebase project. This will allow external developers to run the test suite against their own projects/credentials.
See issue: #21