Class: GitHubApp
- Inherits:
-
Object
- Object
- GitHubApp
- Defined in:
- lib/issue_db/utils/github_app.rb
Constant Summary collapse
- TOKEN_EXPIRATION_TIME =
45 minutes
2700
- JWT_EXPIRATION_TIME =
10 minutes
600
Instance Method Summary collapse
-
#initialize ⇒ GitHubApp
constructor
A new instance of GitHubApp.
Constructor Details
#initialize ⇒ GitHubApp
Returns a new instance of GitHubApp.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/issue_db/utils/github_app.rb', line 19 def initialize # app ids are found on the App's settings page @app_id = fetch_env_var("ISSUE_DB_GITHUB_APP_ID").to_i # installation ids look like this: # https://github.com/organizations/<org>/settings/installations/<8_digit_id> @installation_id = fetch_env_var("ISSUE_DB_GITHUB_APP_INSTALLATION_ID").to_i # app keys are found on the App's settings page and can be downloaded # format: "-----BEGIN...key\n...END-----\n" # make sure this key in your env is a single line string with newlines as "\n" @app_key = fetch_env_var("ISSUE_DB_GITHUB_APP_KEY").gsub(/\\+n/, "\n") @client = nil @token_refresh_time = nil end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object (private)
This method is called when a method is called on the GitHub class that does not exist. It delegates the method call to the Octokit client.
96 97 98 |
# File 'lib/issue_db/utils/github_app.rb', line 96 def method_missing(method, *args, &block) client.send(method, *args, &block) end |