Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Updated Auth API #5

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 5 commits into from
Mar 27, 2017
Merged

Updated Auth API #5

merged 5 commits into from
Mar 27, 2017

Conversation

hiranya911
Copy link
Contributor

  • Change firebase module to firebase_admin
  • Made 'credential' a positional argument of initialize_app()
  • Updated affected test cases and linter scripts

Copy link

@jwngr jwngr left a comment

Choose a reason for hiding this comment

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

Just a few comments.

@@ -18,7 +20,8 @@ def initialize_app(options, name=_DEFAULT_APP_NAME):
App constructor.

Args:
options: A dictionary of configuration options.
credential: A credential object derived from credentials.Base interface (optional).
Copy link

Choose a reason for hiding this comment

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

Do you think we need the credentials.Base stuff in there? Is there a way to indicate a type of the arg so that it gets picked up in our ref docs and here we can just put something like "A credential object used to initialize the SDK (optional). If none is provided, Google Application Default Credentials are used."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the docstring as suggested. Unfortunately there's no way to cross reference other types (at least not in Python itself). But there may be some doc plugins out there that support something like this.

@@ -1,21 +1,18 @@
"""Firebase Authentication Library.
"""Firebase custom authentication module.
Copy link

Choose a reason for hiding this comment

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

Suggestion: "Firebase Authentication module". This won't just be for custom auth in the future once we add user management stuff and the capital "A" is because it references the product.

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

'StringOptions': ('foo', ValueError),
}

invalid_credentials = [None, '', 'foo', 0, 1, dict(), list(), tuple(), True, False]
Copy link

Choose a reason for hiding this comment

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

None is a valid credential, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes you're right. Removed it. It currently raises an exception for None, since we haven't implemented App default credential type yet.

@@ -1,72 +1,69 @@
"""Tests for firebase.App."""
Copy link

Choose a reason for hiding this comment

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

s/firebase/firebase_admin

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

@@ -0,0 +1,77 @@
"""Firebase credentials module."""
Copy link

Choose a reason for hiding this comment

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

What do you think about adding tests for this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a couple of basic test cases

@jwngr jwngr assigned hiranya911 and unassigned jwngr Mar 27, 2017
@hiranya911 hiranya911 assigned jwngr and unassigned hiranya911 Mar 27, 2017
Copy link

@jwngr jwngr left a comment

Choose a reason for hiding this comment

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

LGTM. And CI passed, so you are good to go!

@jwngr jwngr assigned hiranya911 and unassigned jwngr Mar 27, 2017
@hiranya911 hiranya911 merged commit e937f28 into master Mar 27, 2017
@jwngr jwngr deleted the hkj-auth-api-changes branch March 27, 2017 23:50
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