Movatterモバイル変換


[0]ホーム

URL:


Libraries »piotrmurach/github(master) »Index (A) »Github »Authorization

Module: Github::Authorization

Included in:
API
Defined in:
lib/github_api/authorization.rb

Instance Method Summarycollapse

Instance Method Details

#auth_codeObject

Strategy token

21222324
# File 'lib/github_api/authorization.rb', line 21defauth_code_verify_clientclient.auth_codeend

#authenticated?Boolean

Check whether authentication credentials are present

Returns:

  • (Boolean)
495051
# File 'lib/github_api/authorization.rb', line 49defauthenticated?basic_authed?||oauth_token?end

#authenticationObject

Select authentication parameters

61626364656667
# File 'lib/github_api/authorization.rb', line 61defauthenticationifbasic_authed?{login:,password:password}else{}endend

#authorize_url(params = {}) ⇒Object

Sends authorization request to GitHub.

Parameters

  • :redirect_uri - Optional string.

  • :scope - Optional string. Comma separated list of scopes. Available scopes:

    • (no scope) - public read-only access (includes public user profile info, public repo info, and gists).

    • user - DB read/write access to profile info only.

    • public_repo - DB read/write access, and Git read access to public repos.

    • repo - DB read/write access, and Git read access to public and private repos.

    • gist - write access to gists.

37383940
# File 'lib/github_api/authorization.rb', line 37defauthorize_url(params={})_verify_clientclient.auth_code.authorize_url(params)end

#basic_authed?Boolean

Check whether basic authentication credentials are present

Returns:

  • (Boolean)
545556
# File 'lib/github_api/authorization.rb', line 54defbasic_authed?basic_auth?||(login?&&password?)end

#clientObject

Setup OAuth2 instance

9101112131415161718
# File 'lib/github_api/authorization.rb', line 9defclient@client||=::OAuth2::Client.new(client_id,client_secret,{:site=>current_options.fetch(:site){Github.site},:authorize_url=>'login/oauth/authorize',:token_url=>'login/oauth/access_token',:ssl=>{:verify=>false}})end

#get_token(authorization_code, params = {}) ⇒Object

Makes request to token endpoint and retrieves access token value

43444546
# File 'lib/github_api/authorization.rb', line 43defget_token(authorization_code,params={})_verify_clientclient.auth_code.get_token(authorization_code,params)end
Generated on Sat Nov 22 21:04:27 2025 byyard 0.9.37 (ruby-3.4.3).

[8]ページ先頭

©2009-2025 Movatter.jp