-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update rules engine authSchemes validation
This commit fixes several issues with validating authSchemes properties in defined endpoints within an endpoints rule set. It now properly enforces the typing and uniqueness of names of schemes defined within an authSchemes property. It also fixes several issues validating the presence and typing of properties configuring the sigv4, sigv4a, and "beta" schemes. A specification has been added to clearly detail how clients should choose schemes, detail what properties of the above schemes will be validated, and explain how to add new validators.
- Loading branch information
Showing
18 changed files
with
720 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
.. _rules-engine-aws-authscheme-validators: | ||
|
||
================================================= | ||
AWS rules engine authentication scheme validators | ||
================================================= | ||
|
||
AWS-specific rules engine library :ref:`authentication scheme validators <rules-engine-endpoint-rule-set-endpoint-authschemes>` | ||
make it possible to validate configurations for AWS authentication schemes like | ||
`AWS signature version 4`_. An additional dependency is required to access | ||
these validators | ||
|
||
The following example adds ``smithy-aws-endpoints`` as a Gradle dependency | ||
to a Smithy project: | ||
|
||
.. tab:: Gradle | ||
|
||
.. code-block:: kotlin | ||
dependencies { | ||
... | ||
implementation("software.amazon.smithy:smithy-aws-endpoints:__smithy_version__") | ||
... | ||
} | ||
.. tab:: smithy-build.json | ||
|
||
.. code-block:: json | ||
{ | ||
"maven": { | ||
"dependencies": [ | ||
"software.amazon.smithy:smithy-aws-endpoints:__smithy_version__" | ||
] | ||
} | ||
} | ||
.. _rules-engine-aws-authscheme-validator-sigv4: | ||
|
||
----------------------------------------- | ||
``sigv4`` authentication scheme validator | ||
----------------------------------------- | ||
|
||
Requirement | ||
The ``name`` property is the string value ``sigv4``. | ||
Properties | ||
.. list-table:: | ||
:header-rows: 1 | ||
:widths: 10 20 70 | ||
|
||
* - Property | ||
- Type | ||
- Description | ||
* - ``signingName`` | ||
- ``option<string>`` | ||
- The "service" value to use when creating a signing string for this | ||
endpoint. | ||
* - ``signingRegion`` | ||
- ``option<string>`` | ||
- The "region" value to use when creating a signing string for this | ||
endpoint. | ||
* - ``disableDoubleEncoding`` | ||
- ``option<boolean>`` | ||
- Default: ``false``. When ``true``, clients MUST NOT double-escape | ||
the path during signing. | ||
* - ``disableNormalizePath`` | ||
- ``option<boolean>`` | ||
- Default: ``false``. When ``true``, clients MUST NOT perform any | ||
path normalization during signing. | ||
|
||
|
||
.. _rules-engine-aws-authscheme-validator-sigv4a: | ||
|
||
------------------------------------------ | ||
``sigv4a`` authentication scheme validator | ||
------------------------------------------ | ||
|
||
Requirement | ||
The ``name`` property is the string value ``sigv4a``. | ||
Properties | ||
.. list-table:: | ||
:header-rows: 1 | ||
:widths: 10 20 70 | ||
|
||
* - Property | ||
- Type | ||
- Description | ||
* - ``signingName`` | ||
- ``option<string>`` | ||
- The "service" value to use when creating a signing string for this | ||
endpoint. | ||
* - ``signingRegionSet`` | ||
- ``array<string>`` | ||
- The set of signing regions to use when creating a signing string | ||
for this endpoint. | ||
* - ``disableDoubleEncoding`` | ||
- ``option<boolean>`` | ||
- Default: ``false``. When ``true``, clients MUST NOT double-escape | ||
the path during signing. | ||
* - ``disableNormalizePath`` | ||
- ``option<boolean>`` | ||
- Default: ``false``. When ``true``, clients MUST NOT perform any | ||
path normalization during signing. | ||
|
||
|
||
.. _AWS signature version 4: https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,4 @@ configuration options. | |
|
||
built-ins | ||
library-functions | ||
auth-schemes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...lesengine/aws/language/functions/errorfiles/invalid/beta-auth-scheme-missing-field.errors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[WARNING] example#FizzBuzz: This shape applies a trait that is unstable: smithy.rules#clientContextParams | UnstableTrait | ||
[WARNING] example#FizzBuzz: This shape applies a trait that is unstable: smithy.rules#endpointRuleSet | UnstableTrait | ||
[ERROR] example#FizzBuzz: Expected auth property `signingName` but didn't find one | RuleSetAuthSchemes | ||
[ERROR] example#FizzBuzz: Expected auth property `signingName` of a string type but didn't find one | RuleSetAuthSchemes |
9 changes: 9 additions & 0 deletions
9
...ine/aws/language/functions/errorfiles/invalid/signing-optional-properties-mistyped.errors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[WARNING] example#FizzBuzz: This shape applies a trait that is unstable: smithy.rules#endpointRuleSet | UnstableTrait | ||
[ERROR] example#FizzBuzz: Unexpected type for auth property `signingName`, found `1` but expected a string value | RuleSetAuthSchemes | ||
[ERROR] example#FizzBuzz: Unexpected type for auth property `signingRegion`, found `1` but expected a string value | RuleSetAuthSchemes | ||
[ERROR] example#FizzBuzz: Unexpected type for auth property `disableDoubleEncoding`, found `1` but expected a boolean value | RuleSetAuthSchemes | ||
[ERROR] example#FizzBuzz: Unexpected type for auth property `disableNormalizePath`, found `1` but expected a boolean value | RuleSetAuthSchemes | ||
[ERROR] example#FizzBuzz: Unexpected type for auth property `signingName`, found `1` but expected a string value | RuleSetAuthSchemes | ||
[ERROR] example#FizzBuzz: Unexpected type for auth property `signingRegionSet`, found `1` but expected an array<string> value | RuleSetAuthSchemes | ||
[ERROR] example#FizzBuzz: Unexpected type for auth property `disableDoubleEncoding`, found `1` but expected a boolean value | RuleSetAuthSchemes | ||
[ERROR] example#FizzBuzz: Unexpected type for auth property `disableNormalizePath`, found `1` but expected a boolean value | RuleSetAuthSchemes |
Oops, something went wrong.