|
| 1 | +[//]: # "Copyright Amazon.com Inc. or its affiliates. All Rights Reserved." |
| 2 | +[//]: # "SPDX-License-Identifier: CC-BY-SA-4.0" |
| 3 | + |
| 4 | +# Define Required Examples |
| 5 | + |
| 6 | +## Affected Specifications |
| 7 | + |
| 8 | +This serves as a reference of all specification documents that this change affects. |
| 9 | + |
| 10 | +| Specification | |
| 11 | +| ----------------------------------------------------- | |
| 12 | +| [examples](../../examples/examples.md) | |
| 13 | +| [examples readme](../../examples/templates/readme.md) | |
| 14 | + |
| 15 | +## Affected Implementations |
| 16 | + |
| 17 | +This serves as a reference for all implementations that this change affects. |
| 18 | + |
| 19 | +| Language | Repository | |
| 20 | +| ---------- | ------------------------------------------------------------------------------------- | |
| 21 | +| Python | [aws-encryption-sdk-python](https://github.com/aws/aws-encryption-sdk-python) | |
| 22 | +| Java | [aws-encryption-sdk-java](https://github.com/aws/aws-encryption-sdk-java) | |
| 23 | +| C | [aws-encryption-sdk-c](https://github.com/aws/aws-encryption-sdk-c) | |
| 24 | +| Javascript | [aws-encryption-sdk-javascript](https://github.com/aws/aws-encryption-sdk-javascript) | |
| 25 | + |
| 26 | +## Definitions |
| 27 | + |
| 28 | +### Conventions used in this document |
| 29 | + |
| 30 | +The key words |
| 31 | +"MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", |
| 32 | +"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" |
| 33 | +in this document are to be interpreted as described in |
| 34 | +[RFC 2119](https://tools.ietf.org/html/rfc2119). |
| 35 | + |
| 36 | +## Summary |
| 37 | + |
| 38 | +This document defines the examples that each implementation MUST include. |
| 39 | + |
| 40 | +## Out of Scope |
| 41 | + |
| 42 | +The specific implementations details for each example |
| 43 | +are out of scope for this document. |
| 44 | +The template document for each example contains those details. |
| 45 | + |
| 46 | +## Motivation |
| 47 | + |
| 48 | +The primary motivations for requiring examples include: |
| 49 | + |
| 50 | +- Providing guidance to AWS Encryption SDK customers. |
| 51 | +- Facilitating documentation and interoperability. |
| 52 | +- Encouraging AWS Encryption SDK developers |
| 53 | + to work backwards from the caller experience |
| 54 | + to verify that APIs and components |
| 55 | + provide the intended functionality, |
| 56 | + clarity, and ease of use. |
| 57 | +- Demonstrating that all implementations |
| 58 | + can be used to solve the same problems. |
| 59 | + |
| 60 | +## Drawbacks |
| 61 | + |
| 62 | +Requiring each implementation to include many examples |
| 63 | +increases the level of effort to create each implementation. |
| 64 | +We believe that the value to customers of |
| 65 | +improving the usability of APIs |
| 66 | +and providing guidance on how to use them |
| 67 | +justifies this cost. |
| 68 | + |
| 69 | +## Security Implications |
| 70 | + |
| 71 | +We MUST assume that any example will be used in production. |
| 72 | +Because of this, every example MUST only contain logic |
| 73 | +that is reasonable for production use |
| 74 | +unless explicitly identified otherwise. |
| 75 | + |
| 76 | +## Operational Implications |
| 77 | + |
| 78 | +Each implementation MUST include all examples |
| 79 | +in its continuous integration testing. |
| 80 | + |
| 81 | +## Guide-level Explanation |
| 82 | + |
| 83 | +Every implementation MUST include an example |
| 84 | +for each required use-case. |
| 85 | +These examples MUST be tested as part of |
| 86 | +the implementation's continuous integration testing. |
| 87 | + |
| 88 | +## Reference-level Explanation |
| 89 | + |
| 90 | +- Every example MUST be tested |
| 91 | + as part of the implementation's continuous integration testing. |
| 92 | +- Every example MUST be independent and complete. |
| 93 | +- Every example SHOULD follow a consistent layout and framing. |
| 94 | + |
| 95 | + - ex: Consistent function name and input parameters across examples. |
| 96 | + |
| 97 | +- Every example MUST only contain logic that is reasonable for production use. |
| 98 | +- If an example MUST contain logic that is not reasonable for production use, |
| 99 | + it MUST include clear comments that |
| 100 | + MUST identify that logic as not fit for production use, |
| 101 | + SHOULD explain why it is not fit for production use, |
| 102 | + and MUST instruct the reader what they SHOULD do instead. |
| 103 | + |
| 104 | + - ex: Raw keyring examples generate wrapping keys as part of the example. |
| 105 | + These examples MUST contain guidance that |
| 106 | + in production those keys SHOULD be managed by an HSM. |
0 commit comments