Method: Codebot::Sanitizers#valid_secret

Defined in:
lib/codebot/sanitizers.rb

#valid_secret(secret) ⇒ String?

Sanitizes a webhook secret.

Parameters:

  • secret (String, nil)

    the webhook secret to sanitize

Returns:

  • (String, nil)

    the sanitized value or nil on error



30
31
32
# File 'lib/codebot/sanitizers.rb', line 30

def valid_secret(secret)
  secret if /\A[[:print:]]*\z/ =~ secret
end