aws-sdk-kms 1.3.0 → 1.88.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,176 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+
11
+ module Aws::KMS
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::KMS::EndpointProvider',
17
+ rbs_type: 'untyped',
18
+ docstring: 'The endpoint provider used to resolve endpoints. Any '\
19
+ 'object that responds to `#resolve_endpoint(parameters)` '\
20
+ 'where `parameters` is a Struct similar to '\
21
+ '`Aws::KMS::EndpointParameters`'
22
+ ) do |cfg|
23
+ Aws::KMS::EndpointProvider.new
24
+ end
25
+
26
+ # @api private
27
+ class Handler < Seahorse::Client::Handler
28
+ def call(context)
29
+ unless context[:discovered_endpoint]
30
+ params = parameters_for_operation(context)
31
+ endpoint = context.config.endpoint_provider.resolve_endpoint(params)
32
+
33
+ context.http_request.endpoint = endpoint.url
34
+ apply_endpoint_headers(context, endpoint.headers)
35
+
36
+ context[:endpoint_params] = params
37
+ context[:endpoint_properties] = endpoint.properties
38
+ end
39
+
40
+ context[:auth_scheme] =
41
+ Aws::Endpoints.resolve_auth_scheme(context, endpoint)
42
+
43
+ @handler.call(context)
44
+ end
45
+
46
+ private
47
+
48
+ def apply_endpoint_headers(context, headers)
49
+ headers.each do |key, values|
50
+ value = values
51
+ .compact
52
+ .map { |s| Seahorse::Util.escape_header_list_string(s.to_s) }
53
+ .join(',')
54
+
55
+ context.http_request.headers[key] = value
56
+ end
57
+ end
58
+
59
+ def parameters_for_operation(context)
60
+ case context.operation_name
61
+ when :cancel_key_deletion
62
+ Aws::KMS::Endpoints::CancelKeyDeletion.build(context)
63
+ when :connect_custom_key_store
64
+ Aws::KMS::Endpoints::ConnectCustomKeyStore.build(context)
65
+ when :create_alias
66
+ Aws::KMS::Endpoints::CreateAlias.build(context)
67
+ when :create_custom_key_store
68
+ Aws::KMS::Endpoints::CreateCustomKeyStore.build(context)
69
+ when :create_grant
70
+ Aws::KMS::Endpoints::CreateGrant.build(context)
71
+ when :create_key
72
+ Aws::KMS::Endpoints::CreateKey.build(context)
73
+ when :decrypt
74
+ Aws::KMS::Endpoints::Decrypt.build(context)
75
+ when :delete_alias
76
+ Aws::KMS::Endpoints::DeleteAlias.build(context)
77
+ when :delete_custom_key_store
78
+ Aws::KMS::Endpoints::DeleteCustomKeyStore.build(context)
79
+ when :delete_imported_key_material
80
+ Aws::KMS::Endpoints::DeleteImportedKeyMaterial.build(context)
81
+ when :derive_shared_secret
82
+ Aws::KMS::Endpoints::DeriveSharedSecret.build(context)
83
+ when :describe_custom_key_stores
84
+ Aws::KMS::Endpoints::DescribeCustomKeyStores.build(context)
85
+ when :describe_key
86
+ Aws::KMS::Endpoints::DescribeKey.build(context)
87
+ when :disable_key
88
+ Aws::KMS::Endpoints::DisableKey.build(context)
89
+ when :disable_key_rotation
90
+ Aws::KMS::Endpoints::DisableKeyRotation.build(context)
91
+ when :disconnect_custom_key_store
92
+ Aws::KMS::Endpoints::DisconnectCustomKeyStore.build(context)
93
+ when :enable_key
94
+ Aws::KMS::Endpoints::EnableKey.build(context)
95
+ when :enable_key_rotation
96
+ Aws::KMS::Endpoints::EnableKeyRotation.build(context)
97
+ when :encrypt
98
+ Aws::KMS::Endpoints::Encrypt.build(context)
99
+ when :generate_data_key
100
+ Aws::KMS::Endpoints::GenerateDataKey.build(context)
101
+ when :generate_data_key_pair
102
+ Aws::KMS::Endpoints::GenerateDataKeyPair.build(context)
103
+ when :generate_data_key_pair_without_plaintext
104
+ Aws::KMS::Endpoints::GenerateDataKeyPairWithoutPlaintext.build(context)
105
+ when :generate_data_key_without_plaintext
106
+ Aws::KMS::Endpoints::GenerateDataKeyWithoutPlaintext.build(context)
107
+ when :generate_mac
108
+ Aws::KMS::Endpoints::GenerateMac.build(context)
109
+ when :generate_random
110
+ Aws::KMS::Endpoints::GenerateRandom.build(context)
111
+ when :get_key_policy
112
+ Aws::KMS::Endpoints::GetKeyPolicy.build(context)
113
+ when :get_key_rotation_status
114
+ Aws::KMS::Endpoints::GetKeyRotationStatus.build(context)
115
+ when :get_parameters_for_import
116
+ Aws::KMS::Endpoints::GetParametersForImport.build(context)
117
+ when :get_public_key
118
+ Aws::KMS::Endpoints::GetPublicKey.build(context)
119
+ when :import_key_material
120
+ Aws::KMS::Endpoints::ImportKeyMaterial.build(context)
121
+ when :list_aliases
122
+ Aws::KMS::Endpoints::ListAliases.build(context)
123
+ when :list_grants
124
+ Aws::KMS::Endpoints::ListGrants.build(context)
125
+ when :list_key_policies
126
+ Aws::KMS::Endpoints::ListKeyPolicies.build(context)
127
+ when :list_key_rotations
128
+ Aws::KMS::Endpoints::ListKeyRotations.build(context)
129
+ when :list_keys
130
+ Aws::KMS::Endpoints::ListKeys.build(context)
131
+ when :list_resource_tags
132
+ Aws::KMS::Endpoints::ListResourceTags.build(context)
133
+ when :list_retirable_grants
134
+ Aws::KMS::Endpoints::ListRetirableGrants.build(context)
135
+ when :put_key_policy
136
+ Aws::KMS::Endpoints::PutKeyPolicy.build(context)
137
+ when :re_encrypt
138
+ Aws::KMS::Endpoints::ReEncrypt.build(context)
139
+ when :replicate_key
140
+ Aws::KMS::Endpoints::ReplicateKey.build(context)
141
+ when :retire_grant
142
+ Aws::KMS::Endpoints::RetireGrant.build(context)
143
+ when :revoke_grant
144
+ Aws::KMS::Endpoints::RevokeGrant.build(context)
145
+ when :rotate_key_on_demand
146
+ Aws::KMS::Endpoints::RotateKeyOnDemand.build(context)
147
+ when :schedule_key_deletion
148
+ Aws::KMS::Endpoints::ScheduleKeyDeletion.build(context)
149
+ when :sign
150
+ Aws::KMS::Endpoints::Sign.build(context)
151
+ when :tag_resource
152
+ Aws::KMS::Endpoints::TagResource.build(context)
153
+ when :untag_resource
154
+ Aws::KMS::Endpoints::UntagResource.build(context)
155
+ when :update_alias
156
+ Aws::KMS::Endpoints::UpdateAlias.build(context)
157
+ when :update_custom_key_store
158
+ Aws::KMS::Endpoints::UpdateCustomKeyStore.build(context)
159
+ when :update_key_description
160
+ Aws::KMS::Endpoints::UpdateKeyDescription.build(context)
161
+ when :update_primary_region
162
+ Aws::KMS::Endpoints::UpdatePrimaryRegion.build(context)
163
+ when :verify
164
+ Aws::KMS::Endpoints::Verify.build(context)
165
+ when :verify_mac
166
+ Aws::KMS::Endpoints::VerifyMac.build(context)
167
+ end
168
+ end
169
+ end
170
+
171
+ def add_handlers(handlers, _config)
172
+ handlers.add(Handler, step: :build, priority: 75)
173
+ end
174
+ end
175
+ end
176
+ end
@@ -1,11 +1,14 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # WARNING ABOUT GENERATED CODE
2
4
  #
3
5
  # This file is generated. See the contributing guide for more information:
4
- # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
5
7
  #
6
8
  # WARNING ABOUT GENERATED CODE
7
9
 
8
10
  module Aws::KMS
11
+
9
12
  class Resource
10
13
 
11
14
  # @param options ({})