[prev in list] [next in list] [prev in thread] [next in thread] 

List:       grinder-development
Subject:    [Grinder-development] [ grinder-Bugs-3497557 ] TCPProxy recording fails at re-creating urls with tok
From:       SourceForge.net <noreply () sourceforge ! net>
Date:       2012-03-29 11:38:13
Message-ID: E1SDDgF-0006GB-EQ () sfs-ml-1 ! v29 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Bugs item #3497557, was opened at 2012-03-06 04:54
Message generated for change (Comment added) made by bushwakko
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=118598&aid=3497557&group_id=18598

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: HTTP Plugin
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Anders Storsveen (bushwakko)
Assigned to: Philip Aston (philipa)
Summary: TCPProxy recording fails at re-creating urls with tokens

Initial Comment:
I have a case where a token is (correctly and automatically) discovered by the \
recorder via httpUtilities.valueFromLocationURI(). It also attemtps to create a later \
url which contains that token. However the token is never url encoded.

I confirmed this was the case by using urllib and the urlencode() method. This \
created a working url.

----------------------------------------------------------------------

> Comment By: Anders Storsveen (bushwakko)
Date: 2012-03-29 04:38

Message:
I'm liking fixes that make the script look good, however I don't
necessarily like to much magic if it could introduce unexpected errors for
the users later. I don't however have enough knowledge to be very helpful
in this. Keep up the good work though!

----------------------------------------------------------------------

Comment By: Philip Aston (philipa)
Date: 2012-03-25 04:57

Message:
I'm trying to decide the right way to fix this.

1. We could pass the query string parameters as NVPairs.This would require
handling these tokens differently from path parameters, and a reasonable
amount of change to the XSL scripts. We'd still need to fix the urlencoding
of path parameters. IIRC, there's also some issue with method overloading
and making sure Jython binds to the right GET(..)/POST(..)/... method. On
the other hand, this would result in a reasonable script.

2. We could URL encode the whole path argument. This would look ugly in the
script.

3. We could URL encode each query string value in the path. This would look
ugly in the script, and potentially still be broken because the query
string keys need encoding too.

4. We could capture the token string keys and values in encoded form. This
would solve another lurking bug: values captured from response body <input>
tokens are not urldecoded. We could still use the urldecoded key to
generate a reasonable token ID.

Currently, I'm favouring 4.

----------------------------------------------------------------------

Comment By: Philip Aston (philipa)
Date: 2012-03-25 04:45

Message:
Analysis: The recording currently unencodes tokens. It relies on the
HTTPRequest method to re-encode URLs as required

Unfortunately, the generated script passes query string and path tokens by
concatenating up a single the path parameter. HTTPRequest does no further
processing on this parameter.

----------------------------------------------------------------------

Comment By: Philip Aston (philipa)
Date: 2012-03-15 02:53

Message:
It certianly helps. I'll put this on my queue, thanks.

----------------------------------------------------------------------

Comment By: Anders Storsveen (bushwakko)
Date: 2012-03-13 04:33

Message:
Was the code ok?

----------------------------------------------------------------------

Comment By: Anders Storsveen (bushwakko)
Date: 2012-03-09 01:36

Message:
This script is auto-generated:

  def page27(self):
    """GET verifyLoggedIn (request 2701)."""
    
    # Expecting 302 'Found'
    result = request2701.GET('/verifyLoggedIn')
    self.token_SAMLRequest = \
      httpUtilities.valueFromLocationURI('SAMLRequest') #
'nZLbTsMwDIZfpcp9l7Tr2hFtkwYTYhKHaRtccINC...'
    self.token_RelayState = \
      httpUtilities.valueFromLocationURI('RelayState') #
'https://staging.comoyo.no/verifyLoggedIn'

    return result

 def page32(self):
    """GET sso (requests 3201-3208)."""
    
    # Expecting 307 'Temporary Redirect'
    result = request3201.GET('/id/sso' +
      '?SAMLRequest=' +
      self.token_SAMLRequest +
      '&RelayState=' +
      self.token_RelayState)
    self.token_FlowState = \
      httpUtilities.valueFromLocationURI('FlowState') #
'cmVxdWVzdElkPV83NGMyMDYwNDkwOGE1NzQ3Y2Q5...'



Here is how I had to fix it:



  def page32(self):
    """GET sso (requests 3201-3208)."""
    
    # DEFINES FLOWSTATE HERE!
    print "Using Samlreq: " , self.token_SAMLRequest , " and relaystate: ",
self.token_RelayState

    samlReqEnc = urllib.urlencode(self.token_SAMLRequest)

    # Expecting 307 'Temporary Redirect'
    result = request32011.GET('/id/sso' +
      '?SAMLRequest=' +
      samlReqEnc +
      '&RelayState=' +
      self.token_RelayState)
    self.token_FlowState = \
      httpUtilities.valueFromLocationURI('FlowState') #
'cmVxdWVzdElkPV83NGMyMDYwNDkwOGE1NzQ3Y2Q5...'


----------------------------------------------------------------------

Comment By: Philip Aston (philipa)
Date: 2012-03-08 10:33

Message:
Please post an example of an incorrectly script. Thanks.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=118598&aid=3497557&group_id=18598

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Grinder-development mailing list
Grinder-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/grinder-development


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic