akamai / httpie-edgegrid

Plugin for httpie to allow edge grid authentication for Akamai
Apache License 2.0
69 stars 22 forks source link

DXE-4387 [BUG] Installation failure with httpie cli #76

Open glenthomas opened 3 days ago

glenthomas commented 3 days ago

Describe the bug

Command httpie cli plugins install httpie-edgegrid fails to install the plugin.

To Reproduce

Steps to reproduce the behavior:

  1. httpie cli plugins install httpie-edgegrid

Expected behavior

Plugin installation succeeds

Screenshots

(Full log output below)

image

Please complete the following information:

Additional context

Installing httpie-edgegrid...
Collecting httpie-edgegrid
  Using cached httpie_edgegrid-2.1.4-py3-none-any.whl.metadata (3.5 kB)
Collecting httpie==3.2.2 (from httpie-edgegrid)
  Using cached httpie-3.2.2-py3-none-any.whl.metadata (7.6 kB)
Collecting edgegrid-python==1.3.1 (from httpie-edgegrid)
  Using cached edgegrid_python-1.3.1-py3-none-any.whl.metadata (754 bytes)
Collecting pyOpenSSL==24.1.0 (from httpie-edgegrid)
  Using cached pyOpenSSL-24.1.0-py3-none-any.whl.metadata (12 kB)
Requirement already satisfied: urllib3<3.0.0 in /opt/homebrew/Cellar/httpie/3.2.4/libexec/lib/python3.13/site-packages (from httpie-edgegrid) (2.2.3)
Requirement already satisfied: requests>=2.3.0 in /opt/homebrew/Cellar/httpie/3.2.4/libexec/lib/python3.13/site-packages (from edgegrid-python==1.3.1->httpie-edgegrid) (2.32.3)
Requirement already satisfied: requests-toolbelt>=0.9.0 in /opt/homebrew/Cellar/httpie/3.2.4/libexec/lib/python3.13/site-packages (from edgegrid-python==1.3.1->httpie-edgegrid) (1.0.0)
Collecting ndg-httpsclient (from edgegrid-python==1.3.1->httpie-edgegrid)
  Using cached ndg_httpsclient-0.5.1-py3-none-any.whl.metadata (6.2 kB)
Collecting pyasn1 (from edgegrid-python==1.3.1->httpie-edgegrid)
  Using cached pyasn1-0.6.1-py3-none-any.whl.metadata (8.4 kB)
Requirement already satisfied: pip in /opt/homebrew/lib/python3.13/site-packages (from httpie==3.2.2->httpie-edgegrid) (24.2)
Requirement already satisfied: charset-normalizer>=2.0.0 in /opt/homebrew/Cellar/httpie/3.2.4/libexec/lib/python3.13/site-packages (from httpie==3.2.2->httpie-edgegrid) (3.4.0)
Requirement already satisfied: defusedxml>=0.6.0 in /opt/homebrew/Cellar/httpie/3.2.4/libexec/lib/python3.13/site-packages (from httpie==3.2.2->httpie-edgegrid) (0.7.1)
Requirement already satisfied: Pygments>=2.5.2 in /opt/homebrew/Cellar/httpie/3.2.4/libexec/lib/python3.13/site-packages (from httpie==3.2.2->httpie-edgegrid) (2.18.0)
Requirement already satisfied: multidict>=4.7.0 in /opt/homebrew/Cellar/httpie/3.2.4/libexec/lib/python3.13/site-packages (from httpie==3.2.2->httpie-edgegrid) (6.1.0)
Requirement already satisfied: setuptools in /opt/homebrew/Cellar/httpie/3.2.4/libexec/lib/python3.13/site-packages (from httpie==3.2.2->httpie-edgegrid) (75.3.0)
Requirement already satisfied: rich>=9.10.0 in /opt/homebrew/Cellar/httpie/3.2.4/libexec/lib/python3.13/site-packages (from httpie==3.2.2->httpie-edgegrid) (13.9.4)
Collecting cryptography<43,>=41.0.5 (from pyOpenSSL==24.1.0->httpie-edgegrid)
  Using cached cryptography-42.0.8-cp39-abi3-macosx_10_12_universal2.whl.metadata (5.3 kB)
Collecting cffi>=1.12 (from cryptography<43,>=41.0.5->pyOpenSSL==24.1.0->httpie-edgegrid)
  Using cached cffi-1.17.1-cp313-cp313-macosx_11_0_arm64.whl.metadata (1.5 kB)
Requirement already satisfied: idna<4,>=2.5 in /opt/homebrew/Cellar/httpie/3.2.4/libexec/lib/python3.13/site-packages (from requests>=2.3.0->edgegrid-python==1.3.1->httpie-edgegrid) (3.10)
Requirement already satisfied: certifi>=2017.4.17 in /opt/homebrew/opt/certifi/lib/python3.13/site-packages (from requests>=2.3.0->edgegrid-python==1.3.1->httpie-edgegrid) (2024.8.30)
Requirement already satisfied: PySocks!=1.5.7,>=1.5.6 in /opt/homebrew/Cellar/httpie/3.2.4/libexec/lib/python3.13/site-packages (from requests[socks]>=2.22.0->httpie==3.2.2->httpie-edgegrid) (1.7.1)
Requirement already satisfied: markdown-it-py>=2.2.0 in /opt/homebrew/Cellar/httpie/3.2.4/libexec/lib/python3.13/site-packages (from rich>=9.10.0->httpie==3.2.2->httpie-edgegrid) (3.0.0)
Collecting pycparser (from cffi>=1.12->cryptography<43,>=41.0.5->pyOpenSSL==24.1.0->httpie-edgegrid)
  Using cached pycparser-2.22-py3-none-any.whl.metadata (943 bytes)
Requirement already satisfied: mdurl~=0.1 in /opt/homebrew/Cellar/httpie/3.2.4/libexec/lib/python3.13/site-packages (from markdown-it-py>=2.2.0->rich>=9.10.0->httpie==3.2.2->httpie-edgegrid) (0.1.2)
Using cached httpie_edgegrid-2.1.4-py3-none-any.whl (9.2 kB)
Using cached edgegrid_python-1.3.1-py3-none-any.whl (17 kB)
Using cached httpie-3.2.2-py3-none-any.whl (127 kB)
Using cached pyOpenSSL-24.1.0-py3-none-any.whl (56 kB)
Using cached cryptography-42.0.8-cp39-abi3-macosx_10_12_universal2.whl (5.9 MB)
Using cached ndg_httpsclient-0.5.1-py3-none-any.whl (34 kB)
Using cached pyasn1-0.6.1-py3-none-any.whl (83 kB)
Using cached cffi-1.17.1-cp313-cp313-macosx_11_0_arm64.whl (178 kB)
Using cached pycparser-2.22-py3-none-any.whl (117 kB)
Installing collected packages: pycparser, pyasn1, cffi, httpie, cryptography, pyOpenSSL, ndg-httpsclient, edgegrid-python, httpie-edgegrid
  Attempting uninstall: httpie
    Found existing installation: httpie 3.2.4
Can't install 'httpie-edgegrid'
glenthomas commented 3 days ago

I'm not a Python dev and don't understand the dependency versioning nightmares of Python, but I'm guessing this is because requirements.txt contains httpie==3.2.2 and this PR needs merging and my brew install gave me httpie 3.2.4?

KonradRajda commented 1 day ago

Hi @glenthomas, thanks for reporting this issue. I was able to reproduce it and create internal ticket to fix it. We will inform you about progress.

Best regards, Konrad Rajda

glenthomas commented 1 day ago

Hi @KonradRajda, I think you just need to merge the existing PR and create a new release of this plugin.

lkowalsk-akamai-com commented 18 hours ago

Hi @glenthomas, we are planning to release new version of httpie-edgegrid end of Nov/beginning of Dec with changes regarding versions managment and a bug fix.

glenthomas commented 11 hours ago

@lkowalsk-akamai-com the problem is, I have just installed httpie using homebrew (macos) and there is no way to install a previous version of httpie for use with this plugin, I just get the latest. Is there some way I can get this running with the current release of httpie-edgegrid?

glenthomas commented 11 hours ago

Problem solved. I have installed using pip instead of Homebrew.

python -m pip install httpie
httpie cli plugins install httpie-edgegrid
glenthomas commented 11 hours ago

Although, even after installing the plugin, it doesn't work...

% http --auth-type edgegrid -a default: :/alerts/v2/alert-definitions/a@cp_529099_3593/alert-firings
usage:
    http -A/--auth-type {basic, digest, bearer} [METHOD] URL [REQUEST_ITEM ...]

error:
    argument --auth-type/-A: invalid choice: 'edgegrid' (choose from 'basic',
'bearer', 'digest')
glenthomas commented 10 hours ago

OK I've found the troubleshooting note about installing with pip instead. Now it recognises the plugin for auth-type, but fails on SSL verification:

http: error: SSLError: HTTPSConnectionPool(host='akab-5tq3rdx25xbs2zq5-o3dpzmufla273lr6.luna.akamaiapis.net', port=443): Max retries exceeded with url: /alerts/v2/alert-definitions/a@cp_129099_3593/alert-firings (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)'))) while doing a GET request to URL: https://akab-5tq3rdx25xbs2zq5-o3dpzmufla273lr6.luna.akamaiapis.net/alerts/v2/alert-definitions/a@cp_129099_3593/alert-firings

glenthomas commented 10 hours ago

After running pip install pip-system-certs I finally have this thing working. What a nightmare 😓