Commit Graph

7 Commits

Author SHA1 Message Date
Todd Derr 86de5fe13b Add support for a system default credentials file.
The path is:
  - windows: %ProgramData%\Google\Auth\application_default_credentials.json
  - other: /etc/google/auth/application_default_credentials.json
2015-06-29 16:35:45 -04:00
Herbert Siojo 5061fb5add Enables reading credentials from env vars.
- ServiceAccountCredentials, ServiceAccountJwtHeaderCredentials
and UserRefreshCredentials initializers now take keyword args
via options hash.

- In `credentials_loader.rb`, refactored env var checking into
private methods

- Updated tests & added new tests.

- Fixed existing test for #from_well_known_path 'fails if
the file is invalid', where `from_env` was called instead of
`from_well_known_path`.

- Fixed rubocop errors I introduced, but two existing ones remain.

- Added entry to changelog.

- Fixed rubocop errors from code containing parallel assignments

- Updated rubocop_todo.yml to ignore parallel assignments and
trailing underscore assignments.
2015-05-21 13:38:19 -07:00
Tim Emiola bd97c23d9f Make the scope optional 2015-03-17 16:46:55 -07:00
Tim Emiola 8f33ba8f4c Explicitly checks for user auth and fail if auth type is not known 2015-03-09 09:50:18 -07:00
Tim Emiola 4d4bcd46e8 Add support for loading either credentials type as determined by the loaded content 2015-03-06 16:58:57 -08:00
Tim Emiola df56f8af33 Refactoring: move the credentials load into its own class 2015-03-06 15:13:40 -08:00
Tim Emiola a5bb601fe3 Adds an implementation of Application Default Credentials
- supports two initial scenarios
  - 2LO with service accounts
  - Compute Engine

- performs all 3 'sniffs' for the service account credentials
  - from environment
  - from a well known file
  - from GCE
2015-02-12 16:59:08 -08:00