Ticket #234 (closed enhancement: fixed)

Opened 2 years ago

Last modified 8 months ago

Expose the AMF request envelope

Reported by: nick Owned by: nick
Priority: minor Milestone: 0.5
Component: Remoting Version: 0.3
Keywords: Cc:
Fixed in revision: 2647 Branch: amf-request-234
Author: nick

Description (last modified by nick) (diff)

It would be nice to be able to expose the request to the service method

WARNING: The attached patches are complete hacks and should not be used in a production env (especially where threads are used)

Attachments

echo-example-234.diff Download (353 bytes) - added by nick 2 years ago.
Patch to print amf request in echo demo
request-attribute-234.diff Download (3.8 KB) - added by nick 14 months ago.
Same patch - updated against pyamf/branches/release-0.4

Change History

Changed 2 years ago by nick

Patch to print amf request in echo demo

Changed 2 years ago by nick

  • keywords hack added
  • owner nick deleted
  • status changed from new to assigned
  • description modified (diff)

I have attached a patch which sets an __amfrequest__ attribute to the calling method (or instance if a methodtype) and also modified the demo echo example to print out the __amfrequest__

class TestService:
    def test(self):
        print self.__amfrequest__

def test2(arg1, arg2):
    print test2.__amfrequest__

from pyamf.remoting.gateway.django import DjangoGateway

services = {
    'test1': TestService,
    'test2': test2
}

gw = DjangoGateway(services)

Changed 2 years ago by thijs

  • milestone changed from 0.3 to 0.4

Changed 21 months ago by thijs

  • milestone changed from 0.3.2 to 0.4

Changed 14 months ago by nick

Same patch - updated against pyamf/branches/release-0.4

Changed 12 months ago by thijs

  • priority changed from major to minor
  • milestone changed from 0.5 to At some point

Changed 11 months ago by nick

  • owner set to nick
  • status changed from assigned to accepted
  • milestone changed from At some point to 0.5

A decision has been made to attach the amf request object to the http request in a framework sensitive way.

E.g.:

  • Twisted: http_request.amf_request
  • Django: As a middleware component
  • WSGI: environamf_request?

Changed 11 months ago by nick

  • keywords hack removed
  • branch set to amf-request-234

Changed 8 months ago by nick

  • keywords review added
  • owner nick deleted
  • status changed from accepted to assigned

All gateway classes now expose the amf_request object if expose_request is True.

This allows us to be able to supply an amf response object to be able to control headers and such .. but that is for another ticket.

Changed 8 months ago by thijs

  • keywords review removed
  • owner set to nick

Ok merge, best way to test in the end.

Changed 8 months ago by nick

  • status changed from assigned to closed
  • revfixed set to 2647
  • resolution set to fixed
  • author set to nick
Note: See TracTickets for help on using tickets.