Skip to content

Implemented a util for getting project ID from the credential or the environment #69

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

Merged
merged 3 commits into from
Sep 8, 2017

Conversation

hiranya911
Copy link
Contributor

  • Renamed the internal utils method as _utils
  • Added a new project_id() function
  • Updated test cases

Returns:
str: A project ID value or None.
"""
pid = app.options.get('projectId')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it make sense to initialize app to get all the values from the environment as opposed doing this lookup every time someone calls project_id(app)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Now this logic runs as part of firebase_admin.initialize_app(). Updated test cases accordingly.

@hiranya911
Copy link
Contributor Author

Made the suggested change. Project ID look up logic is now moved to initialize_app().

@hiranya911 hiranya911 merged commit a536d43 into master Sep 8, 2017
@hiranya911 hiranya911 deleted the hkj-project-id-2 branch September 8, 2017 17:34
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