autobahn-python icon indicating copy to clipboard operation
autobahn-python copied to clipboard

Pass throught custom http headers as transport configuration

Open fungs opened this issue 1 year ago • 2 comments

This minimalistic PR adds the possibility to specify custom http headers as transport configuration.

Example:

component = AutobahnComponent(
  transports={
    "type": "websocket",
    "url": "YOUR URL",
    "headers": {"Authorization": "YOUR CUSTOM AUTHORIZATION"},
  },
    ...
)

The patch does not change the internal logic, the configuration is automatically passed and used in the websocket connection factory. I tried to keep the changes minimal (although I was tempted to apply the boy scout rule and do some tidy up work).

fungs avatar Mar 07 '24 11:03 fungs

rgd

https://github.com/crossbario/autobahn-python/actions/runs/8187466713/job/22419880678?pr=1630#step:8:116

pls see

https://github.com/crossbario/autobahn-python/pull/1628#issuecomment-1976024550

TLDR: this is fallout from a breaking change in pytest-asyncio ...

oberstet avatar Mar 08 '24 02:03 oberstet

I will do the polishing next week.

fungs avatar Mar 09 '24 20:03 fungs

I will do the polishing next week.

Here we go, I raised a ValueError, as for the other incompatible arguments and removed the default None return value from get().

fungs avatar Mar 20 '24 10:03 fungs

flake is complaining about WS https://github.com/crossbario/autobahn-python/actions/runs/8357659564/job/22881485753?pr=1630#step:6:71

the asyncio issue is related to the latest (breaking) changes in pytest-asyncio rgd event loop setup I guess ..

oberstet avatar Mar 20 '24 12:03 oberstet

  autobahn/wamp/component.py:124:9: E123 closing bracket does not match indentation of opening bracket's line
  autobahn/wamp/component.py:163:1: W293 blank line contains whitespace
  1     E123 closing bracket does not match indentation of opening bracket's line
  1     W293 blank line contains whitespace
  flake8: exit 1 (4.27 seconds) /home/runner/work/autobahn-python/autobahn-python> flake8 -v --statistics --ignore=E402,E501,E722,E741,N801,N802,N803,N805,N806,N815,N818 --exclude 'autobahn/wamp/message_fbs.py,autobahn/wamp/gen/*' autobahn pid=2865

oberstet avatar Mar 24 '24 09:03 oberstet

rebased to master and rerunning CI .. let's see

https://github.com/crossbario/autobahn-python/pull/1638

oberstet avatar Apr 13 '24 09:04 oberstet

merged via #1638 - thanks for contributing!

oberstet avatar Apr 13 '24 09:04 oberstet