Sorry, this will be a bit long ...
py-oauthlib:- could do with a DESCR tidyup, e.g. like this:A generic, spec-compliant, thorough implementation of the OAuth request-signing logic.
done.
- any idea why there's a @mode 444 in py-oauthlib's PLIST for the egg-infodirectory(!) and files? that looks wrong.
Because without it I get this:Error: weird mode for /usr/local/lib/python2.7/site-packages/oauthlib-0.7.2-py2.7.egg-info/PKG-INFO: 440 Error: modes don't match for /usr/local/lib/python2.7/site-packages/oauthlib-0.7.2-py2.7.egg-info/PKG-INFO
... (for all files in that dir)Looking at /usr/local/lib/python2.7/site-packages/*.egg-info/ all files there are 444, that said, directory was obviously an oversight. I'm not sure this is the correct solution though ...
- deps are wrong, most of the RUN_DEPENDS should be TEST_DEPENDS, and devel/py-unittest2 is missing from the list .. see oauthlib.egg-info/requires.txt :
huh interesting, I hadn't looked at that file, only what was posted online and (at that time) the listed requirements were different. it almost matches the requirements.txt tagged for the 0.7.2 branch, but not completely, so chances are I looked at the master branch when I made the port which already had changes to requirements.txt since the 0.7.2 branch; but I digress.
Regardless, I fixed up the port adding test depends, port builds and seems to work, however 'make test' fails:
# make test ===> Regression tests for py-oauthlib-0.7.2cd /usr/ports/pobj/py-oauthlib-0.7.2/oauthlib-0.7.2 && /usr/local/bin/python2.7 -m unittest discover
...............................................................................................................................................................................E.....................................................EE..EE..... ======================================================================ERROR: test_request_body (tests.oauth2.rfc6749.clients.test_service_application.ServiceApplicationClientTest)
---------------------------------------------------------------------- Traceback (most recent call last):File "/usr/local/lib/python2.7/site-packages/mock.py", line 1201, in patched
return func(*args, **keywargs)File "/usr/ports/pobj/py-oauthlib-0.7.2/oauthlib-0.7.2/tests/oauth2/rfc6749/clients/test_service_application.py", line 84, in test_request_body
body=self.body)File "/usr/ports/pobj/py-oauthlib-0.7.2/oauthlib-0.7.2/oauthlib/oauth2/rfc6749/clients/service_application.py", line 172, in prepare_request_body
assertion = jwt.encode(claim, key, 'RS256')File "/usr/local/lib/python2.7/site-packages/jwt/api.py", line 122, in encode
raise NotImplementedError('Algorithm not supported') NotImplementedError: Algorithm not supported ======================================================================ERROR: test_authorization_grant (tests.oauth2.rfc6749.test_server.SignedTokenEndpointTest)
---------------------------------------------------------------------- Traceback (most recent call last):File "/usr/local/lib/python2.7/site-packages/mock.py", line 1201, in patched
return func(*args, **keywargs)File "/usr/ports/pobj/py-oauthlib-0.7.2/oauthlib-0.7.2/tests/oauth2/rfc6749/test_server.py", line 223, in test_authorization_grant
'', body=body)File "/usr/ports/pobj/py-oauthlib-0.7.2/oauthlib-0.7.2/oauthlib/oauth2/rfc6749/endpoints/base.py", line 64, in wrapper
return f(endpoint, uri, *args, **kwargs)File "/usr/ports/pobj/py-oauthlib-0.7.2/oauthlib-0.7.2/oauthlib/oauth2/rfc6749/endpoints/token.py", line 100, in create_token_response
request, self.default_token_type)File "/usr/ports/pobj/py-oauthlib-0.7.2/oauthlib-0.7.2/oauthlib/oauth2/rfc6749/grant_types/authorization_code.py", line 240, in create_token_response
token = token_handler.create_token(request, refresh_token=True)File "/usr/ports/pobj/py-oauthlib-0.7.2/oauthlib-0.7.2/oauthlib/oauth2/rfc6749/tokens.py", line 250, in create_token
'access_token': self.token_generator(request),File "/usr/ports/pobj/py-oauthlib-0.7.2/oauthlib-0.7.2/oauthlib/oauth2/rfc6749/tokens.py", line 211, in signed_token_generator
return common.generate_signed_token(private_pem, request)File "/usr/ports/pobj/py-oauthlib-0.7.2/oauthlib-0.7.2/oauthlib/common.py", line 246, in generate_signed_token
token = jwt.encode(claims, private_key, 'RS256')File "/usr/local/lib/python2.7/site-packages/jwt/api.py", line 122, in encode
raise NotImplementedError('Algorithm not supported') NotImplementedError: Algorithm not supported ======================================================================ERROR: test_client_grant (tests.oauth2.rfc6749.test_server.SignedTokenEndpointTest)
---------------------------------------------------------------------- Traceback (most recent call last):File "/usr/local/lib/python2.7/site-packages/mock.py", line 1201, in patched
return func(*args, **keywargs)File "/usr/ports/pobj/py-oauthlib-0.7.2/oauthlib-0.7.2/tests/oauth2/rfc6749/test_server.py", line 266, in test_client_grant
'', body=body)File "/usr/ports/pobj/py-oauthlib-0.7.2/oauthlib-0.7.2/oauthlib/oauth2/rfc6749/endpoints/base.py", line 64, in wrapper
return f(endpoint, uri, *args, **kwargs)File "/usr/ports/pobj/py-oauthlib-0.7.2/oauthlib-0.7.2/oauthlib/oauth2/rfc6749/endpoints/token.py", line 100, in create_token_response
request, self.default_token_type)File "/usr/ports/pobj/py-oauthlib-0.7.2/oauthlib-0.7.2/oauthlib/oauth2/rfc6749/grant_types/client_credentials.py", line 80, in create_token_response
token = token_handler.create_token(request, refresh_token=False)File "/usr/ports/pobj/py-oauthlib-0.7.2/oauthlib-0.7.2/oauthlib/oauth2/rfc6749/tokens.py", line 250, in create_token
'access_token': self.token_generator(request),File "/usr/ports/pobj/py-oauthlib-0.7.2/oauthlib-0.7.2/oauthlib/oauth2/rfc6749/tokens.py", line 211, in signed_token_generator
return common.generate_signed_token(private_pem, request)File "/usr/ports/pobj/py-oauthlib-0.7.2/oauthlib-0.7.2/oauthlib/common.py", line 246, in generate_signed_token
token = jwt.encode(claims, private_key, 'RS256')File "/usr/local/lib/python2.7/site-packages/jwt/api.py", line 122, in encode
raise NotImplementedError('Algorithm not supported') NotImplementedError: Algorithm not supported ======================================================================ERROR: test_password_grant (tests.oauth2.rfc6749.test_server.SignedTokenEndpointTest)
---------------------------------------------------------------------- Traceback (most recent call last):File "/usr/local/lib/python2.7/site-packages/mock.py", line 1201, in patched
return func(*args, **keywargs)File "/usr/ports/pobj/py-oauthlib-0.7.2/oauthlib-0.7.2/tests/oauth2/rfc6749/test_server.py", line 238, in test_password_grant
'', body=body)File "/usr/ports/pobj/py-oauthlib-0.7.2/oauthlib-0.7.2/oauthlib/oauth2/rfc6749/endpoints/base.py", line 64, in wrapper
return f(endpoint, uri, *args, **kwargs)File "/usr/ports/pobj/py-oauthlib-0.7.2/oauthlib-0.7.2/oauthlib/oauth2/rfc6749/endpoints/token.py", line 100, in create_token_response
request, self.default_token_type)File "/usr/ports/pobj/py-oauthlib-0.7.2/oauthlib-0.7.2/oauthlib/oauth2/rfc6749/grant_types/resource_owner_password_credentials.py", line 113, in create_token_response
token = token_handler.create_token(request, self.refresh_token)File "/usr/ports/pobj/py-oauthlib-0.7.2/oauthlib-0.7.2/oauthlib/oauth2/rfc6749/tokens.py", line 250, in create_token
'access_token': self.token_generator(request),File "/usr/ports/pobj/py-oauthlib-0.7.2/oauthlib-0.7.2/oauthlib/oauth2/rfc6749/tokens.py", line 211, in signed_token_generator
return common.generate_signed_token(private_pem, request)File "/usr/ports/pobj/py-oauthlib-0.7.2/oauthlib-0.7.2/oauthlib/common.py", line 246, in generate_signed_token
token = jwt.encode(claims, private_key, 'RS256')File "/usr/local/lib/python2.7/site-packages/jwt/api.py", line 122, in encode
raise NotImplementedError('Algorithm not supported') NotImplementedError: Algorithm not supported ======================================================================ERROR: test_scopes_and_user_id_stored_in_access_token (tests.oauth2.rfc6749.test_server.SignedTokenEndpointTest)
---------------------------------------------------------------------- Traceback (most recent call last):File "/usr/local/lib/python2.7/site-packages/mock.py", line 1201, in patched
return func(*args, **keywargs)File "/usr/ports/pobj/py-oauthlib-0.7.2/oauthlib-0.7.2/tests/oauth2/rfc6749/test_server.py", line 253, in test_scopes_and_user_id_stored_in_access_token
'', body=body)File "/usr/ports/pobj/py-oauthlib-0.7.2/oauthlib-0.7.2/oauthlib/oauth2/rfc6749/endpoints/base.py", line 64, in wrapper
return f(endpoint, uri, *args, **kwargs)File "/usr/ports/pobj/py-oauthlib-0.7.2/oauthlib-0.7.2/oauthlib/oauth2/rfc6749/endpoints/token.py", line 100, in create_token_response
request, self.default_token_type)File "/usr/ports/pobj/py-oauthlib-0.7.2/oauthlib-0.7.2/oauthlib/oauth2/rfc6749/grant_types/resource_owner_password_credentials.py", line 113, in create_token_response
token = token_handler.create_token(request, self.refresh_token)File "/usr/ports/pobj/py-oauthlib-0.7.2/oauthlib-0.7.2/oauthlib/oauth2/rfc6749/tokens.py", line 250, in create_token
'access_token': self.token_generator(request),File "/usr/ports/pobj/py-oauthlib-0.7.2/oauthlib-0.7.2/oauthlib/oauth2/rfc6749/tokens.py", line 211, in signed_token_generator
return common.generate_signed_token(private_pem, request)File "/usr/ports/pobj/py-oauthlib-0.7.2/oauthlib-0.7.2/oauthlib/common.py", line 246, in generate_signed_token
token = jwt.encode(claims, private_key, 'RS256')File "/usr/local/lib/python2.7/site-packages/jwt/api.py", line 122, in encode
raise NotImplementedError('Algorithm not supported') NotImplementedError: Algorithm not supported ---------------------------------------------------------------------- Ran 240 tests in 2.113s FAILED (errors=5) *** Error 1 in . (Makefile:31 'do-test')*** Error 1 in . (/usr/ports/infrastructure/mk/bsd.port.mk:2792 '/usr/ports/pobj/py-oauthlib-0.7.2/.test_done') *** Error 1 in /usr/ports/mystuff/security/py-oauthlib (/usr/ports/infrastructure/mk/bsd.port.mk:2485 'test')
It was pointed out that failures were in py-jwt and there was a comment in a newer release about fixing algorithms. So as there was a newer py-jwt release, figured might as well get it up to date. So update attached. However this still doesn't fix the above issue (the above output is with new py-jwt). I have a hunch that the failures might be related to it trying tests which might require py-cryptography (which we don't have, I took a quick stab at porting to see if that would fix it, but it got very messy very quick). And I'm not sure how to make it only test some things, or if I'm even right about this.
any clues? thanks, .jh
py-jwt.tgz
Description: GNU Zip compressed data
py-oauthlib.tgz
Description: GNU Zip compressed data