PyFCM
PyFCM copied to clipboard
project_id and service_account_file should be optional arguments
Hello,
FCMNotification(BaseAPI)
allows you to supply either a service_account_file
to load credentials from, or an already-loaded credentials
argument. However because service_account_file
is positional, you must supply a falsey value to indicate you are using credentials
.
Also, project_id
is a property of the google.oauth2.Credentials
object, so it could be inferred if not explicitly provided. I'm not sure when/if your Credentials
object wouldn't have a project_id associated with it, but that could be raised as an exception if neither the credentials nor the project_id
argument provide it.
IMO it would be great if these were both optional parameters, to make both methods of passing credentials a little less clunky.
I'd be happy to open a PR if you agree with this, cheers!