[NEW] security/py-pymacaroons-pynacl: Macaroon library for Python
Macaroons, like cookies, are a form of bearer credential. Unlike opaque tokens, macaroons embed caveats that define specific authorization requirements for the target service, the service that issued the root macaroon and which is capable of verifying the integrity of macaroons it receives. WWW: https://github.com/matrix-org/pymacaroons PR: 205914 Submitted by: Brendan Molloy <brendan+freebsd@bbqsrc.net>
This commit is contained in:
parent
1703250777
commit
4dea0427d5
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=405526
5 changed files with 71 additions and 0 deletions
|
@ -853,6 +853,7 @@
|
|||
SUBDIR += py-pydeep
|
||||
SUBDIR += py-pyelliptic
|
||||
SUBDIR += py-pylibacl
|
||||
SUBDIR += py-pymacaroons-pynacl
|
||||
SUBDIR += py-pyme
|
||||
SUBDIR += py-pynacl
|
||||
SUBDIR += py-pyptlib
|
||||
|
|
32
security/py-pymacaroons-pynacl/Makefile
Normal file
32
security/py-pymacaroons-pynacl/Makefile
Normal file
|
@ -0,0 +1,32 @@
|
|||
# Created by: Brendan Molloy <brendan+freebsd@bbqsrc.net>
|
||||
# $FreeBSD$
|
||||
|
||||
PORTNAME= pymacaroons-pynacl
|
||||
PORTVERSION= 0.9.3
|
||||
DISTVERSIONPREFIX= v
|
||||
CATEGORIES= security devel python
|
||||
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
|
||||
|
||||
MAINTAINER= brendan+freebsd@bbqsrc.net
|
||||
COMMENT= Macaroon library for Python
|
||||
|
||||
LICENSE= MIT
|
||||
LICENSE_FILE= ${WRKSRC}/LICENSE
|
||||
|
||||
BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pynacl>=0.3.0:${PORTSDIR}/security/py-pynacl \
|
||||
${PYTHON_PKGNAMEPREFIX}six>=1.8.0:${PORTSDIR}/devel/py-six
|
||||
TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}hypothesis>0:${PORTSDIR}/devel/py-hypothesis \
|
||||
${PYTHON_PKGNAMEPREFIX}mock>0:${PORTSDIR}/devel/py-mock \
|
||||
${PYTHON_PKGNAMEPREFIX}nose>0:${PORTSDIR}/devel/py-nose
|
||||
|
||||
USES= python
|
||||
USE_GITHUB= yes
|
||||
USE_PYTHON= autoplist distutils
|
||||
|
||||
GH_ACCOUNT= matrix-org
|
||||
GH_PROJECT= pymacaroons
|
||||
|
||||
do-test:
|
||||
@(cd ${WRKSRC} && ${PYTHON_CMD} ${PYDISTUTILS_SETUP} nosetests)
|
||||
|
||||
.include <bsd.port.mk>
|
2
security/py-pymacaroons-pynacl/distinfo
Normal file
2
security/py-pymacaroons-pynacl/distinfo
Normal file
|
@ -0,0 +1,2 @@
|
|||
SHA256 (matrix-org-pymacaroons-v0.9.3_GH0.tar.gz) = 871399c4dc1dfab7a435df2d5f2954cbba51d275ca2e93a96abb8b35d348fe5a
|
||||
SIZE (matrix-org-pymacaroons-v0.9.3_GH0.tar.gz) = 20872
|
|
@ -0,0 +1,30 @@
|
|||
--- tests/functional_tests/functional_tests.py.orig 2016-01-04 04:05:59 UTC
|
||||
+++ tests/functional_tests/functional_tests.py
|
||||
@@ -3,6 +3,7 @@ import json
|
||||
|
||||
from mock import *
|
||||
from nose.tools import *
|
||||
+from unittest import skipUnless
|
||||
|
||||
import nacl.bindings
|
||||
|
||||
@@ -11,6 +12,11 @@ from pymacaroons.serializers import *
|
||||
from pymacaroons.exceptions import *
|
||||
from pymacaroons.utils import *
|
||||
|
||||
+# A test desires libnacl, but we don't need it.
|
||||
+try:
|
||||
+ import libnacl
|
||||
+except:
|
||||
+ pass
|
||||
|
||||
ZERO_NONCE = truncate_or_pad(
|
||||
b'\0', size=nacl.bindings.crypto_secretbox_NONCEBYTES)
|
||||
@@ -297,6 +303,7 @@ never use the same secret twice',
|
||||
)
|
||||
assert_true(verified)
|
||||
|
||||
+ @skipUnless('libnacl' in globals(), 'libnacl imported already')
|
||||
@patch('libnacl.secret.libnacl.utils.rand_nonce')
|
||||
def test_inspect(self, rand_nonce):
|
||||
# use a fixed nonce to ensure the same signature
|
6
security/py-pymacaroons-pynacl/pkg-descr
Normal file
6
security/py-pymacaroons-pynacl/pkg-descr
Normal file
|
@ -0,0 +1,6 @@
|
|||
Macaroons, like cookies, are a form of bearer credential. Unlike opaque tokens,
|
||||
macaroons embed caveats that define specific authorization requirements for the
|
||||
target service, the service that issued the root macaroon and which is capable
|
||||
of verifying the integrity of macaroons it receives.
|
||||
|
||||
WWW: https://github.com/matrix-org/pymacaroons
|
Loading…
Reference in a new issue