Skip to content

Commit

Permalink
Add kitchen sink sensitive test
Browse files Browse the repository at this point in the history
  • Loading branch information
alextwoods committed Jul 15, 2024
1 parent faca362 commit c63c643
Show file tree
Hide file tree
Showing 2 changed files with 246 additions and 0 deletions.
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
}
}
}
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

0 comments on commit c63c643

Please sign in to comment.