pact-foundation / pact-jvm

JVM version of Pact. Enables consumer driven contract testing, providing a mock service and DSL for the consumer project, and interaction playback and verification for the service provider project.
https://docs.pact.io
Apache License 2.0
1.09k stars 480 forks source link

Cryptocurrency mining references found in source code #1664

Open palotasb-booking opened 1 year ago

palotasb-booking commented 1 year ago

Hi, can you explain the hardcoded references to miningmadness.com introduced in edb04a4d92cc44ed834ead5abf59b416c3baa476 ("fix: revert some changes due to GH Windows agents https://github.com/pact-foundation/pact-jvm/issues/405")? That's a crypto mining website: https://wheretomine.io/pools/miningmadness

CC @rholshausen

SchulteMarkus commented 1 year ago

looooool

YOU54F commented 1 year ago

Some background reading. It comes from the /etc/hosts file on GH actions runners. On windows agents, it is in a different case

https://github.com/square/okhttp/pull/6811 https://github.com/actions/runner-images/issues/3353

I imagine it was causing some issues in the windows CI runs

rholshausen commented 1 year ago

That change is making sure that if the local host reverse lookup ever resolves to that site, don't use it!

palotasb-booking commented 1 year ago

Thank you for your kind answers @YOU54F and @rholshausen. So do I understand correctly that your code reads all the domains listed in /etc/hosts (at least in some GitHub Actions), one of which is with some upper-case letters MiningMadness.com? This has caused issues (because of the upper-case letters), and the change we noticed is trying to fix this issue? Please correct me if I misunderstand.

Is there a way to solve that issue without hard-coding miningmadness.com in the source code? Perhaps by lower-casing the input domains in general and not just this specific one or by ignoring all non-lower-case domains? It's super-suspicious the way it's currently implemented.