https://github.com/tsloughter/augle
Auth + Google = Augle
https://github.com/tsloughter/augle
authentication erlang gcp google-cloud google-cloud-platform
Last synced: 10 months ago
JSON representation
Auth + Google = Augle
- Host: GitHub
- URL: https://github.com/tsloughter/augle
- Owner: tsloughter
- License: apache-2.0
- Created: 2013-09-04T04:58:43.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2019-12-06T17:38:12.000Z (about 6 years ago)
- Last Synced: 2025-04-01T19:08:47.263Z (11 months ago)
- Topics: authentication, erlang, gcp, google-cloud, google-cloud-platform
- Language: Erlang
- Homepage:
- Size: 171 KB
- Stars: 21
- Watchers: 2
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Augle
Auth + Google = Augle
---
### Usage
This library is specifcally for service accounts for Google Cloud. It accepts a few different forms of fetching the access tokens for a service account:
* `default`: This will work through the order defined in [Google Application Default Credentials](https://developers.google.com/identity/protocols/application-default-credentials).
* `{file, Path}`: Acts the same as if you have the os variable `GOOGLE_APPLICATION_CREDENTIALS` defined to the `Path`.
* `{file, Path, Scopes}`: Acts the same as above but supports the inclusion of scopes you need credentials for.
* `{metadata, ServiceAccount}`: If all else fails under `default` it will try this method with `<<"default">>` a the `ServiceAccount`. You can instead use it directly and use different service accounts. It must be running on a Google cloud instance (including through AppEngine or Container Engine) or when developing with the [GCE Metadata Emulator](https://medium.com/google-cloud/google-compute-engine-metadata-server-emulator-fe0fb1e5a8b5).
There is a cache that is checked first, keyed on how the credentials were fetched, that sets a timer that sends a message to the cache process to refresh the credentials 10 seconds before they expire. Not expected to work well if you are storing a shit load of service account credentials in the same cache...
Simply add to your `rebar.config` deps list:
```
{deps, [augle]}.
```