Module: GithubAuthentication

Defined in:
lib/github_authentication.rb,
lib/github_authentication/http.rb,
lib/github_authentication/cache.rb,
lib/github_authentication/token.rb,
lib/github_authentication/version.rb,
lib/github_authentication/provider.rb,
lib/github_authentication/generator.rb,
lib/github_authentication/retriable.rb,
lib/github_authentication/environment.rb,
lib/github_authentication/object_cache.rb,
lib/github_authentication/generator/app.rb,
lib/github_authentication/generator/personal.rb,
lib/github_authentication/git_credential_helper.rb

Defined Under Namespace

Modules: Generator, Http, Retriable Classes: Cache, Environment, GitCredentialHelper, ObjectCache, Provider, Token

Constant Summary collapse

VERSION =
"1.3.2"

Class Method Summary collapse

Class Method Details

.provider(org:, env: ENV) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/github_authentication.rb', line 13

def provider(org:, env: ENV)
  ga_env = Environment.new(org: org, env: env)
  generator = Generator::App.new(
    pem: ga_env.pem,
    installation_id: ga_env.installation_id,
    app_id: ga_env.app_id,
  )
  storage = begin
    ga_env.storage
  rescue KeyError
    ObjectCache.new
  end
  cache = Cache.new(storage: storage, key: org)
  Provider.new(generator: generator, cache: cache)
end