@@ -93,6 +93,14 @@ module {:extern "software.amazon.cryptography.dbencryptionsdk.structuredencrypti
93
93
type Path = seq < PathSegment>
94
94
datatype PathSegment =
95
95
| member (member: StructureSegment )
96
+ datatype ResolveAuthActionsInput = | ResolveAuthActionsInput (
97
+ nameonly tableName: string ,
98
+ nameonly authActions: AuthList ,
99
+ nameonly headerBytes: seq <uint8 >
100
+ )
101
+ datatype ResolveAuthActionsOutput = | ResolveAuthActionsOutput (
102
+ nameonly cryptoActions: CryptoList
103
+ )
96
104
type StructuredDataMap = map < string , StructuredDataTerminal>
97
105
datatype StructuredDataTerminal = | StructuredDataTerminal (
98
106
nameonly value: TerminalValue ,
@@ -104,11 +112,13 @@ module {:extern "software.amazon.cryptography.dbencryptionsdk.structuredencrypti
104
112
DecryptStructure := [];
105
113
EncryptPathStructure := [];
106
114
DecryptPathStructure := [];
115
+ ResolveAuthActions := [];
107
116
}
108
117
ghost var EncryptStructure: seq < DafnyCallEvent< EncryptStructureInput, Result< EncryptStructureOutput, Error>>>
109
118
ghost var DecryptStructure: seq < DafnyCallEvent< DecryptStructureInput, Result< DecryptStructureOutput, Error>>>
110
119
ghost var EncryptPathStructure: seq < DafnyCallEvent< EncryptPathStructureInput, Result< EncryptPathStructureOutput, Error>>>
111
120
ghost var DecryptPathStructure: seq < DafnyCallEvent< DecryptPathStructureInput, Result< DecryptPathStructureOutput, Error>>>
121
+ ghost var ResolveAuthActions: seq < DafnyCallEvent< ResolveAuthActionsInput, Result< ResolveAuthActionsOutput, Error>>>
112
122
}
113
123
trait {:termination false } IStructuredEncryptionClient
114
124
{
@@ -213,6 +223,21 @@ module {:extern "software.amazon.cryptography.dbencryptionsdk.structuredencrypti
213
223
ensures DecryptPathStructureEnsuresPublicly (input, output)
214
224
ensures History. DecryptPathStructure == old (History. DecryptPathStructure) + [DafnyCallEvent (input, output)]
215
225
226
+ predicate ResolveAuthActionsEnsuresPublicly (input: ResolveAuthActionsInput , output: Result <ResolveAuthActionsOutput , Error>)
227
+ // The public method to be called by library consumers
228
+ method ResolveAuthActions ( input: ResolveAuthActionsInput )
229
+ returns (output: Result< ResolveAuthActionsOutput, Error> )
230
+ requires
231
+ && ValidState ()
232
+ modifies Modifies - {History} ,
233
+ History`ResolveAuthActions
234
+ // Dafny will skip type parameters when generating a default decreases clause.
235
+ decreases Modifies - {History}
236
+ ensures
237
+ && ValidState ()
238
+ ensures ResolveAuthActionsEnsuresPublicly (input, output)
239
+ ensures History. ResolveAuthActions == old (History. ResolveAuthActions) + [DafnyCallEvent (input, output)]
240
+
216
241
}
217
242
datatype StructuredEncryptionConfig = | StructuredEncryptionConfig (
218
243
@@ -394,6 +419,26 @@ abstract module AbstractAwsCryptographyDbEncryptionSdkStructuredEncryptionServic
394
419
History. DecryptPathStructure := History. DecryptPathStructure + [DafnyCallEvent (input, output)];
395
420
}
396
421
422
+ predicate ResolveAuthActionsEnsuresPublicly (input: ResolveAuthActionsInput , output: Result <ResolveAuthActionsOutput , Error>)
423
+ {Operations. ResolveAuthActionsEnsuresPublicly (input, output)}
424
+ // The public method to be called by library consumers
425
+ method ResolveAuthActions ( input: ResolveAuthActionsInput )
426
+ returns (output: Result< ResolveAuthActionsOutput, Error> )
427
+ requires
428
+ && ValidState ()
429
+ modifies Modifies - {History} ,
430
+ History`ResolveAuthActions
431
+ // Dafny will skip type parameters when generating a default decreases clause.
432
+ decreases Modifies - {History}
433
+ ensures
434
+ && ValidState ()
435
+ ensures ResolveAuthActionsEnsuresPublicly (input, output)
436
+ ensures History. ResolveAuthActions == old (History. ResolveAuthActions) + [DafnyCallEvent (input, output)]
437
+ {
438
+ output := Operations. ResolveAuthActions (config, input);
439
+ History. ResolveAuthActions := History. ResolveAuthActions + [DafnyCallEvent (input, output)];
440
+ }
441
+
397
442
}
398
443
}
399
444
abstract module AbstractAwsCryptographyDbEncryptionSdkStructuredEncryptionOperations {
@@ -478,4 +523,20 @@ abstract module AbstractAwsCryptographyDbEncryptionSdkStructuredEncryptionOperat
478
523
ensures
479
524
&& ValidInternalConfig?(config)
480
525
ensures DecryptPathStructureEnsuresPublicly (input, output)
526
+
527
+
528
+ predicate ResolveAuthActionsEnsuresPublicly (input: ResolveAuthActionsInput , output: Result <ResolveAuthActionsOutput , Error>)
529
+ // The private method to be refined by the library developer
530
+
531
+
532
+ method ResolveAuthActions ( config: InternalConfig , input: ResolveAuthActionsInput )
533
+ returns (output: Result< ResolveAuthActionsOutput, Error> )
534
+ requires
535
+ && ValidInternalConfig?(config)
536
+ modifies ModifiesInternalConfig (config)
537
+ // Dafny will skip type parameters when generating a default decreases clause.
538
+ decreases ModifiesInternalConfig (config)
539
+ ensures
540
+ && ValidInternalConfig?(config)
541
+ ensures ResolveAuthActionsEnsuresPublicly (input, output)
481
542
}
0 commit comments