@@ -43,10 +43,10 @@ include "../../../../submodules/MaterialProviders/StandardLibrary/src/Index.dfy"
43
43
nameonly keyStore: AwsCryptographyKeyStoreTypes .IKeyStoreClient ,
44
44
nameonly keySource: BeaconKeySource ,
45
45
nameonly standardBeacons: StandardBeaconList ,
46
- nameonly compoundBeacons: Option <CompoundBeaconList > ,
47
- nameonly virtualFields: Option <VirtualFieldList > ,
48
- nameonly encryptedParts: Option <EncryptedPartsList > ,
49
- nameonly signedParts: Option <SignedPartsList >
46
+ nameonly compoundBeacons: Option <CompoundBeaconList > := Option.None ,
47
+ nameonly virtualFields: Option <VirtualFieldList > := Option.None ,
48
+ nameonly encryptedParts: Option <EncryptedPartsList > := Option.None ,
49
+ nameonly signedParts: Option <SignedPartsList > := Option.None
50
50
)
51
51
type BeaconVersionList = x: seq < BeaconVersion> | IsValid_BeaconVersionList (x) witness *
52
52
predicate method IsValid_BeaconVersionList (x: seq <BeaconVersion >) {
@@ -59,9 +59,9 @@ include "../../../../submodules/MaterialProviders/StandardLibrary/src/Index.dfy"
59
59
datatype CompoundBeacon = | CompoundBeacon (
60
60
nameonly name: string ,
61
61
nameonly split: Char ,
62
- nameonly encrypted: Option <EncryptedPartsList > ,
63
- nameonly signed: Option <SignedPartsList > ,
64
- nameonly constructors: Option <ConstructorList >
62
+ nameonly encrypted: Option <EncryptedPartsList > := Option.None ,
63
+ nameonly signed: Option <SignedPartsList > := Option.None ,
64
+ nameonly constructors: Option <ConstructorList > := Option.None
65
65
)
66
66
type CompoundBeaconList = x: seq < CompoundBeacon> | IsValid_CompoundBeaconList (x) witness *
67
67
predicate method IsValid_CompoundBeaconList (x: seq <CompoundBeacon >) {
@@ -217,16 +217,16 @@ include "../../../../submodules/MaterialProviders/StandardLibrary/src/Index.dfy"
217
217
datatype DynamoDbTableEncryptionConfig = | DynamoDbTableEncryptionConfig (
218
218
nameonly logicalTableName: string ,
219
219
nameonly partitionKeyName: ComAmazonawsDynamodbTypes .KeySchemaAttributeName ,
220
- nameonly sortKeyName: Option <ComAmazonawsDynamodbTypes .KeySchemaAttributeName> ,
221
- nameonly search: Option <SearchConfig > ,
220
+ nameonly sortKeyName: Option <ComAmazonawsDynamodbTypes .KeySchemaAttributeName> := Option.None ,
221
+ nameonly search: Option <SearchConfig > := Option.None ,
222
222
nameonly attributeActionsOnEncrypt: AttributeActions ,
223
- nameonly allowedUnsignedAttributes: Option <ComAmazonawsDynamodbTypes .AttributeNameList> ,
224
- nameonly allowedUnsignedAttributePrefix: Option <string > ,
225
- nameonly algorithmSuiteId: Option <AwsCryptographyMaterialProvidersTypes .DBEAlgorithmSuiteId> ,
226
- nameonly keyring: Option <AwsCryptographyMaterialProvidersTypes .IKeyring> ,
227
- nameonly cmm: Option <AwsCryptographyMaterialProvidersTypes .ICryptographicMaterialsManager> ,
228
- nameonly legacyOverride: Option <LegacyOverride > ,
229
- nameonly plaintextOverride: Option <PlaintextOverride >
223
+ nameonly allowedUnsignedAttributes: Option <ComAmazonawsDynamodbTypes .AttributeNameList> := Option.None ,
224
+ nameonly allowedUnsignedAttributePrefix: Option <string > := Option.None ,
225
+ nameonly algorithmSuiteId: Option <AwsCryptographyMaterialProvidersTypes .DBEAlgorithmSuiteId> := Option.None ,
226
+ nameonly keyring: Option <AwsCryptographyMaterialProvidersTypes .IKeyring> := Option.None ,
227
+ nameonly cmm: Option <AwsCryptographyMaterialProvidersTypes .ICryptographicMaterialsManager> := Option.None ,
228
+ nameonly legacyOverride: Option <LegacyOverride > := Option.None ,
229
+ nameonly plaintextOverride: Option <PlaintextOverride > := Option.None
230
230
)
231
231
type DynamoDbTableEncryptionConfigList = map < ComAmazonawsDynamodbTypes. TableName, DynamoDbTableEncryptionConfig>
232
232
datatype DynamoDbTablesEncryptionConfig = | DynamoDbTablesEncryptionConfig (
@@ -307,7 +307,7 @@ include "../../../../submodules/MaterialProviders/StandardLibrary/src/Index.dfy"
307
307
nameonly policy: LegacyPolicy ,
308
308
nameonly encryptor: ILegacyDynamoDbEncryptor ,
309
309
nameonly attributeActionsOnEncrypt: AttributeActions ,
310
- nameonly defaultAttributeFlag: Option <AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes .CryptoAction>
310
+ nameonly defaultAttributeFlag: Option <AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes .CryptoAction> := Option.None
311
311
)
312
312
datatype LegacyPolicy =
313
313
| FORCE_LEGACY_ENCRYPT_ALLOW_LEGACY_DECRYPT
@@ -319,7 +319,7 @@ include "../../../../submodules/MaterialProviders/StandardLibrary/src/Index.dfy"
319
319
datatype MultiKeyStore = | MultiKeyStore (
320
320
nameonly keyFieldName: string ,
321
321
nameonly cacheTTL: int32 ,
322
- nameonly cache: Option <AwsCryptographyMaterialProvidersTypes .CacheType>
322
+ nameonly cache: Option <AwsCryptographyMaterialProvidersTypes .CacheType> := Option.None
323
323
)
324
324
datatype PartOnly = | PartOnly (
325
325
@@ -345,7 +345,7 @@ include "../../../../submodules/MaterialProviders/StandardLibrary/src/Index.dfy"
345
345
datatype SignedPart = | SignedPart (
346
346
nameonly name: string ,
347
347
nameonly prefix: Prefix ,
348
- nameonly loc: Option <TerminalLocation >
348
+ nameonly loc: Option <TerminalLocation > := Option.None
349
349
)
350
350
type SignedPartsList = x: seq < SignedPart> | IsValid_SignedPartsList (x) witness *
351
351
predicate method IsValid_SignedPartsList (x: seq <SignedPart >) {
@@ -358,8 +358,8 @@ include "../../../../submodules/MaterialProviders/StandardLibrary/src/Index.dfy"
358
358
datatype StandardBeacon = | StandardBeacon (
359
359
nameonly name: string ,
360
360
nameonly length: BeaconBitLength ,
361
- nameonly loc: Option <TerminalLocation > ,
362
- nameonly style: Option <BeaconStyle >
361
+ nameonly loc: Option <TerminalLocation > := Option.None ,
362
+ nameonly style: Option <BeaconStyle > := Option.None
363
363
)
364
364
type StandardBeaconList = x: seq < StandardBeacon> | IsValid_StandardBeaconList (x) witness *
365
365
predicate method IsValid_StandardBeaconList (x: seq <StandardBeacon >) {
@@ -386,7 +386,7 @@ include "../../../../submodules/MaterialProviders/StandardLibrary/src/Index.dfy"
386
386
}
387
387
datatype VirtualPart = | VirtualPart (
388
388
nameonly loc: TerminalLocation ,
389
- nameonly trans: Option <VirtualTransformList >
389
+ nameonly trans: Option <VirtualTransformList > := Option.None
390
390
)
391
391
type VirtualPartList = x: seq < VirtualPart> | IsValid_VirtualPartList (x) witness *
392
392
predicate method IsValid_VirtualPartList (x: seq <VirtualPart >) {
@@ -453,13 +453,20 @@ include "../../../../submodules/MaterialProviders/StandardLibrary/src/Index.dfy"
453
453
import Operations : AbstractAwsCryptographyDbEncryptionSdkDynamoDbOperations
454
454
function method DefaultDynamoDbEncryptionConfig (): DynamoDbEncryptionConfig
455
455
method DynamoDbEncryption (config: DynamoDbEncryptionConfig := DefaultDynamoDbEncryptionConfig())
456
- returns (res: Result< DynamoDbEncryptionClient , Error> )
456
+ returns (res: Result< IDynamoDbEncryptionClient , Error> )
457
457
ensures res. Success? ==>
458
458
&& fresh (res. value)
459
459
&& fresh (res. value. Modifies)
460
460
&& fresh (res. value. History)
461
461
&& res. value. ValidState ()
462
462
463
+ // Helper function for the benefit of native code to create a Success(client) without referring to Dafny internals
464
+ function method CreateSuccessOfClient (client: IDynamoDbEncryptionClient ): Result< IDynamoDbEncryptionClient, Error> {
465
+ Success (client)
466
+ } // Helper function for the benefit of native code to create a Failure(error) without referring to Dafny internals
467
+ function method CreateFailureOfError (error: Error ): Result< IDynamoDbEncryptionClient, Error> {
468
+ Failure (error)
469
+ }
463
470
class DynamoDbEncryptionClient extends IDynamoDbEncryptionClient
464
471
{
465
472
constructor (config: Operations. InternalConfig)
0 commit comments