-
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
faca362
commit c63c643
Showing
2 changed files
with
246 additions
and
0 deletions.
There are no files selected for viewing
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": "sensitive_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 | ||
} | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
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,35 @@ | ||
# 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(:token) { 'token' } | ||
|
||
let(:token_provider) { Aws::StaticTokenProvider.new(token) } | ||
|
||
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 | ||
puts resp | ||
expect(resp.to_s).to eq( | ||
(<<-OUTPUT | ||
{: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]"} | ||
OUTPUT | ||
).strip | ||
) | ||
end | ||
end | ||
|
||
end | ||
end |