Skip to content
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

Expand sensitive applicability #212

Merged
merged 1 commit into from
Nov 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions docs/source/spec/core.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5135,9 +5135,9 @@ Summary
Indicates that the data stored in the shape or member is sensitive
and MUST be handled with care.
Trait selector
``:test(blob, string, member > :test(blob, string))``
``:not(:test(service, operation, resource))``

*Any blob or string; or a member that targets a blob/string*
*Any shape that is not a service, operation, or resource.*
Value type
Annotation trait

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ string resourceIdentifier
structure private {}

/// Indicates that the data stored in the shape or member is sensitive and MUST be handled with care.
@trait(selector: ":test(blob, string, member > :each(blob, string))")
@trait(selector: ":not(:test(service, operation, resource))")
structure sensitive {}

/// Defines the version or date in which a shape or member was added to the model.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[ERROR] ns.foo#Operation: Trait `sensitive` cannot be applied to `ns.foo#Operation`. This trait may only be applied to shapes that match the following selector: :not(:test(service, operation, resource)) | TraitTarget
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"smithy": "0.4.0",
"ns.foo": {
"shapes": {
"Operation": {
"type": "operation",
"smithy.api#sensitive": true
},
"Structure": {
"type": "structure",
"members": {
"a": {
"target": "String"
}
},
"smithy.api#sensitive": true
},
"Blob": {
"type": "blob",
"smithy.api#sensitive": true
},
"String": {
"type": "string"
},
"SensitiveString": {
"type": "string",
"smithy.api#sensitive": true
}
}
}
}