Class: Vcsmap::Plugin::GoogleOauth
- Inherits:
-
BasePlugin
- Object
- BasePlugin
- Vcsmap::Plugin::GoogleOauth
- Defined in:
- lib/vcsmap/plugins/google_oauth.rb
Instance Attribute Summary
Attributes inherited from BasePlugin
Instance Method Summary collapse
- #credentials(file) ⇒ Object
-
#initialize ⇒ GoogleOauth
constructor
A new instance of GoogleOauth.
- #table_header ⇒ Object
Methods inherited from BasePlugin
Constructor Details
#initialize ⇒ GoogleOauth
Returns a new instance of GoogleOauth.
4 5 6 7 8 |
# File 'lib/vcsmap/plugins/google_oauth.rb', line 4 def initialize @search_string = 'filename:client_secrets.json+.apps.googleusercontent.com' @client_id_regex = /(?:\"|')client_id(?:\"|')\:(?:\ |)(?:\"|')(.*?)(?:\"|')/i @client_secret_regex = /(?:\"|')client_secret(?:\"|')\:(?:\ |)(?:\"|')(.*?)(?:\"|')/i end |
Instance Method Details
#credentials(file) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/vcsmap/plugins/google_oauth.rb', line 10 def credentials(file) @client_id = capture_match(@client_id_regex, file) @client_secret = capture_match(@client_secret_regex, file) ['oAuth', @client_id, @client_secret] rescue NoMethodError [] end |
#table_header ⇒ Object
18 19 20 |
# File 'lib/vcsmap/plugins/google_oauth.rb', line 18 def table_header %w(Protocol client_id client_secret) end |