Class: Gitlab::SlashCommands::VerifyRequest
- Inherits:
-
Object
- Object
- Gitlab::SlashCommands::VerifyRequest
- Defined in:
- lib/gitlab/slash_commands/verify_request.rb
Instance Attribute Summary collapse
-
#chat_name ⇒ Object
Returns the value of attribute chat_name.
-
#integration ⇒ Object
Returns the value of attribute integration.
-
#response_url ⇒ Object
Returns the value of attribute response_url.
Instance Method Summary collapse
- #approve! ⇒ Object
-
#initialize(integration, chat_name, response_url = nil) ⇒ VerifyRequest
constructor
A new instance of VerifyRequest.
- #valid? ⇒ Boolean
Constructor Details
#initialize(integration, chat_name, response_url = nil) ⇒ VerifyRequest
Returns a new instance of VerifyRequest.
8 9 10 11 12 |
# File 'lib/gitlab/slash_commands/verify_request.rb', line 8 def initialize(integration, chat_name, response_url = nil) @integration = integration @chat_name = chat_name @response_url = response_url end |
Instance Attribute Details
#chat_name ⇒ Object
Returns the value of attribute chat_name.
6 7 8 |
# File 'lib/gitlab/slash_commands/verify_request.rb', line 6 def chat_name @chat_name end |
#integration ⇒ Object
Returns the value of attribute integration.
6 7 8 |
# File 'lib/gitlab/slash_commands/verify_request.rb', line 6 def integration @integration end |
#response_url ⇒ Object
Returns the value of attribute response_url.
6 7 8 |
# File 'lib/gitlab/slash_commands/verify_request.rb', line 6 def response_url @response_url end |
Instance Method Details
#approve! ⇒ Object
14 15 16 17 |
# File 'lib/gitlab/slash_commands/verify_request.rb', line 14 def approve! update_token! end |
#valid? ⇒ Boolean
19 20 21 22 23 |
# File 'lib/gitlab/slash_commands/verify_request.rb', line 19 def valid? return false if integration.token.nil? || chat_name.token.nil? ActiveSupport::SecurityUtils.secure_compare(integration.token, chat_name.token) end |