Class: GithubAuthentication::GitCredentialHelper
- Inherits:
-
Object
- Object
- GithubAuthentication::GitCredentialHelper
- Defined in:
- lib/github_authentication/git_credential_helper.rb
Instance Method Summary collapse
- #handle_get ⇒ Object
-
#initialize(provider:, description:) ⇒ GitCredentialHelper
constructor
A new instance of GitCredentialHelper.
Constructor Details
#initialize(provider:, description:) ⇒ GitCredentialHelper
Returns a new instance of GitCredentialHelper.
5 6 7 8 |
# File 'lib/github_authentication/git_credential_helper.rb', line 5 def initialize(provider:, description:) @provider = provider @description = description end |
Instance Method Details
#handle_get ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/github_authentication/git_credential_helper.rb', line 10 def handle_get unless @description["protocol"] == "https" && @description["host"] == "github.com" warn("Unsupported description: #{@description}") return 2 end token = @provider.token(seconds_ttl: min_cache_ttl) puts("password=#{token}") puts("username=api") 0 end |