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