Skip to content

Commit

Permalink
Macaroons are better than cookies!
Browse files Browse the repository at this point in the history
libmacaroons is an open source implementation of macaroons, the flexible
bearer tokens that work great in distributed systems.  Like cookies,
macaroons are bearer tokens that enable applications to ascertain
whether their holders' actions are authorized.  But macaroons are better
than cookies!  See the README for more information.
  • Loading branch information
rescrv committed May 16, 2014
0 parents commit ca1e875
Show file tree
Hide file tree
Showing 21 changed files with 4,200 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .gitignore
@@ -0,0 +1,29 @@
# wildcards
.deps
.dirstamp
*.la
.libs
*.lo
*.o
# specific files
/aclocal.m4
/autom4te.cache
/bindings/python/macaroons.c
/config.guess
/config.h
/config.h.in
/config.h.in~
/config.log
/config.status
/config.sub
/configure
/depcomp
/install-sh
/libmacaroons.pc
/libtool
/ltmain.sh
/m4
/Makefile
/Makefile.in
/missing
/stamp-h1
2 changes: 2 additions & 0 deletions .tarballignore
@@ -0,0 +1,2 @@
.gitignore
.tarballignore
25 changes: 25 additions & 0 deletions LICENSE
@@ -0,0 +1,25 @@
Copyright (c) 2014, Robert Escriva
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of this project nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
91 changes: 91 additions & 0 deletions Makefile.am
@@ -0,0 +1,91 @@
# Copyright (c) 2014, Robert Escriva
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of this project nor the names of its contributors may
# be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
AM_MAKEFLAGS = --no-print-directory
AM_CPPFLAGS =
AM_CFLAGS = -fvisibility=hidden $(WANAL_CFLAGS)
AM_CXXFLAGS = -fvisibility=hidden -fvisibility-inlines-hidden $(WANAL_CXXFLAGS)

AM_DISTCHECK_CONFIGURE_FLAGS = --enable-python-bindings --enable-json-support
TESTS_ENVIRONMENT = . $(abs_top_srcdir)/test/env.sh "${abs_top_srcdir}" "${abs_top_builddir}" "${VERSION}";

pyx_verbose = $(pyx_verbose_$(V))
pyx_verbose_ = $(pyx_verbose_$(AM_DEFAULT_VERBOSITY))
pyx_verbose_0 = @echo " PYX " $@;

EXTRA_DIST =
EXTRA_DIST += README
EXTRA_DIST += LICENSE

include_HEADERS = macaroons.h

noinst_HEADERS = base64.h constants.h packet.h port.h

lib_LTLIBRARIES = libmacaroons.la

libmacaroons_la_SOURCES = base64.c macaroons.c packet.c port.c
libmacaroons_la_LIBADD =
libmacaroons_la_LIBADD += $(SODIUM_LIBS)
if ENABLE_JSON_SUPPORT
libmacaroons_la_LIBADD += $(JSON_LIBS)
endif

##################################### Tests ####################################

EXTRA_DIST += test/env.sh
EXTRA_DIST += test/python-hmac-sanity-check
EXTRA_DIST += test/python-hmac-sanity-check.sh
EXTRA_DIST += test/readme.sh

TESTS =
TESTS += test/python-hmac-sanity-check.sh
TESTS += test/readme.sh

#################################### Python ####################################

pyexec_LTLIBRARIES =
if ENABLE_PYTHON_BINDINGS
pyexec_LTLIBRARIES += bindings/python/macaroons.la
endif

EXTRA_DIST += bindings/python/macaroons.pyx

bindings_python_macaroons_la_SOURCES = bindings/python/macaroons.c
bindings_python_macaroons_la_CPPFLAGS =
bindings_python_macaroons_la_CPPFLAGS += $(PYTHON_CPPFLAGS)
bindings_python_macaroons_la_CPPFLAGS += $(AM_CPPFLAGS)
bindings_python_macaroons_la_CPPFLAGS += $(CPPFLAGS)
bindings_python_macaroons_la_CFLAGS =
bindings_python_macaroons_la_CFLAGS += -fvisibility=default
bindings_python_macaroons_la_CFLAGS += -fno-strict-aliasing
bindings_python_macaroons_la_CFLAGS += $(CFLAGS)
bindings_python_macaroons_la_LIBADD =
bindings_python_macaroons_la_LIBADD += libmacaroons.la
bindings_python_macaroons_la_LIBADD += $(PYTHON_LDFLAGS)
bindings_python_macaroons_la_LDFLAGS = -module -avoid-version -export-symbols-regex initmacaroons $(AM_LDFLAGS) $(LDFLAGS)
bindings/python/macaroons.c: bindings/python/macaroons.pyx
$(pyx_verbose)cython bindings/python/macaroons.pyx

0 comments on commit ca1e875

Please sign in to comment.