Skip to content

Commit

Permalink
Merge branch 'tony/mutations-idempotent' into tony/mutations-fix-flag…
Browse files Browse the repository at this point in the history
…-to-enum
  • Loading branch information
texastony committed Nov 4, 2024
2 parents c6fdedb + d4ba279 commit 81cc98c
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/library_dafny_verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
dafny-version: ${{ inputs.dafny }}

# dafny-reportgenerator requires next6
# but only 7.0 is installed on macos-12-large
# but only 7.0 is installed on macos-13-large
- name: Setup .NET Core SDK '6.0.x'
uses: actions/setup-dotnet@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/library_interop_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
# https://taskei.amazon.dev/tasks/CrypTool-5283
# windows-latest,
ubuntu-latest,
macos-12,
macos-13,
]
language: [java, net, python]
# https://taskei.amazon.dev/tasks/CrypTool-5284
Expand Down Expand Up @@ -145,7 +145,7 @@ jobs:
# TODO just test on mac and ubuntu for now
# windows-latest,
ubuntu-latest,
macos-12,
macos-13,
]
encrypting_language: [java, net, python]
decrypting_language: [java, net, python]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/library_java_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
# TODO just test on mac for now
# windows-latest,
ubuntu-latest,
macos-12,
macos-13,
]
runs-on: ${{ matrix.os }}
permissions:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/library_net_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
TestVectorsAwsCryptographicMaterialProviders,
]
dotnet-version: ["6.0.x"]
os: [windows-latest, ubuntu-latest, macos-12]
os: [windows-latest, ubuntu-latest, macos-13]
runs-on: ${{ matrix.os }}
defaults:
run:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/library_python_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
# Windows source code is tested downstream (ex. ESDK-Python CI).
# windows-latest,
ubuntu-latest,
macos-12,
macos-13,
]
runs-on: ${{ matrix.os }}
defaults:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sem_ver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
semantic-release:
runs-on: macos-12
runs-on: macos-13
permissions:
id-token: write
contents: read
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/semantic_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
# privileged operation, so we must make sure this list of users is a subset of the users labeled as maintainers of
# https://github.com/orgs/aws/teams/aws-crypto-tools
if: contains('["seebees","texastony","ShubhamChaturvedi7","lucasmcdonald3","josecorella","imabhichow","rishav-karanjit","antonf-amzn","kessplas","RitvikKapila","ajewellamz"]', github.actor)
runs-on: macos-12
runs-on: macos-13
permissions:
id-token: write
contents: write
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,37 @@ public static ApplyMutationResult ApplyMutationResult(
);
}

public static InitializeMutationFlag InitializeMutationFlag(
software.amazon.cryptography.keystoreadmin.model.InitializeMutationFlag nativeValue
) {
if (Objects.nonNull(nativeValue.Created())) {
return InitializeMutationFlag.create_Created(
software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(
nativeValue.Created()
)
);
}
if (Objects.nonNull(nativeValue.Resumed())) {
return InitializeMutationFlag.create_Resumed(
software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(
nativeValue.Resumed()
)
);
}
if (Objects.nonNull(nativeValue.ResumedWithoutIndex())) {
return InitializeMutationFlag.create_ResumedWithoutIndex(
software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(
nativeValue.ResumedWithoutIndex()
)
);
}
throw new IllegalArgumentException(
"Cannot convert " +
nativeValue +
" to software.amazon.cryptography.keystoreadmin.internaldafny.types.InitializeMutationFlag."
);
}

public static KeyManagementStrategy KeyManagementStrategy(
software.amazon.cryptography.keystoreadmin.model.KeyManagementStrategy nativeValue
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,35 @@ public static ApplyMutationResult ApplyMutationResult(
return nativeBuilder.build();
}

public static InitializeMutationFlag InitializeMutationFlag(
software.amazon.cryptography.keystoreadmin.internaldafny.types.InitializeMutationFlag dafnyValue
) {
InitializeMutationFlag.Builder nativeBuilder =
InitializeMutationFlag.builder();
if (dafnyValue.is_Created()) {
nativeBuilder.Created(
software.amazon.smithy.dafny.conversion.ToNative.Simple.String(
dafnyValue.dtor_Created()
)
);
}
if (dafnyValue.is_Resumed()) {
nativeBuilder.Resumed(
software.amazon.smithy.dafny.conversion.ToNative.Simple.String(
dafnyValue.dtor_Resumed()
)
);
}
if (dafnyValue.is_ResumedWithoutIndex()) {
nativeBuilder.ResumedWithoutIndex(
software.amazon.smithy.dafny.conversion.ToNative.Simple.String(
dafnyValue.dtor_ResumedWithoutIndex()
)
);
}
return nativeBuilder.build();
}

public static KeyManagementStrategy KeyManagementStrategy(
software.amazon.cryptography.keystoreadmin.internaldafny.types.KeyManagementStrategy dafnyValue
) {
Expand Down

0 comments on commit 81cc98c

Please sign in to comment.