code: def check_secret(self, secret):
          
          try:
              return hmac.compare_digest(secret, self.secret)
          except AttributeError:  # pragma: no cover
              return secret == self.secret
docs: Checks if the secret string used in the authentication attempt
          matches the "known" secret string. Some mechanisms will override this
          method to control how this comparison is made.
  
          Args:
              secret: The secret string to compare against what was used in the
                  authentication attempt.
  
          Returns:
              True if the given secret matches the authentication attempt.