Skip to content

Commit

Permalink
Use pypitoken to generate, check, introspect tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
ewjoachim committed Mar 23, 2021
1 parent 7fc3ce5 commit ddb366b
Show file tree
Hide file tree
Showing 17 changed files with 249 additions and 457 deletions.
2 changes: 1 addition & 1 deletion requirements/main.in
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ psycopg2
pycurl
pyqrcode
pyramid>=1.9,<1.11.0
pymacaroons
pypitoken
pyramid_jinja2>=2.5
pyramid_mailer>=0.14.1
pyramid_multiauth
Expand Down
19 changes: 17 additions & 2 deletions requirements/main.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ argon2-cffi==20.1.0 \
attrs==20.3.0 \
--hash=sha256:31b2eced602aa8423c2aea9c76a724617ed67cf9513173fd3a4f03e3a929c7e6 \
--hash=sha256:832aa3cde19744e49938b91fea06d69ecb9e649c93ba974535d08ad92164f700
# via automat
# via
# automat
# jsonschema
automat==20.2.0 \
--hash=sha256:7979803c74610e11ef0c0d68a2942b152df52da55336e0c9d58daf1831cbdf33 \
--hash=sha256:b6feb6455337df834f6c9962d6ccf771515b7d939bca142b29c20c2376bc6111
Expand Down Expand Up @@ -454,6 +456,10 @@ jmespath==0.10.0 \
# via
# boto3
# botocore
jsonschema==3.2.0 \
--hash=sha256:4e5b3cf8216f577bee9ce139cbe72eca3ea4f292ec60928ff24758ce626cd163 \
--hash=sha256:c8a85b28d377cc7737e46e2d9f2b4f44ee3c0e1deac6bf46ddefc7187d30797a
# via pypitoken
kombu==4.6.11 \
--hash=sha256:be48cdffb54a2194d93ad6533d73f69408486483d189fe9f5990ee24255b0e0a \
--hash=sha256:ca1b45faac8c0b18493d02a8571792f3c40291cf2bcf1f55afed3d8f3aa7ba74
Expand Down Expand Up @@ -708,7 +714,7 @@ pygments==2.8.1 \
pymacaroons==0.13.0 \
--hash=sha256:1e6bba42a5f66c245adf38a5a4006a99dcc06a0703786ea636098667d42903b8 \
--hash=sha256:3e14dff6a262fdbf1a15e769ce635a8aea72e6f8f91e408f9a97166c53b91907
# via -r requirements/main.in
# via pypitoken
pynacl==1.4.0 \
--hash=sha256:06cbb4d9b2c4bd3c8dc0d267416aaed79906e7b33f114ddbf0911969794b1cc4 \
--hash=sha256:11335f09060af52c97137d4ac54285bcb7df0cef29014a1a4efe64ac065434c4 \
Expand Down Expand Up @@ -737,6 +743,10 @@ pyparsing==2.4.7 \
--hash=sha256:c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1 \
--hash=sha256:ef9d7589ef3c200abe66653d3f1ab1033c3c419ae9b9bdb1240a85b024efc88b
# via packaging
pypitoken==3.0.2 \
--hash=sha256:1e92cb2e56965ffc18223aeb96bd3501755921512e290db6d947a7fb65afb021 \
--hash=sha256:d8c560978b1fc2132dc9d2c7454cc3acedb92c2af7eaed789292417fdf73a588
# via -r requirements/main.in
pyqrcode==1.2.1 \
--hash=sha256:1b2812775fa6ff5c527977c4cd2ccb07051ca7d0bc0aecf937a43864abe5eff6 \
--hash=sha256:fdbf7634733e56b72e27f9bce46e4550b75a3a2c420414035cae9d9d26b234d5
Expand Down Expand Up @@ -781,6 +791,9 @@ pyramid==1.10.5 \
# pyramid-rpc
# pyramid-services
# pyramid-tm
pyrsistent==0.17.3 \
--hash=sha256:2e636185d9eb976a18a8a8e96efce62f2905fea90041958d8cc2a189756ebf3e
# via jsonschema
python-dateutil==2.8.1 \
--hash=sha256:73ebfe9dbf22e832286dafa60473e4cd239f8592f699aa5adaf10050e6e1823c \
--hash=sha256:75bb3f31ea686f1197762692a9ee6a7550b59fc6ca3a1f4b5d7e32fb98e2da2a
Expand Down Expand Up @@ -862,6 +875,7 @@ six==1.15.0 \
# google-resumable-media
# grpcio
# html5lib
# jsonschema
# limits
# protobuf
# pymacaroons
Expand Down Expand Up @@ -1080,6 +1094,7 @@ setuptools==54.1.2 \
# -r requirements/main.in
# google-api-core
# google-auth
# jsonschema
# pastedeploy
# plaster
# pyramid
Expand Down
4 changes: 4 additions & 0 deletions tests/functional/manage/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
from webob.multidict import MultiDict

from warehouse.accounts.interfaces import IPasswordBreachedService, IUserService
from warehouse.macaroons.interfaces import IMacaroonService
from warehouse.macaroons.services import database_macaroon_factory
from warehouse.manage import views

from ...common.db.accounts import EmailFactory, UserFactory
Expand All @@ -27,6 +29,8 @@ def test_save_account(self, pyramid_services, user_service, db_request):
pyramid_services.register_service(
breach_service, IPasswordBreachedService, None
)
macaroon_service = database_macaroon_factory(context={}, request=db_request)
pyramid_services.register_service(macaroon_service, IMacaroonService, None)
user = UserFactory.create(name="old name")
EmailFactory.create(primary=True, verified=True, public=True, user=user)
db_request.user = user
Expand Down
125 changes: 0 additions & 125 deletions tests/unit/macaroons/test_caveats.py

This file was deleted.

20 changes: 0 additions & 20 deletions tests/unit/macaroons/test_models.py

This file was deleted.

Loading

0 comments on commit ddb366b

Please sign in to comment.