Skip to content

Commit

Permalink
Expand sensitive applicability
Browse files Browse the repository at this point in the history
Allow anything but operations, services, and resources to have the
sensitive trait.
  • Loading branch information
JordonPhillips committed Nov 25, 2019
1 parent 80543b3 commit c2ec0a5
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 3 deletions.
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
}
}
}
}

0 comments on commit c2ec0a5

Please sign in to comment.