-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
730798d
commit 0c33950
Showing
6 changed files
with
290 additions
and
3 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
211 changes: 211 additions & 0 deletions
211
build_tools/aws-sdk-code-generator/spec/fixtures/interfaces/sensitive/api.json
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,211 @@ | ||
{ | ||
"metadata": { | ||
"endpointPrefix": "svc", | ||
"serviceId": "sample_svc", | ||
"protocol": "rest-json" | ||
}, | ||
"operations":{ | ||
"KitchenSinkOperation": { | ||
"name":"KitchenSinkOperation", | ||
"http":{ | ||
"method":"POST", | ||
"requestUri":"/KitchenSinkOperation" | ||
}, | ||
"input":{"shape":"KitchenSink"}, | ||
"output":{"shape":"KitchenSink"} | ||
} | ||
}, | ||
"shapes": { | ||
"KitchenSink": { | ||
"type": "structure", | ||
"members": { | ||
"Blob": { | ||
"shape": "Blob" | ||
}, | ||
"Boolean": { | ||
"shape": "Boolean" | ||
}, | ||
"Double": { | ||
"shape": "Double" | ||
}, | ||
"EmptyStruct": { | ||
"shape": "EmptyStruct" | ||
}, | ||
"Float": { | ||
"shape": "Float" | ||
}, | ||
"Integer": { | ||
"shape": "Integer" | ||
}, | ||
"JsonValue": { | ||
"shape": "JsonValue", | ||
"jsonvalue": true | ||
}, | ||
"ListOfStrings": { | ||
"shape": "ListOfStrings" | ||
}, | ||
"ListOfStructs": { | ||
"shape": "ListOfStructs" | ||
}, | ||
"Long": { | ||
"shape": "Long" | ||
}, | ||
"MapOfListsOfStrings": { | ||
"shape": "MapOfListsOfStrings" | ||
}, | ||
"MapOfMaps": { | ||
"shape": "MapOfMapOfStrings" | ||
}, | ||
"MapOfStrings": { | ||
"shape": "MapOfStrings" | ||
}, | ||
"MapOfStructs": { | ||
"shape": "MapOfStructs" | ||
}, | ||
"SimpleStruct": { | ||
"shape": "SimpleStruct" | ||
}, | ||
"String": { | ||
"shape": "String" | ||
}, | ||
"StructWithJsonName": { | ||
"shape": "StructWithJsonName" | ||
}, | ||
"Timestamp": { | ||
"shape": "Timestamp" | ||
} | ||
} | ||
}, | ||
"Blob": { | ||
"type": "blob", | ||
"sensitive": true | ||
}, | ||
"Boolean": { | ||
"type": "boolean", | ||
"box": true, | ||
"sensitive": true | ||
}, | ||
"Double": { | ||
"type": "double", | ||
"box": true, | ||
"sensitive": true | ||
}, | ||
"EmptyStruct": { | ||
"type": "structure", | ||
"members": {} | ||
}, | ||
"Float": { | ||
"type": "float", | ||
"box": true, | ||
"sensitive": true | ||
}, | ||
"Integer": { | ||
"type": "integer", | ||
"box": true, | ||
"sensitive": true | ||
}, | ||
"JsonValue": { | ||
"type": "string", | ||
"sensitive": true | ||
}, | ||
"ListOfListOfStrings": { | ||
"type": "list", | ||
"member": { | ||
"shape": "ListOfStrings" | ||
} | ||
}, | ||
"ListOfStrings": { | ||
"type": "list", | ||
"member": { | ||
"shape": "String" | ||
} | ||
}, | ||
"ListOfStructs": { | ||
"type": "list", | ||
"member": { | ||
"shape": "SimpleStruct" | ||
} | ||
}, | ||
"Long": { | ||
"type": "long", | ||
"box": true, | ||
"sensitive": true | ||
}, | ||
"MapOfListsOfStrings": { | ||
"type": "map", | ||
"key": { | ||
"shape": "String" | ||
}, | ||
"value": { | ||
"shape": "ListOfStrings" | ||
} | ||
}, | ||
"MapOfMapOfStrings": { | ||
"type": "map", | ||
"key": { | ||
"shape": "String" | ||
}, | ||
"value": { | ||
"shape": "MapOfStrings" | ||
} | ||
}, | ||
"MapOfStrings": { | ||
"type": "map", | ||
"key": { | ||
"shape": "String" | ||
}, | ||
"value": { | ||
"shape": "String" | ||
} | ||
}, | ||
"MapOfStructs": { | ||
"type": "map", | ||
"key": { | ||
"shape": "String" | ||
}, | ||
"value": { | ||
"shape": "SimpleStruct" | ||
} | ||
}, | ||
"ListOfKitchenSinks": { | ||
"type": "list", | ||
"member": { | ||
"shape": "KitchenSink" | ||
} | ||
}, | ||
"MapOfKitchenSinks": { | ||
"type": "map", | ||
"key": { | ||
"shape": "String" | ||
}, | ||
"value": { | ||
"shape": "KitchenSink" | ||
} | ||
}, | ||
"SimpleStruct": { | ||
"type": "structure", | ||
"members": { | ||
"Value": { | ||
"shape": "String" | ||
} | ||
}, | ||
"sensitive": true | ||
}, | ||
"String": { | ||
"type": "string", | ||
"sensitive": true | ||
}, | ||
"StructWithJsonName": { | ||
"type": "structure", | ||
"members": { | ||
"Value": { | ||
"shape": "String" | ||
} | ||
} | ||
}, | ||
"Timestamp": { | ||
"type": "timestamp", | ||
"sensitive": true | ||
} | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
build_tools/aws-sdk-code-generator/spec/interfaces/sensitive_spec.rb
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,45 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative '../spec_helper' | ||
|
||
describe 'Types Interface:' do | ||
describe 'Sensitive members' do | ||
before(:all) do | ||
SpecHelper.generate_service(['Sensitive'], multiple_files: false) | ||
end | ||
|
||
let(:client) do | ||
Sensitive::Client.new( | ||
stub_responses: true, | ||
) | ||
end | ||
|
||
describe '#kitchen_sink' do | ||
it 'filters all sensitive members' do | ||
resp = client.kitchen_sink_operation | ||
expected = { | ||
blob: '[FILTERED]', | ||
boolean: '[FILTERED]', | ||
double: '[FILTERED]', | ||
empty_struct: {}, | ||
float: '[FILTERED]', | ||
integer: '[FILTERED]', | ||
json_value: '[FILTERED]', | ||
list_of_strings: '[FILTERED]', | ||
list_of_structs: '[FILTERED]', | ||
long: '[FILTERED]', | ||
map_of_lists_of_strings: '[FILTERED]', | ||
map_of_maps: '[FILTERED]', | ||
map_of_strings: '[FILTERED]', | ||
map_of_structs: '[FILTERED]', | ||
simple_struct: '[FILTERED]', | ||
string: '[FILTERED]', | ||
struct_with_json_name: { value: '[FILTERED]' }, | ||
timestamp: '[FILTERED]' | ||
} | ||
|
||
expect(resp.to_s).to eq(expected.to_s) | ||
end | ||
end | ||
end | ||
end |
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