@@ -43,10 +43,10 @@ include "../../../../submodules/MaterialProviders/StandardLibrary/src/Index.dfy"
4343 nameonly keyStore: AwsCryptographyKeyStoreTypes .IKeyStoreClient ,
4444 nameonly keySource: BeaconKeySource ,
4545 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
5050 )
5151 type BeaconVersionList = x: seq < BeaconVersion> | IsValid_BeaconVersionList (x) witness *
5252 predicate method IsValid_BeaconVersionList (x: seq <BeaconVersion >) {
@@ -59,9 +59,9 @@ include "../../../../submodules/MaterialProviders/StandardLibrary/src/Index.dfy"
5959 datatype CompoundBeacon = | CompoundBeacon (
6060 nameonly name: string ,
6161 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
6565 )
6666 type CompoundBeaconList = x: seq < CompoundBeacon> | IsValid_CompoundBeaconList (x) witness *
6767 predicate method IsValid_CompoundBeaconList (x: seq <CompoundBeacon >) {
@@ -217,16 +217,16 @@ include "../../../../submodules/MaterialProviders/StandardLibrary/src/Index.dfy"
217217 datatype DynamoDbTableEncryptionConfig = | DynamoDbTableEncryptionConfig (
218218 nameonly logicalTableName: string ,
219219 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 ,
222222 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
230230 )
231231 type DynamoDbTableEncryptionConfigList = map < ComAmazonawsDynamodbTypes. TableName, DynamoDbTableEncryptionConfig>
232232 datatype DynamoDbTablesEncryptionConfig = | DynamoDbTablesEncryptionConfig (
@@ -307,7 +307,7 @@ include "../../../../submodules/MaterialProviders/StandardLibrary/src/Index.dfy"
307307 nameonly policy: LegacyPolicy ,
308308 nameonly encryptor: ILegacyDynamoDbEncryptor ,
309309 nameonly attributeActionsOnEncrypt: AttributeActions ,
310- nameonly defaultAttributeFlag: Option <AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes .CryptoAction>
310+ nameonly defaultAttributeFlag: Option <AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes .CryptoAction> := Option.None
311311 )
312312 datatype LegacyPolicy =
313313 | FORCE_LEGACY_ENCRYPT_ALLOW_LEGACY_DECRYPT
@@ -319,7 +319,7 @@ include "../../../../submodules/MaterialProviders/StandardLibrary/src/Index.dfy"
319319 datatype MultiKeyStore = | MultiKeyStore (
320320 nameonly keyFieldName: string ,
321321 nameonly cacheTTL: int32 ,
322- nameonly cache: Option <AwsCryptographyMaterialProvidersTypes .CacheType>
322+ nameonly cache: Option <AwsCryptographyMaterialProvidersTypes .CacheType> := Option.None
323323 )
324324 datatype PartOnly = | PartOnly (
325325
@@ -345,7 +345,7 @@ include "../../../../submodules/MaterialProviders/StandardLibrary/src/Index.dfy"
345345 datatype SignedPart = | SignedPart (
346346 nameonly name: string ,
347347 nameonly prefix: Prefix ,
348- nameonly loc: Option <TerminalLocation >
348+ nameonly loc: Option <TerminalLocation > := Option.None
349349 )
350350 type SignedPartsList = x: seq < SignedPart> | IsValid_SignedPartsList (x) witness *
351351 predicate method IsValid_SignedPartsList (x: seq <SignedPart >) {
@@ -358,8 +358,8 @@ include "../../../../submodules/MaterialProviders/StandardLibrary/src/Index.dfy"
358358 datatype StandardBeacon = | StandardBeacon (
359359 nameonly name: string ,
360360 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
363363 )
364364 type StandardBeaconList = x: seq < StandardBeacon> | IsValid_StandardBeaconList (x) witness *
365365 predicate method IsValid_StandardBeaconList (x: seq <StandardBeacon >) {
@@ -386,7 +386,7 @@ include "../../../../submodules/MaterialProviders/StandardLibrary/src/Index.dfy"
386386}
387387 datatype VirtualPart = | VirtualPart (
388388 nameonly loc: TerminalLocation ,
389- nameonly trans: Option <VirtualTransformList >
389+ nameonly trans: Option <VirtualTransformList > := Option.None
390390 )
391391 type VirtualPartList = x: seq < VirtualPart> | IsValid_VirtualPartList (x) witness *
392392 predicate method IsValid_VirtualPartList (x: seq <VirtualPart >) {
@@ -453,13 +453,20 @@ include "../../../../submodules/MaterialProviders/StandardLibrary/src/Index.dfy"
453453 import Operations : AbstractAwsCryptographyDbEncryptionSdkDynamoDbOperations
454454 function method DefaultDynamoDbEncryptionConfig (): DynamoDbEncryptionConfig
455455 method DynamoDbEncryption (config: DynamoDbEncryptionConfig := DefaultDynamoDbEncryptionConfig())
456- returns (res: Result< DynamoDbEncryptionClient , Error> )
456+ returns (res: Result< IDynamoDbEncryptionClient , Error> )
457457 ensures res. Success? ==>
458458 && fresh (res. value)
459459 && fresh (res. value. Modifies)
460460 && fresh (res. value. History)
461461 && res. value. ValidState ()
462462
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+ }
463470 class DynamoDbEncryptionClient extends IDynamoDbEncryptionClient
464471 {
465472 constructor (config: Operations. InternalConfig)
0 commit comments