28
28
import software .amazon .awssdk .core .SdkBytes ;
29
29
import software .amazon .cryptography .dbencryptionsdk .dynamodb .ILegacyDynamoDbEncryptor ;
30
30
import software .amazon .cryptography .dbencryptionsdk .dynamodb .internaldafny .types .LegacyPolicy ;
31
- import software .amazon .cryptography .dbencryptionsdk .dynamodb .itemencryptor .ToNative ;
32
31
import software .amazon .cryptography .dbencryptionsdk .dynamodb .itemencryptor .internaldafny .types .Error ;
33
32
import software .amazon .cryptography .dbencryptionsdk .structuredencryption .internaldafny .types .CryptoAction ;
34
33
34
+ import software .amazon .cryptography .dbencryptionsdk .dynamodb .itemencryptor .internaldafny .legacy ._ExternBase___default ;
35
+
35
36
public class InternalLegacyOverride extends _ExternBase_InternalLegacyOverride {
36
37
37
38
private DynamoDBEncryptor encryptor ;
@@ -95,7 +96,7 @@ > EncryptItem(
95
96
) {
96
97
// Precondition: Policy MUST allow the caller to encrypt.
97
98
if (!_policy .is_FORCE__LEGACY__ENCRYPT__ALLOW__LEGACY__DECRYPT ()) {
98
- return CreateEncryptItemFailure (
99
+ return _ExternBase___default . CreateEncryptItemFailure (
99
100
createError ("Legacy Policy does not support encrypt." )
100
101
);
101
102
}
@@ -127,9 +128,9 @@ > EncryptItem(
127
128
software .amazon .cryptography .dbencryptionsdk .dynamodb .itemencryptor .ToDafny .EncryptItemOutput (
128
129
nativeOutput
129
130
);
130
- return CreateEncryptItemSuccess (dafnyOutput );
131
+ return _ExternBase___default . CreateEncryptItemSuccess (dafnyOutput );
131
132
} catch (Exception ex ) {
132
- return CreateEncryptItemFailure (Error .create_Opaque (ex ));
133
+ return _ExternBase___default . CreateEncryptItemFailure (Error .create_Opaque (ex ));
133
134
}
134
135
}
135
136
@@ -149,7 +150,7 @@ > DecryptItem(
149
150
!_policy .is_FORCE__LEGACY__ENCRYPT__ALLOW__LEGACY__DECRYPT () &&
150
151
!_policy .is_FORBID__LEGACY__ENCRYPT__ALLOW__LEGACY__DECRYPT ()
151
152
) {
152
- return CreateDecryptItemFailure (
153
+ return _ExternBase___default . CreateDecryptItemFailure (
153
154
createError ("Legacy Policy does not support decrypt." )
154
155
);
155
156
}
@@ -180,9 +181,9 @@ > DecryptItem(
180
181
software .amazon .cryptography .dbencryptionsdk .dynamodb .itemencryptor .ToDafny .DecryptItemOutput (
181
182
nativeOutput
182
183
);
183
- return CreateDecryptItemSuccess (dafnyOutput );
184
+ return _ExternBase___default . CreateDecryptItemSuccess (dafnyOutput );
184
185
} catch (Exception ex ) {
185
- return CreateDecryptItemFailure (Error .create_Opaque (ex ));
186
+ return _ExternBase___default . CreateDecryptItemFailure (Error .create_Opaque (ex ));
186
187
}
187
188
}
188
189
@@ -191,7 +192,7 @@ public static Result<Option<InternalLegacyOverride>, Error> Build(
191
192
) {
192
193
// Check for early return (Postcondition): If there is no legacyOverride there is nothing to do.
193
194
if (encryptorConfig .dtor_legacyOverride ().is_None ()) {
194
- return CreateBuildSuccess (CreateInternalLegacyOverrideNone ());
195
+ return _ExternBase___default . CreateBuildSuccess (_ExternBase___default . CreateInternalLegacyOverrideNone ());
195
196
}
196
197
final software .amazon .cryptography .dbencryptionsdk .dynamodb .internaldafny .types .LegacyOverride legacyOverride =
197
198
encryptorConfig .dtor_legacyOverride ().dtor_value ();
@@ -203,15 +204,15 @@ public static Result<Option<InternalLegacyOverride>, Error> Build(
203
204
204
205
// Precondition: The encryptor MUST be a DynamoDBEncryptor
205
206
if (!isDynamoDBEncryptor (maybeEncryptor )) {
206
- return CreateBuildFailure (
207
+ return _ExternBase___default . CreateBuildFailure (
207
208
createError ("Legacy encryptor is not supported" )
208
209
);
209
210
}
210
211
// Preconditions: MUST be able to create valid encryption context
211
212
final InternalResult <EncryptionContext , Error > maybeEncryptionContext =
212
213
legacyEncryptionContext (encryptorConfig );
213
214
if (maybeEncryptionContext .isFailure ()) {
214
- return CreateBuildFailure (maybeEncryptionContext .error ());
215
+ return _ExternBase___default . CreateBuildFailure (maybeEncryptionContext .error ());
215
216
}
216
217
// Precondition: All actions MUST be supported types
217
218
final InternalResult <
@@ -221,7 +222,7 @@ public static Result<Option<InternalLegacyOverride>, Error> Build(
221
222
legacyOverride .dtor_attributeActionsOnEncrypt ()
222
223
);
223
224
if (maybeActions .isFailure ()) {
224
- return CreateBuildFailure (maybeEncryptionContext .error ());
225
+ return _ExternBase___default . CreateBuildFailure (maybeEncryptionContext .error ());
225
226
}
226
227
227
228
final InternalLegacyOverride internalLegacyOverride =
@@ -232,8 +233,8 @@ public static Result<Option<InternalLegacyOverride>, Error> Build(
232
233
legacyOverride .dtor_policy ()
233
234
);
234
235
235
- return CreateBuildSuccess (
236
- CreateInternalLegacyOverrideSome (internalLegacyOverride )
236
+ return _ExternBase___default . CreateBuildSuccess (
237
+ _ExternBase___default . CreateInternalLegacyOverrideSome (internalLegacyOverride )
237
238
);
238
239
}
239
240
0 commit comments