{"id":13507409,"url":"https://github.com/peburrows/goth","last_synced_at":"2025-03-30T08:30:30.724Z","repository":{"id":38454703,"uuid":"50007485","full_name":"peburrows/goth","owner":"peburrows","description":"Elixir package for Oauth authentication via Google Cloud APIs","archived":false,"fork":false,"pushed_at":"2024-12-20T11:01:20.000Z","size":309,"stargazers_count":303,"open_issues_count":13,"forks_count":116,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-24T19:07:21.961Z","etag":null,"topics":["authentication","elixir","gcp","google","google-cloud-platform"],"latest_commit_sha":null,"homepage":"http://hexdocs.pm/goth","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/peburrows.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-01-20T05:41:14.000Z","updated_at":"2025-03-17T23:00:00.000Z","dependencies_parsed_at":"2024-01-05T21:53:35.118Z","dependency_job_id":"f3599591-0b10-4bfe-91cc-04c9d7a2d4d6","html_url":"https://github.com/peburrows/goth","commit_stats":{"total_commits":234,"total_committers":47,"mean_commits":"4.9787234042553195","dds":0.6068376068376069,"last_synced_commit":"bfdd423735d90cd8b6adbf05f5d150891e354a43"},"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peburrows%2Fgoth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peburrows%2Fgoth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peburrows%2Fgoth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peburrows%2Fgoth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peburrows","download_url":"https://codeload.github.com/peburrows/goth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246296351,"owners_count":20754625,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","elixir","gcp","google","google-cloud-platform"],"created_at":"2024-08-01T02:00:33.119Z","updated_at":"2025-03-30T08:30:30.403Z","avatar_url":"https://github.com/peburrows.png","language":"Elixir","funding_links":[],"categories":["Authentication","Elixir"],"sub_categories":[],"readme":"# Goth\n\n![CI](https://github.com/peburrows/goth/workflows/CI/badge.svg)\n\n\nGoogle + Auth = Goth\n\nA simple library to generate and retrieve OAuth2 tokens for use with Google\nCloud Service accounts.\n\n## Installation\n\n**Note:** below are instructions for using Goth v1.3+. For more information on\nearlier versions of Goth, [see v1.2.0 documentation on hexdocs.pm](https://hexdocs.pm/goth/1.2.0).\n\n1. Add `:goth` to your list of dependencies in `mix.exs`.\n\n   ```elixir\n   def deps do\n     [\n       {:goth, \"~\u003e 1.4\"}\n     ]\n   end\n   ```\n\n2. Add Goth to your supervision tree:\n\n   ```elixir\n   defmodule MyApp.Application do\n     use Application\n\n     def start(_type, _args) do\n       credentials =\n         \"GOOGLE_APPLICATION_CREDENTIALS_JSON\"\n         |\u003e System.fetch_env!()\n         |\u003e Jason.decode!()\n\n       source = {:service_account, credentials}\n\n       children = [\n         {Goth, name: MyApp.Goth, source: source}\n       ]\n\n       Supervisor.start_link(children, strategy: :one_for_one)\n     end\n   end\n   ```\n\n   If you set `GOOGLE_APPLICATION_CREDENTIALS` or\n   `GOOGLE_APPLICATION_CREDENTIALS_JSON`, have a\n   `~/.config/gcloud/application_default_credentials.json` file,\n   `~/.config/gcloud/configurations/config_default` file or deploy\n   your application to Google Cloud, you can omit the `:source` option:\n\n   ```elixir\n   def start(_type, _args) do\n     children = [\n       {Goth, name: MyApp.Goth}\n     ]\n\n     Supervisor.start_link(children, strategy: :one_for_one)\n   end\n   ```\n\n   If you want to use multiple credentials, you may consider doing:\n\n   ```elixir\n   def start(_type, _args) do\n     Supervisor.start_link(servers(), strategy: :one_for_one)\n   end\n\n   defp servers do\n     servers = [\n       {MyApp.Cred1, source1},\n       ...\n       {MyApp.CredN, source2}\n     ]\n\n     for {name, source} \u003c- servers do\n       Supervisor.child_spec({Goth, name: name, source: source}, id: name)\n     end\n   end\n   ```\n\n3. Fetch the token:\n\n   ```elixir\n   iex\u003e Goth.fetch!(MyApp.Goth)\n   %Goth.Token{\n     expires: 1453356568,\n     token: \"ya29.cALlJ4ICWRvMkYB-WsAR-CZnExE459PA7QPqKg5nei9y2T9-iqmbcgxq8XrTATNn_BPim\",\n     type: \"Bearer\",\n     ...\n   }\n   ```\n\nSee `Goth.start_link/1` for more information about possible configuration options.\n\n\n## Upgrading from Goth 1.2\n\nSee [Upgrading from Goth 1.2](UPGRADE_GUIDE.md) guide for more information.\n\n## Community resources\n\n- [How to upload on YouTube Data API with elixir ?](https://mrdotb.com/posts/upload-on-youtube-with-elixir/)\n\n## Copyright and License\n\nCopyright (c) 2016 Phil Burrows\n\nThis work is free. You can redistribute it and/or modify it under the terms of\nthe MIT License. See the [LICENSE.md](./LICENSE.md) file for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeburrows%2Fgoth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeburrows%2Fgoth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeburrows%2Fgoth/lists"}