Class: GithubAuthentication::Environment

Inherits:
Object
  • Object
show all
Defined in:
lib/github_authentication/environment.rb

Instance Method Summary collapse

Constructor Details

#initialize(org:, env: ENV) ⇒ Environment

Returns a new instance of Environment.



9
10
11
12
# File 'lib/github_authentication/environment.rb', line 9

def initialize(org:, env: ENV)
  @org = org.presence
  @env = env
end

Instance Method Details

#app_idObject



18
19
20
# File 'lib/github_authentication/environment.rb', line 18

def app_id
  resolve("GITHUB_APP_ID")
end

#installation_idObject



22
23
24
# File 'lib/github_authentication/environment.rb', line 22

def installation_id
  resolve("GITHUB_APP_INSTALLATION_ID")
end

#pemObject



14
15
16
# File 'lib/github_authentication/environment.rb', line 14

def pem
  File.read(resolve("GITHUB_APP_KEYFILE"))
end

#storageObject



26
27
28
# File 'lib/github_authentication/environment.rb', line 26

def storage
  ActiveSupport::Cache::FileStore.new(resolve("GITHUB_APP_CREDENTIAL_STORAGE_PATH"))
end