* Centralize OAuth2.0 Credential logic
Adds a Credentials class that centralizes and handles most existing
logic related to OAuth2.0 credentials, including generation, storage,
file locking, and attribute retrieval. This is a step towards
minimizing the duplicated code that handles credentials in various
methods. The goal is to eventually get to a point where there are 2
credential entry points: `auth.get_admin_credentials()` and
`auth.get_credentials_for_user(user)`. Then, we can slowly move toward
using impersonated credentials for all operations and scrap the need
for user consented credentials all together.
* Skip test_delete_removes_lock_file when testing on Windows
- Programmatically set Consent (Branding page) saving a user step
- record created_by in client_secrets.json for easier backtracking
- use local project-apis.txt if it exists
* Begin breaking apart gam.py into logical pieces
Start with one of the deepest parts of the stack, Google API request execution calls and associated errors. Critical information printing functions and application control logic are also broken out into their own components.
This change also adds unit tests for migrated content and makes code more PEP8 compliant.
This commit starts work on jay0lee/GAM#147
* Add unit tests to Travis config
* Swap assert_called_once() with assertEqual() and Mock.call_count
Makes tests compatible with Python 3.5. assert_called_once() is only available in Python 3.6+
* Fix group settings
Clean up md5MatchesFile
* Simplify doGetCustomerInfo
Avoid trap when doPrintDomains returned a domain creationTime with no fraction.
Traceback (most recent call last):
File "gam.py", line 14761, in <module>
File "gam.py", line 14159, in ProcessGAMCommand
File "gam.py", line 2053, in doGetDomainInfo
File "gam.py", line 2088, in doGetCustomerInfo
File "_strptime.py", line 577, in _strptime_datetime
File "_strptime.py", line 359, in _strptime
ValueError: time data '2019-04-23 16:14:56' does not match format '%Y-%m-%d %H:%
M:%S.%f'
lansa.co.uk,True,2019-04-23 16:14:13.041000,secondary,
lansa.com.au,True,2019-04-23 16:14:56,secondary