Skip to content

[IGNORE] Using this pull request to test any configuration changes to AppVeyor #174

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

Closed
wants to merge 27 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
a3d947d
bump attrs to 19.1.0
mattsb42-aws Jun 21, 2019
daaacba
add keyring trace and integrate into updated encrytion/decryption mat…
mattsb42-aws Jun 21, 2019
f254e73
s/KeyRing/Keyring/g
mattsb42-aws Jun 21, 2019
f9aa29d
align cryptographic materials and add write-only interface
mattsb42-aws Jun 27, 2019
01759b9
encrypted_data_keys must only contain EncryptedDataKey
mattsb42-aws Jun 27, 2019
e8e5b82
fix test to be Python 2 compatible
mattsb42-aws Jun 27, 2019
469600c
data encryption key must be set before encrypted data keys can be add…
mattsb42-aws Jun 28, 2019
a27ff74
add signing/verification key checks to Encryption/DecryptionMaterials
mattsb42-aws Jul 2, 2019
b311cda
DecryptionMaterials.algorithm must be set before DecryptionMaterials.…
mattsb42-aws Jul 2, 2019
10ded57
update materials docs and typehints
mattsb42-aws Jul 2, 2019
4f95e53
EncryptionMaterials must not be initialized with encrypted_data_keys …
mattsb42-aws Jul 3, 2019
7302775
add is_complete properties to EncryptionMaterials and DecryptionMater…
mattsb42-aws Jul 3, 2019
f1e7f2f
change KeyringTraceFlag values to bitshifted ints to match other impl…
mattsb42-aws Jul 9, 2019
524d847
normalize EncryptionMaterials._encrypted_data_keys to list and encryp…
mattsb42-aws Jul 9, 2019
d786409
temporarily pin pydocstyle at <4.0.0 to avoid issue breaking flake8-d…
mattsb42-aws Jul 9, 2019
888fc17
temporarily cap pydocstyle at <4.0.0 for decrypt oracle
mattsb42-aws Jul 10, 2019
54dfc23
Merge pull request #163 from mattsb42-aws/keyring-materials
mattsb42-aws Jul 11, 2019
1615d63
Keyring base API (#161)
MeghaShetty Jul 12, 2019
3b62bc3
Testing something, want AppVeyor to run
caitlin-tibbetts Jul 23, 2019
626d5ba
Quick change
caitlin-tibbetts Jul 23, 2019
83f4ff8
Running AppVeyor
caitlin-tibbetts Jul 23, 2019
0095989
Upgrading pip
caitlin-tibbetts Jul 23, 2019
cafd687
Merge branch 'master' into fix-appveyor
caitlin-tibbetts Jul 23, 2019
6c2aec6
Linting issue
caitlin-tibbetts Jul 23, 2019
ad587ea
Merge branch 'master' of github.com:aws/aws-encryption-sdk-python int…
caitlin-tibbetts Jul 23, 2019
193cc01
Merge conflicts
caitlin-tibbetts Jul 23, 2019
82c42cf
Merge branch 'fix-appveyor' of github.com:caitlin-tibbetts/aws-encryp…
caitlin-tibbetts Jul 23, 2019
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
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ install:
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
# Check the Python version to verify the correct version was installed
- "python --version"
- "python -m pip install --upgrade pip"
- "python -m pip install wheel tox"

build: off
Expand Down
2 changes: 1 addition & 1 deletion decrypt_oracle/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ basepython = python3
deps =
flake8
flake8-docstrings
pydocstyle<4.0.0
pydocstyle < 4.0.0
# https://github.com/JBKahn/flake8-print/pull/30
flake8-print>=3.1.0
commands =
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
boto3>=1.4.4
cryptography>=1.8.1
attrs>=17.4.0
attrs>=19.1.0
wrapt>=1.10.11
14 changes: 14 additions & 0 deletions src/aws_encryption_sdk/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ class InvalidDataKeyError(AWSEncryptionSDKClientError):
"""Exception class for Invalid Data Keys."""


class InvalidKeyringTraceError(AWSEncryptionSDKClientError):
"""Exception class for invalid Keyring Traces.

.. versionadded:: 1.5.0
"""


class InvalidProviderIdError(AWSEncryptionSDKClientError):
"""Exception class for Invalid Provider IDs."""

Expand All @@ -73,6 +80,13 @@ class DecryptKeyError(AWSEncryptionSDKClientError):
"""Exception class for errors encountered when MasterKeys try to decrypt data keys."""


class SignatureKeyError(AWSEncryptionSDKClientError):
"""Exception class for errors encountered with signing or verification keys.

.. versionadded:: 1.5.0
"""


class ActionNotAllowedError(AWSEncryptionSDKClientError):
"""Exception class for errors encountered when attempting to perform unallowed actions."""

Expand Down
10 changes: 10 additions & 0 deletions src/aws_encryption_sdk/identifiers.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,3 +328,13 @@ class ContentAADString(Enum):
FRAME_STRING_ID = b"AWSKMSEncryptionClient Frame"
FINAL_FRAME_STRING_ID = b"AWSKMSEncryptionClient Final Frame"
NON_FRAMED_STRING_ID = b"AWSKMSEncryptionClient Single Block"


class KeyringTraceFlag(Enum):
"""KeyRing Trace actions."""

WRAPPING_KEY_GENERATED_DATA_KEY = 1
WRAPPING_KEY_ENCRYPTED_DATA_KEY = 1 << 1
WRAPPING_KEY_DECRYPTED_DATA_KEY = 1 << 2
WRAPPING_KEY_SIGNED_ENC_CTX = 1 << 3
WRAPPING_KEY_VERIFIED_ENC_CTX = 1 << 4
54 changes: 54 additions & 0 deletions src/aws_encryption_sdk/keyring/base.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Copyright 2017 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.
"""Base class interface for Keyrings."""
from aws_encryption_sdk.materials_managers import DecryptionMaterials, EncryptionMaterials
from aws_encryption_sdk.structures import EncryptedDataKey

try: # Python 3.5.0 and 3.5.1 have incompatible typing modules
from typing import Iterable # noqa pylint: disable=unused-import
except ImportError: # pragma: no cover
# We only actually need these imports when running the mypy checks
pass


class Keyring(object):
"""Parent interface for Keyring classes.

.. versionadded:: 1.5.0
"""

def on_encrypt(self, encryption_materials):
# type: (EncryptionMaterials) -> EncryptionMaterials
"""Generate a data key if not present and encrypt it using any available wrapping key.

:param encryption_materials: Encryption materials for the keyring to modify.
:type encryption_materials: aws_encryption_sdk.materials_managers.EncryptionMaterials
:returns: Optionally modified encryption materials.
:rtype: aws_encryption_sdk.materials_managers.EncryptionMaterials
:raises NotImplementedError: if method is not implemented
"""
raise NotImplementedError("Keyring does not implement on_encrypt function")

def on_decrypt(self, decryption_materials, encrypted_data_keys):
# type: (DecryptionMaterials, Iterable[EncryptedDataKey]) -> DecryptionMaterials
"""Attempt to decrypt the encrypted data keys.

:param decryption_materials: Decryption materials for the keyring to modify.
:type decryption_materials: aws_encryption_sdk.materials_managers.DecryptionMaterials
:param encrypted_data_keys: List of encrypted data keys.
:type: Iterable of :class:`aws_encryption_sdk.structures.EncryptedDataKey`
:returns: Optionally modified decryption materials.
:rtype: aws_encryption_sdk.materials_managers.DecryptionMaterials
:raises NotImplementedError: if method is not implemented
"""
raise NotImplementedError("Keyring does not implement on_decrypt function")
Loading