Skip to content

Introduction of core functionality and tests #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 29 commits into from
Mar 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
1d3c1bc
initial package setup
mattsb42-aws Mar 7, 2018
144fd6b
core identifiers, structures, and helpers
mattsb42-aws Mar 7, 2018
828086f
attribute serialization and deserialization
mattsb42-aws Mar 7, 2018
e25e397
material description serialization/deserialization
mattsb42-aws Mar 7, 2018
79d4f9f
core attribute encryption/decryption and item signing/verification logic
mattsb42-aws Mar 7, 2018
9962be2
core item encryption/decryption logic
mattsb42-aws Mar 7, 2018
ad56594
JCE bridge
mattsb42-aws Mar 7, 2018
f543902
JCE delegated key
mattsb42-aws Mar 7, 2018
00b1a96
raw cryptographic materials
mattsb42-aws Mar 7, 2018
9cbba7e
static cryptographic materials provider
mattsb42-aws Mar 7, 2018
57bdea2
wrapped cryptographic materials and provider
mattsb42-aws Mar 7, 2018
8a33daa
AWS KMS cryptographic materials provider
mattsb42-aws Mar 7, 2018
5967b76
cross compatibility test vectors and acceptance tests
mattsb42-aws Mar 7, 2018
3ded972
initial draft of MyPy types describing DynamoDB items/attributes
mattsb42-aws Mar 7, 2018
db761c1
removing unused requirements and moving typing requirement to mypy to…
mattsb42-aws Mar 7, 2018
6970860
moving typing imports out of the required import path
mattsb42-aws Mar 9, 2018
1c8d86e
Python 2 requires both lt and gt to be defined for full equality chec…
mattsb42-aws Mar 9, 2018
33074a1
converting JCE bridge structures from registered enums to static refe…
mattsb42-aws Mar 9, 2018
ba36159
adding deep validators for AwsKmsCryptographicMaterialsProvider
mattsb42-aws Mar 19, 2018
c2c1084
consolidating encryption/mac key generation in AwsKmsCryptographicMat…
mattsb42-aws Mar 19, 2018
73fc257
adding moto test dependency
mattsb42-aws Mar 19, 2018
ce7808a
add better error handling if invalid JCE transformations or unknown p…
mattsb42-aws Mar 21, 2018
70e9d2c
add comments explaining Java padding behavior and names
mattsb42-aws Mar 21, 2018
f347154
add attribute name to delegated key encrypt/decrypt and item encrypti…
mattsb42-aws Mar 21, 2018
42f5c22
explicitely require that the reserved null byte in the tag is null
mattsb42-aws Mar 21, 2018
e6ec425
correctly fully ignore items when no action will be taken on any attr…
mattsb42-aws Mar 22, 2018
10c546b
do not allow non-string values in KMS encryption context
mattsb42-aws Mar 22, 2018
8f46cee
isolate KeyError catch to only lookup of algorithm name
mattsb42-aws Mar 22, 2018
e9cb3e8
properly handle AESWrap as an algorithm name and Cipher name
mattsb42-aws Mar 23, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
*.egg-info
*.pyc
*.pyo
*~
.DS_Store
.tox
/.cache*
/.coverage*
/build
/doc/generated/*
/runpy
__pycache__
build
dist
docs/build
.python-version
.mypy_cache
.hypothesis
.pytest_cache
Empty file added CHANGELOG.rst
Empty file.
Empty file added MANIFEST.in
Empty file.
2 changes: 0 additions & 2 deletions README.md

This file was deleted.

Empty file added README.rst
Empty file.
70 changes: 70 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# pylint: disable=invalid-name
"""Sphinx configuration."""
from datetime import datetime
import io
import os
import re

VERSION_RE = re.compile(r'''__version__ = ['"]([0-9.]+)['"]''')
HERE = os.path.abspath(os.path.dirname(__file__))


def read(*args):
"""Reads complete file contents."""
return io.open(os.path.join(HERE, *args), encoding='utf-8').read()


def get_release():
"""Reads the release (full three-part version number) from this module."""
init = read('..', 'src', 'dynamodb_encryption_sdk', 'identifiers.py')
return VERSION_RE.search(init).group(1)


def get_version():
"""Reads the version (MAJOR.MINOR) from this module."""
_release = get_release()
split_version = _release.split('.')
if len(split_version) == 3:
return '.'.join(split_version[:2])
return _release


project = u'dynamodb-encryption-sdk-python'
version = get_version()
release = get_release()

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest',
'sphinx.ext.intersphinx', 'sphinx.ext.todo',
'sphinx.ext.coverage', 'sphinx.ext.autosummary',
'sphinx.ext.napoleon']
napoleon_include_special_with_doc = False

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

source_suffix = '.rst' # The suffix of source filenames.
master_doc = 'index' # The master toctree document.

copyright = u'%s, Amazon' % datetime.now().year # pylint: disable=redefined-builtin

# List of directories, relative to source directory, that shouldn't be searched
# for source files.
exclude_trees = ['_build']

pygments_style = 'sphinx'

autoclass_content = "both"
autodoc_default_flags = ['show-inheritance', 'members']
autodoc_member_order = 'bysource'

html_theme = 'sphinx_rtd_theme'
html_static_path = ['_static']
htmlhelp_basename = '%sdoc' % project

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'http://docs.python.org/': None}

# autosummary
autosummary_generate = True
49 changes: 49 additions & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
.. include:: ../README.rst

*******
Modules
*******

.. autosummary::
:toctree: generated

.. Add/replace module names you want documented here
dynamodb_encryption_sdk
dynamodb_encryption_sdk.exceptions
dynamodb_encryption_sdk.identifiers
dynamodb_encryption_sdk.structures
dynamodb_encryption_sdk.encrypted
dynamodb_encryption_sdk.encrypted.client
dynamodb_encryption_sdk.encrypted.item
dynamodb_encryption_sdk.encrypted.resource
dynamodb_encryption_sdk.encrypted.table
dynamodb_encryption_sdk.material_providers
dynamodb_encryption_sdk.material_providers.aws_kms
dynamodb_encryption_sdk.material_providers.static
dynamodb_encryption_sdk.material_providers.wrapped
dynamodb_encryption_sdk.material_providers.store
dynamodb_encryption_sdk.materials
dynamodb_encryption_sdk.materials.raw
dynamodb_encryption_sdk.materials.wrapped
dynamodb_encryption_sdk.internal
dynamodb_encryption_sdk.internal.defaults
dynamodb_encryption_sdk.internal.dynamodb_types
dynamodb_encryption_sdk.internal.identifiers
dynamodb_encryption_sdk.internal.str_ops
dynamodb_encryption_sdk.internal.utils
dynamodb_encryption_sdk.internal.crypto
dynamodb_encryption_sdk.internal.crypto.jce_bridge
dynamodb_encryption_sdk.internal.crypto.jce_bridge.authentication
dynamodb_encryption_sdk.internal.crypto.jce_bridge.encryption
dynamodb_encryption_sdk.internal.crypto.jce_bridge.primitives
dynamodb_encryption_sdk.internal.crypto.authentication
dynamodb_encryption_sdk.internal.crypto.encryption
dynamodb_encryption_sdk.internal.formatting
dynamodb_encryption_sdk.internal.formatting.deserialize
dynamodb_encryption_sdk.internal.formatting.deserialize.attribute
dynamodb_encryption_sdk.internal.formatting.serialize
dynamodb_encryption_sdk.internal.formatting.serialize.attribute
dynamodb_encryption_sdk.internal.formatting.material_description
dynamodb_encryption_sdk.internal.formatting.transform

.. include:: ../CHANGELOG.rst
2 changes: 2 additions & 0 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sphinx>=1.3.0
sphinx_rtd_theme
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
boto3>=1.4.4
cryptography>=1.8.1
attrs>=17.4.0
45 changes: 45 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[wheel]
universal = 1

[metadata]
license_file = LICENSE

[coverage:run]
branch = True

[coverage:report]
show_missing = True

[mypy]
ignore_missing_imports = True

[tool:pytest]
markers =
local: superset of unit and functional (does not require network access)
unit: mark test as a unit test (does not require network access)
functional: mark test as a functional test (does not require network access)
integ: mark a test as an integration test (requires network access)
slow: mark a test as being known to take a long time to complete (order 5s < t < 60s)
veryslow: mark a test as being known to take a very long time to complete (order t > 60s)
nope: mark a test as being so slow that it should only be very infrequently (order t > 30m)
log_level=NOTSET

# Flake8 Configuration
[flake8]
max_complexity = 10
max_line_length = 120
import_order_style = google
application_import_names = dynamodb_encryption_sdk
builtins = raw_input
ignore =
# Ignoring D205 and D400 because of false positives
D205, D400,
# Ignoring D401 pending discussion of imperative mood
D401,
# Ignoring D202 (no blank lines after function docstring) because mypy confuses flake8
D202


# Doc8 Configuration
[doc8]
max-line-length = 120
64 changes: 64 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
"""DynamoDB Encryption SDK."""
import io
import os
import re

from setuptools import find_packages, setup

VERSION_RE = re.compile(r'''__version__ = ['"]([0-9.]+)['"]''')
HERE = os.path.abspath(os.path.dirname(__file__))


def read(*args):
"""Reads complete file contents."""
return io.open(os.path.join(HERE, *args), encoding='utf-8').read()


def get_version():
"""Reads the version from this module."""
init = read('src', 'dynamodb_encryption_sdk', 'identifiers.py')
return VERSION_RE.search(init).group(1)


def get_requirements():
"""Reads the requirements file."""
requirements = read('requirements.txt')
return [r for r in requirements.strip().splitlines()]


setup(
name='dynamodb-encryption-sdk',
version=get_version(),
packages=find_packages('src'),
package_dir={'': 'src'},
url='http://dynamodb-encryption-sdk.readthedocs.io/en/latest/',
author='Amazon Web Services',
author_email='[email protected]',
maintainer='Amazon Web Services',
long_description=read('README.rst'),
keywords='aws-encryption-sdk aws kms encryption dynamodb',
data_files=[
'README.rst',
'CHANGELOG.rst',
'LICENSE',
'requirements.txt'
],
license='Apache License 2.0',
install_requires=get_requirements(),
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Natural Language :: English',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: Security',
'Topic :: Security :: Cryptography'
]
)
34 changes: 34 additions & 0 deletions src/dynamodb_encryption_sdk/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
""""""
from dynamodb_encryption_sdk.encrypted.item import (
decrypt_dynamodb_item, decrypt_python_item,
encrypt_dynamodb_item, encrypt_python_item
)

# encrypt_item
# encrypt_raw_item
# decrypt_item
# decrypt_raw_item
# EncryptedTable
# EncryptedResource
# EncryptedClient

# TableConfiguration
# MaterialDescription
# ItemConfiguration

__all__ = (
'decrypt_dynamodb_item', 'decrypt_python_item',
'encrypt_dynamodb_item', 'encrypt_python_item'
)
Loading