From 6c9a8b3bf8a9962b0accfd32e2c9a0126f9c7ca2 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Tue, 1 Oct 2024 02:39:29 +0000 Subject: [PATCH 1/6] Bump OPA version from v0.68.0 to v0.69.0 --- PowerShell/ScubaGear/Modules/ScubaConfig/ScubaConfig.psm1 | 2 +- PowerShell/ScubaGear/Modules/Support/Support.psm1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PowerShell/ScubaGear/Modules/ScubaConfig/ScubaConfig.psm1 b/PowerShell/ScubaGear/Modules/ScubaConfig/ScubaConfig.psm1 index 28300f24be..af70714d17 100644 --- a/PowerShell/ScubaGear/Modules/ScubaConfig/ScubaConfig.psm1 +++ b/PowerShell/ScubaGear/Modules/ScubaConfig/ScubaConfig.psm1 @@ -39,7 +39,7 @@ class ScubaConfig { "Hybrid Identity Administrator", "Application Administrator", "Cloud Application Administrator") - DefaultOPAVersion = '0.68.0' + DefaultOPAVersion = '0.69.0' } static [object]ScubaDefault ([string]$Name){ diff --git a/PowerShell/ScubaGear/Modules/Support/Support.psm1 b/PowerShell/ScubaGear/Modules/Support/Support.psm1 index 989ae51352..af88af19f7 100644 --- a/PowerShell/ScubaGear/Modules/Support/Support.psm1 +++ b/PowerShell/ScubaGear/Modules/Support/Support.psm1 @@ -246,7 +246,7 @@ function Install-OPAforSCuBA { # Constants $ACCEPTABLEVERSIONS = '0.59.0', '0.60.0', '0.61.0', '0.62.1', '0.63.0', '0.64.1', - '0.65.0', '0.66.0', '0.67.1', [ScubaConfig]::ScubaDefault('DefaultOPAVersion') # End Versions + '0.65.0', '0.66.0', '0.67.1', '0.68.0', [ScubaConfig]::ScubaDefault('DefaultOPAVersion') # End Versions $FILENAME = @{ Windows = "opa_windows_amd64.exe"; MacOS = "opa_darwin_amd64"; Linux = "opa_linux_amd64_static"} # Set prefernces for writing messages From 844f990ceaee01c15f03fae9a5628cc56c16ac46 Mon Sep 17 00:00:00 2001 From: buidav <105074908+buidav@users.noreply.github.com> Date: Tue, 1 Oct 2024 16:11:26 -0700 Subject: [PATCH 2/6] make v0.69.0 the minimum version --- PowerShell/ScubaGear/Modules/Support/Support.psm1 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/PowerShell/ScubaGear/Modules/Support/Support.psm1 b/PowerShell/ScubaGear/Modules/Support/Support.psm1 index af88af19f7..dc978d86f5 100644 --- a/PowerShell/ScubaGear/Modules/Support/Support.psm1 +++ b/PowerShell/ScubaGear/Modules/Support/Support.psm1 @@ -244,9 +244,7 @@ function Install-OPAforSCuBA { ) # Constants - $ACCEPTABLEVERSIONS = '0.59.0', '0.60.0', '0.61.0', - '0.62.1', '0.63.0', '0.64.1', - '0.65.0', '0.66.0', '0.67.1', '0.68.0', [ScubaConfig]::ScubaDefault('DefaultOPAVersion') # End Versions + $ACCEPTABLEVERSIONS = [ScubaConfig]::ScubaDefault('DefaultOPAVersion') # End Versions $FILENAME = @{ Windows = "opa_windows_amd64.exe"; MacOS = "opa_darwin_amd64"; Linux = "opa_linux_amd64_static"} # Set prefernces for writing messages From 12224cb21c41983efdf5bd1ffe5f33004ec98a4a Mon Sep 17 00:00:00 2001 From: buidav <105074908+buidav@users.noreply.github.com> Date: Tue, 1 Oct 2024 17:04:06 -0700 Subject: [PATCH 3/6] update workflow to handle single version case --- .github/workflows/run_update_opa.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/run_update_opa.yaml b/.github/workflows/run_update_opa.yaml index 56a9c68984..299cef438c 100644 --- a/.github/workflows/run_update_opa.yaml +++ b/.github/workflows/run_update_opa.yaml @@ -119,6 +119,12 @@ jobs: # Then add the new version on the next line ($VersionsArr[0..($VersionsArr.Length-2)] -join ",") + "," " '$CurrentOPAVersion', $DefaultOPAVersionVar $END_VERSIONS_COMMENT" # 4 space indentation + } + elseif ($VersionsLength -eq 1) { + # if the default version is the only acceptable version + # Make `VariableName = CurrentVersion, Default #EndVersionComment ` + $VersionsArr = $_ -split "=" + $VersionsArr[0] + " = '$CurrentOPAVersion'" + ", $DefaultOPAVersionVar $END_VERSIONS_COMMENT" } else { # No Splitting lines; Appending new Current OPA version to acceptable version From 7832f5a09559bd23ffd9a07a971edb335c2f3e16 Mon Sep 17 00:00:00 2001 From: buidav <105074908+buidav@users.noreply.github.com> Date: Tue, 1 Oct 2024 17:07:21 -0700 Subject: [PATCH 4/6] fix spacing --- .github/workflows/run_update_opa.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run_update_opa.yaml b/.github/workflows/run_update_opa.yaml index 299cef438c..0b57549f1c 100644 --- a/.github/workflows/run_update_opa.yaml +++ b/.github/workflows/run_update_opa.yaml @@ -120,9 +120,9 @@ jobs: ($VersionsArr[0..($VersionsArr.Length-2)] -join ",") + "," " '$CurrentOPAVersion', $DefaultOPAVersionVar $END_VERSIONS_COMMENT" # 4 space indentation } - elseif ($VersionsLength -eq 1) { + elseif ($VersionsLength -eq 1) { # if the default version is the only acceptable version - # Make `VariableName = CurrentVersion, Default #EndVersionComment ` + # Make `VariableName = CurrentVersion, DefaultOPAVer #EndVersionComment ` $VersionsArr = $_ -split "=" $VersionsArr[0] + " = '$CurrentOPAVersion'" + ", $DefaultOPAVersionVar $END_VERSIONS_COMMENT" } From db26b5158a154bce02d26adad25c8a11175f547a Mon Sep 17 00:00:00 2001 From: Addam Schroll <108814318+schrolla@users.noreply.github.com> Date: Wed, 2 Oct 2024 11:10:02 -0500 Subject: [PATCH 5/6] * Fix error message printing acceptable OPA versions --- PowerShell/ScubaGear/Modules/Support/Support.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PowerShell/ScubaGear/Modules/Support/Support.psm1 b/PowerShell/ScubaGear/Modules/Support/Support.psm1 index dc978d86f5..75e1498030 100644 --- a/PowerShell/ScubaGear/Modules/Support/Support.psm1 +++ b/PowerShell/ScubaGear/Modules/Support/Support.psm1 @@ -264,7 +264,7 @@ function Install-OPAforSCuBA { } if(-not $ACCEPTABLEVERSIONS.Contains($ExpectedVersion)) { - $AcceptableVersionsString = $ACCETABLEVERSIONS -join "`r`n" | Out-String + $AcceptableVersionsString = $ACCEPTABLEVERSIONS -join "`r`n" | Out-String throw "Version parameter entered, ${ExpectedVersion}, is not in the list of acceptable versions. Acceptable versions are:`r`n${AcceptableVersionsString}" } From 9ee9bfc88569272efc4c57daef97f745e3f17a47 Mon Sep 17 00:00:00 2001 From: buidav <105074908+buidav@users.noreply.github.com> Date: Wed, 2 Oct 2024 12:39:09 -0700 Subject: [PATCH 6/6] rm extra space in the workflow --- .github/workflows/run_update_opa.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_update_opa.yaml b/.github/workflows/run_update_opa.yaml index 0b57549f1c..675c41ca20 100644 --- a/.github/workflows/run_update_opa.yaml +++ b/.github/workflows/run_update_opa.yaml @@ -124,7 +124,7 @@ jobs: # if the default version is the only acceptable version # Make `VariableName = CurrentVersion, DefaultOPAVer #EndVersionComment ` $VersionsArr = $_ -split "=" - $VersionsArr[0] + " = '$CurrentOPAVersion'" + ", $DefaultOPAVersionVar $END_VERSIONS_COMMENT" + $VersionsArr[0] + "= '$CurrentOPAVersion'" + ", $DefaultOPAVersionVar $END_VERSIONS_COMMENT" } else { # No Splitting lines; Appending new Current OPA version to acceptable version