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
fix(auth): Fixed the ability to discover the project ID when running on GCP managed environments #755
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.
Just a couple of nits. Otherwise looks good.
src/utils/index.ts
Outdated
@@ -56,14 +56,15 @@ export function addReadonlyGetter(obj: object, prop: string, value: any): void { | |||
} | |||
|
|||
/** | |||
* Determines the Google Cloud project ID associated with a Firebase app by examining | |||
* the Firebase app options, credentials and the local environment in that order. | |||
* Returns the Google Cloud project ID associated with a Firebase app, if its explicitly |
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.
it's
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/unit/auth/credential.spec.ts
Outdated
@@ -328,6 +329,47 @@ describe('Credential', () => { | |||
}); | |||
}); | |||
}); | |||
|
|||
it('should cache discovered project id', () => { | |||
const expected = 'test-project-id'; |
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: Rename expected
to expectedProjectId
here and below.
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
@bojeil-google I've made the suggested changes. |
Support for auto discovering the project ID when running on Compute Engine, Cloud Run etc.
Verified by running a build on a Compute Engine instance.