schubergphilis / awsapilib

A python library exposing services that are not covered by the official boto3 library but are driven by undocumented APIs.
MIT License
60 stars 8 forks source link

get_control_tower_authenticated_session method is broken #37

Closed kiwi-33 closed 2 years ago

kiwi-33 commented 2 years ago

awsapilib Version

2.3.1

Expected Result

authenticated ControlTower session

Actual Result

This errors with:

Invalid URL 'None': No schema supplied. Perhaps you meant http://None?

I have managed to narrow it down to this http request in authentication.py L454-459

Printing the response content:

...Your web browser must have JavaScript enabled...
costastf commented 2 years ago

It seems that they are in the process of rolling out the official API, the calls are going through to https://prod.eu-west-1.blackbeard.aws.a2z.com/ for eu-west1. I fixed the authentication part but all the calls go to a different end point now and the call structure is different. @s0enke has done quite some work on this a while back when they were rolling the apis again. Maybe he can chime in with a thought on how to move forward? I have pushed the current changes to https://github.com/schubergphilis/awsapilib/tree/control-tower-authentication just for reference.

s0enke commented 2 years ago

Yes, there is a WIP branch which uses the new API: https://github.com/schubergphilis/awsapilib/compare/main...superwerker:control_tower_native_api - feel free to continue work from there, my time is currently a bit limited. I will leave a note here once I am continiuing the work.

Tracking the issue for superwerker here: https://github.com/superwerker/superwerker/issues/298 - I will focus on getting a hotfix out for superwerker first, though.

s0enke commented 2 years ago

superwerker is hotfixed by using the WIP branch https://github.com/schubergphilis/awsapilib/compare/main...superwerker:control_tower_native_api directly. This also ensures that at least the deploy function is working since it's covered by the superwerker integration tests.

costastf commented 2 years ago

v3 removed the need for the authenticated session so this can be closed. @kiwi-33 ?