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

Invalid URL 'None': No scheme supplied. Perhaps you meant https://None? #53

Closed CptMo closed 11 months ago

CptMo commented 1 year ago

Expected Behaviour

When calling enable_organizations_trusted_access like in https://github.com/superwerker/superwerker/blob/main/templates/backup.yaml#L505 the trusted access should be enabled automatically.

Actual Behaviour

Currently the call in https://github.com/superwerker/superwerker/blob/main/templates/backup.yaml#L505 fails with the named error.

I was able to hunt it down to the following:

[DEBUG] 2023-07-21T11:21:05.264Z 1e2e9abc-bb04-418c-b8fd-c86193146098 Getting url :None with arguments : {'url': None, 'headers': {'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'Accept-Encoding': 'gzip, deflate, br', 'Accept-Language': 'en-US,en;q=0.5', 'Connection': 'keep-alive', 'Upgrade-Insecure-Requests': '1', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:73.0) Gecko/20100101 Firefox/73.0', 'Cookie': 'aws-account-data=%7B%22marketplaceGroup%22%3A%22AWS%22%7D; ....., 'allow_redirects': False}

Also it was possible to extract the URL before and I assume the problem is to extract the headers from oauth at https://github.com/schubergphilis/awsapilib/blob/main/awsapilib/authentication/authentication.py#L456

Current Workaround

None

costastf commented 1 year ago

Hi @CptMo , thanks for reporting! Many things have changed from aws side and I have fixed all the high level authentications on a working branch. Stack sets are also fundamentaly changed and I need to implement the new x-amz cookies also which is a work in progress. I will fix this but it takes some time since I cannot invest too much of focus time on this. I will keep this issue up to date with progress.

aperovic-idealo commented 12 months ago

It seems that aws implemented the activation and deactivation of trusted access via Organizations for boto3.

See here:

This would make this feature obsolete I assume?

CptMo commented 11 months ago

As mentioned by @aperovic-idealo this issue is resolved by using boto3. Thanks @costastf for digging into it anyway 💯