Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remap the ports returned by the Container in the ProtocolMetaData #13

Merged
merged 1 commit into from
Nov 8, 2014

Conversation

aslakknutsen
Copy link
Member

The Container only knows about the ports it self is bound to,
not how Docker is remapping them from the outside.

When e.g. the Container is bound to port 8080 inside Docker
and Docker PortForward from external port 8081 to internal
8080 the ProtocolMetaData is of. This effects the ServletProtocol
which is attempting to use this information to communicate with
the in-container test case as well as URL injection on the client
side via @ArquillianResource.

When the ProtocolMetaData is created, the object is intercepted
bu Cube to update the data based on the port we know are being
forwarded.

fixes #12

The Container only knows about the ports it self is bound to,
not how Docker is remapping them from the outside.

When e.g. the Container is bound to port 8080 inside Docker
and Docker PortForward from external port 8081 to internal
8080 the ProtocolMetaData is of. This effects the ServletProtocol
which is attempting to use this information to communicate with
the in-container test case as well as URL injection on the client
side via @ArquillianResource.

When the ProtocolMetaData is created, the object is intercepted
bu Cube to update the data based on the port we know are being
forwarded.

fixes arquillian#12
@lordofthejars
Copy link
Member

So now I understand why initially when I used @ArquillianResource it works because the ports where the same. This is a lesson I have learned in cube, do your tests with different ports, it will be more secure :)

lordofthejars added a commit that referenced this pull request Nov 8, 2014
Remap the ports returned by the Container in the ProtocolMetaData
@lordofthejars lordofthejars merged commit c17c9d6 into arquillian:master Nov 8, 2014
@aslakknutsen aslakknutsen deleted the protocol_update branch November 8, 2014 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ProtocolMetaData returned by Container is wrong when using PortForwarding
2 participants