Skip to content

Commit cfbbb40

Browse files
authored
Merge pull request #103 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents a168c62 + 348d597 commit cfbbb40

File tree

8 files changed

+126
-47
lines changed

8 files changed

+126
-47
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
2+
# More GitHub Actions for Azure: https://github.com/Azure/actions
3+
4+
name: Build and deploy Powershell project to Azure Function App - cippkwn4s-auditlog
5+
6+
on:
7+
push:
8+
branches:
9+
- dev
10+
workflow_dispatch:
11+
12+
env:
13+
AZURE_FUNCTIONAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root
14+
15+
jobs:
16+
deploy:
17+
runs-on: windows-latest
18+
19+
steps:
20+
- name: 'Checkout GitHub Action'
21+
uses: actions/checkout@v4
22+
23+
- name: 'Run Azure Functions Action'
24+
uses: Azure/functions-action@v1
25+
id: fa
26+
with:
27+
app-name: 'cippkwn4s-auditlog'
28+
slot-name: 'Production'
29+
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
30+
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_34E06457AFD540C5ADCC893F70B5C245 }}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
2+
# More GitHub Actions for Azure: https://github.com/Azure/actions
3+
4+
name: Build and deploy Powershell project to Azure Function App - cippkwn4s
5+
6+
on:
7+
push:
8+
branches:
9+
- dev
10+
workflow_dispatch:
11+
12+
env:
13+
AZURE_FUNCTIONAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root
14+
15+
jobs:
16+
deploy:
17+
runs-on: windows-latest
18+
19+
steps:
20+
- name: 'Checkout GitHub Action'
21+
uses: actions/checkout@v4
22+
23+
- name: 'Run Azure Functions Action'
24+
uses: Azure/functions-action@v1
25+
id: fa
26+
with:
27+
app-name: 'cippkwn4s'
28+
slot-name: 'Production'
29+
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
30+
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_D3DB920CED0443B791B30C72BBB395BE }}

Modules/CIPPCore/Public/Entrypoints/Activity Triggers/Push-SchedulerCIPPNotifications.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ function Push-SchedulerCIPPNotifications {
128128
Add-CIPPAzDataTableEntity @Table -Entity $UpdateLogs -Force
129129
}
130130
} catch {
131-
Write-Information "Could not send alerts to webhook: $($_.Exception.message)"
132-
Write-LogMessage -API 'Alerts' -message "Could not send alerts to : $($_.Exception.message)" -tenant $Tenant -sev error
131+
Write-Information "Could not send alerts to webhook $($config.webhook): $($_.Exception.message)"
132+
Write-LogMessage -API 'Alerts' -message "Could not send alerts to webhook $($config.webhook): $($_.Exception.message)" -tenant $Tenant -sev error -LogData (Get-CippException -Exception $_)
133133
}
134134

135135
if ($config.sendtoIntegration) {
@@ -157,4 +157,4 @@ function Push-SchedulerCIPPNotifications {
157157
}
158158

159159

160-
}
160+
}

Modules/CIPPCore/Public/Test-CIPPGDAPRelationships.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,14 @@ function Test-CIPPGDAPRelationships {
5757
)
5858
$RoleAssignableGroups = $SAMUserMemberships | Where-Object { $_.isAssignableToRole }
5959
$NestedGroups = foreach ($Group in $RoleAssignableGroups) {
60+
Write-Information "Getting nested group memberships for $($Group.displayName)"
6061
New-GraphGetRequest -uri "https://graph.microsoft.com/beta/groups/$($Group.id)/memberOf?`$select=id,displayName" -NoAuthCheck $true
6162
}
6263
foreach ($Group in $ExpectedGroups) {
6364
$GroupFound = $false
6465
foreach ($Membership in ($SAMUserMemberships + $NestedGroups)) {
65-
if ($Membership.displayName -match $Group -and (($CIPPGroupCount -gt 0 -and $Group -match 'M365 GDAP') -or $Group -notmatch 'M365 GDAP')) {
66+
if ($Membership.displayName -match $Group) {
67+
Write-Information "Found $Group in group memberships"
6668
$GroupFound = $true
6769
}
6870
}

Modules/CippExtensions/Public/PwPush/New-PwPushLink.ps1

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@ function New-PwPushLink {
66
$Table = Get-CIPPTable -TableName Extensionsconfig
77
$Configuration = ((Get-CIPPAzDataTableEntity @Table).config | ConvertFrom-Json).PWPush
88
if ($Configuration.Enabled -eq $true) {
9-
Set-PwPushConfig -Configuration $Configuration
10-
$PushParams = @{
11-
Payload = $Payload
12-
}
13-
if ($Configuration.ExpireAfterDays) { $PushParams.ExpireAfterDays = $Configuration.ExpireAfterDays }
14-
if ($Configuration.ExpireAfterViews) { $PushParams.ExpireAfterViews = $Configuration.ExpireAfterViews }
15-
if ($Configuration.DeletableByViewer) { $PushParams.DeletableByViewer = $Configuration.DeletableByViewer }
16-
if ($Configuration.AccountId) { $PushParams.AccountId = $Configuration.AccountId.value }
179
try {
10+
Set-PwPushConfig -Configuration $Configuration
11+
$PushParams = @{
12+
Payload = $Payload
13+
}
14+
if ($Configuration.ExpireAfterDays) { $PushParams.ExpireAfterDays = $Configuration.ExpireAfterDays }
15+
if ($Configuration.ExpireAfterViews) { $PushParams.ExpireAfterViews = $Configuration.ExpireAfterViews }
16+
if ($Configuration.DeletableByViewer) { $PushParams.DeletableByViewer = $Configuration.DeletableByViewer }
17+
if ($Configuration.AccountId) { $PushParams.AccountId = $Configuration.AccountId.value }
18+
1819
if ($PSCmdlet.ShouldProcess('Create a new PwPush link')) {
1920
$Link = New-Push @PushParams
2021
if ($Configuration.RetrievalStep) {

Modules/PassPushPosh/1.3.1/PSGetModuleInfo.xml renamed to Modules/PassPushPosh/1.3.2/PSGetModuleInfo.xml

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
</TN>
88
<MS>
99
<S N="Name">PassPushPosh</S>
10-
<S N="Version">1.2.0</S>
10+
<S N="Version">1.3.2</S>
1111
<S N="Type">Module</S>
1212
<S N="Description">PassPushPosh is a PowerShell Module for accessing the Password Pusher application via API. It supports creating, retrieving, and deleting anonymous and authenticated pushes and getting Push and Dashboard data for authenticated users.</S>
1313
<S N="Author">Adam Burley</S>
1414
<S N="CompanyName">AdamBurley</S>
1515
<S N="Copyright">Adam Burley, 2022</S>
16-
<DT N="PublishedDate">2025-02-06T18:21:26-05:00</DT>
16+
<DT N="PublishedDate">2025-03-01T20:45:35-05:00</DT>
1717
<Nil N="InstalledDate" />
1818
<Nil N="UpdatedDate" />
1919
<URI N="LicenseUri">https://www.gnu.org/licenses/gpl-3.0.en.html</URI>
@@ -41,12 +41,24 @@
4141
</TN>
4242
<DCT>
4343
<En>
44-
<S N="Key">DscResource</S>
44+
<S N="Key">Workflow</S>
4545
<Obj N="Value" RefId="3">
4646
<TNRef RefId="1" />
4747
<LST />
4848
</Obj>
4949
</En>
50+
<En>
51+
<S N="Key">RoleCapability</S>
52+
<Ref N="Value" RefId="3" />
53+
</En>
54+
<En>
55+
<S N="Key">DscResource</S>
56+
<Ref N="Value" RefId="3" />
57+
</En>
58+
<En>
59+
<S N="Key">Cmdlet</S>
60+
<Ref N="Value" RefId="3" />
61+
</En>
5062
<En>
5163
<S N="Key">Function</S>
5264
<Obj N="Value" RefId="4">
@@ -55,6 +67,7 @@
5567
<S>Get-Dashboard</S>
5668
<S>Get-Push</S>
5769
<S>Get-PushAccount</S>
70+
<S>Get-PushApiVersion</S>
5871
<S>Get-PushAuditLog</S>
5972
<S>Get-SecretLink</S>
6073
<S>Initialize-PassPushPosh</S>
@@ -63,14 +76,6 @@
6376
</LST>
6477
</Obj>
6578
</En>
66-
<En>
67-
<S N="Key">RoleCapability</S>
68-
<Ref N="Value" RefId="3" />
69-
</En>
70-
<En>
71-
<S N="Key">Workflow</S>
72-
<Ref N="Value" RefId="3" />
73-
</En>
7479
<En>
7580
<S N="Key">Command</S>
7681
<Obj N="Value" RefId="5">
@@ -79,6 +84,7 @@
7984
<S>Get-Dashboard</S>
8085
<S>Get-Push</S>
8186
<S>Get-PushAccount</S>
87+
<S>Get-PushApiVersion</S>
8288
<S>Get-PushAuditLog</S>
8389
<S>Get-SecretLink</S>
8490
<S>Initialize-PassPushPosh</S>
@@ -87,14 +93,10 @@
8793
</LST>
8894
</Obj>
8995
</En>
90-
<En>
91-
<S N="Key">Cmdlet</S>
92-
<Ref N="Value" RefId="3" />
93-
</En>
9496
</DCT>
9597
</Obj>
9698
<Nil N="PowerShellGetFormatVersion" />
97-
<S N="ReleaseNotes">1.2.0 - Add compatibility with Premium and Pro API endpoints and branding._x000D__x000A_ 1.0.0 - Major refactor, add capabilities and improve testing and build process._x000D__x000A_ 0.3.0 - Remove route translations from URI segments for compatibility with PasswordPusher v1.42.0. See pglombardo/PasswordPusher/pull/2353</S>
99+
<S N="ReleaseNotes">1.3.2 - Bug fix for push JSON changes, add Version endpoint_x000D__x000A_ 1.2.0 - Add compatibility with Premium and Pro API endpoints and branding._x000D__x000A_ 1.0.0 - Major refactor, add capabilities and improve testing and build process._x000D__x000A_ 0.3.0 - Remove route translations from URI segments for compatibility with PasswordPusher v1.42.0. See pglombardo/PasswordPusher/pull/2353</S>
98100
<Obj N="Dependencies" RefId="6">
99101
<TNRef RefId="1" />
100102
<LST />
@@ -111,19 +113,19 @@
111113
<S N="copyright">Adam Burley, 2022</S>
112114
<S N="description">PassPushPosh is a PowerShell Module for accessing the Password Pusher application via API. It supports creating, retrieving, and deleting anonymous and authenticated pushes and getting Push and Dashboard data for authenticated users.</S>
113115
<S N="requireLicenseAcceptance">False</S>
114-
<S N="releaseNotes">1.2.0 - Add compatibility with Premium and Pro API endpoints and branding._x000D__x000A_ 1.0.0 - Major refactor, add capabilities and improve testing and build process._x000D__x000A_ 0.3.0 - Remove route translations from URI segments for compatibility with PasswordPusher v1.42.0. See pglombardo/PasswordPusher/pull/2353</S>
116+
<S N="releaseNotes">1.3.2 - Bug fix for push JSON changes, add Version endpoint_x000D__x000A_ 1.2.0 - Add compatibility with Premium and Pro API endpoints and branding._x000D__x000A_ 1.0.0 - Major refactor, add capabilities and improve testing and build process._x000D__x000A_ 0.3.0 - Remove route translations from URI segments for compatibility with PasswordPusher v1.42.0. See pglombardo/PasswordPusher/pull/2353</S>
115117
<S N="isLatestVersion">True</S>
116118
<S N="isAbsoluteLatestVersion">True</S>
117-
<S N="versionDownloadCount">2</S>
118-
<S N="downloadCount">221</S>
119-
<S N="packageSize">14279</S>
120-
<S N="published">2/6/2025 6:21:26 PM -05:00</S>
121-
<S N="created">2/6/2025 6:21:26 PM -05:00</S>
122-
<S N="lastUpdated">2/6/2025 6:40:00 PM -05:00</S>
123-
<S N="tags">PSEdition_Core Windows Linux MacOS Password PSModule PSFunction_Get-Dashboard PSCommand_Get-Dashboard PSFunction_Get-Push PSCommand_Get-Push PSFunction_Get-PushAccount PSCommand_Get-PushAccount PSFunction_Get-PushAuditLog PSCommand_Get-PushAuditLog PSFunction_Get-SecretLink PSCommand_Get-SecretLink PSFunction_Initialize-PassPushPosh PSCommand_Initialize-PassPushPosh PSFunction_New-Push PSCommand_New-Push PSFunction_Remove-Push PSCommand_Remove-Push PSIncludes_Function</S>
119+
<S N="versionDownloadCount">4</S>
120+
<S N="downloadCount">247</S>
121+
<S N="packageSize">16233</S>
122+
<S N="published">3/1/2025 8:45:35 PM -05:00</S>
123+
<S N="created">3/1/2025 8:45:35 PM -05:00</S>
124+
<S N="lastUpdated">3/2/2025 9:40:00 AM -05:00</S>
125+
<S N="tags">PSEdition_Core Windows Linux MacOS Password PSModule PSFunction_Get-Dashboard PSCommand_Get-Dashboard PSFunction_Get-Push PSCommand_Get-Push PSFunction_Get-PushAccount PSCommand_Get-PushAccount PSFunction_Get-PushApiVersion PSCommand_Get-PushApiVersion PSFunction_Get-PushAuditLog PSCommand_Get-PushAuditLog PSFunction_Get-SecretLink PSCommand_Get-SecretLink PSFunction_Initialize-PassPushPosh PSCommand_Initialize-PassPushPosh PSFunction_New-Push PSCommand_New-Push PSFunction_Remove-Push PSCommand_Remove-Push PSIncludes_Function</S>
124126
<S N="developmentDependency">False</S>
125-
<S N="updated">2025-02-06T18:40:00Z</S>
126-
<S N="NormalizedVersion">1.2.0</S>
127+
<S N="updated">2025-03-02T09:40:00Z</S>
128+
<S N="NormalizedVersion">1.3.2</S>
127129
<S N="Authors">Adam Burley</S>
128130
<S N="IsPrerelease">false</S>
129131
<S N="ItemType">Module</S>
@@ -133,7 +135,7 @@
133135
<S N="CompanyName">Burley.dev</S>
134136
</MS>
135137
</Obj>
136-
<S N="InstalledLocation">C:\GitHub\CIPP Workspace\CIPP-API\Modules\PassPushPosh\1.2.0</S>
138+
<S N="InstalledLocation">C:\GitHub\CIPP Workspace\CIPP-API\Modules\PassPushPosh\1.3.2</S>
137139
</MS>
138140
</Obj>
139141
</Objs>

Modules/PassPushPosh/1.3.1/PassPushPosh.psd1 renamed to Modules/PassPushPosh/1.3.2/PassPushPosh.psd1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Generated by: Adam Burley
55
#
6-
# Generated on: 2/21/2025
6+
# Generated on: 3/1/2025
77
#
88

99
@{
@@ -12,7 +12,7 @@
1212
RootModule = 'PassPushPosh.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '1.3.1'
15+
ModuleVersion = '1.3.2'
1616

1717
# Supported PSEditions
1818
CompatiblePSEditions = 'Core'
@@ -69,7 +69,7 @@ PowerShellVersion = '7.0'
6969
# NestedModules = @()
7070

7171
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
72-
FunctionsToExport = @('Get-Dashboard','Get-Push','Get-PushAccount','Get-PushAuditLog','Get-SecretLink','Initialize-PassPushPosh','New-Push','Remove-Push')
72+
FunctionsToExport = @('Get-Dashboard','Get-Push','Get-PushAccount','Get-PushApiVersion','Get-PushAuditLog','Get-SecretLink','Initialize-PassPushPosh','New-Push','Remove-Push')
7373

7474
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
7575
CmdletsToExport = @()
@@ -108,6 +108,7 @@ PrivateData = @{
108108

109109
# ReleaseNotes of this module
110110
ReleaseNotes = '
111+
1.3.2 - Bug fix for push JSON changes, add Version endpoint
111112
1.2.0 - Add compatibility with Premium and Pro API endpoints and branding.
112113
1.0.0 - Major refactor, add capabilities and improve testing and build process.
113114
0.3.0 - Remove route translations from URI segments for compatibility with PasswordPusher v1.42.0. See pglombardo/PasswordPusher/pull/2353'

Modules/PassPushPosh/1.3.1/PassPushPosh.psm1 renamed to Modules/PassPushPosh/1.3.2/PassPushPosh.psm1

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ $ExportableTypes =@(
6464
$TypeAcceleratorsClass = [psobject].Assembly.GetType(
6565
'System.Management.Automation.TypeAccelerators'
6666
)
67+
<#
6768
# Ensure none of the types would clobber an existing type accelerator.
6869
# If a type accelerator with the same name exists, throw an exception.
6970
$ExistingTypeAccelerators = $TypeAcceleratorsClass::Get
@@ -81,10 +82,12 @@ foreach ($Type in $ExportableTypes) {
8182
$Type.FullName
8283
)
8384
}
84-
}
85+
}#>
8586
# Add type accelerators for every exportable type.
8687
foreach ($Type in $ExportableTypes) {
88+
try {
8789
$TypeAcceleratorsClass::Add($Type.FullName, $Type)
90+
} catch {}
8891
}
8992
# Remove type accelerators when the module is removed.
9093
($MyInvocation.MyCommand.ScriptBlock.Module.OnRemove = {
@@ -278,7 +281,7 @@ function New-PasswordPusherUserAgent {
278281
Write-Debug "$userAtDomain transformed to $uAD64. First 20 characters $($uAD64.Substring(0,20))"
279282

280283
# Version tag is replaced by the semantic version number at build time. See PassPushPosh/issues/11 for context
281-
"PassPushPosh/1.3.1 $osVersion/$($uAD64.Substring(0,20))"
284+
"PassPushPosh/1.3.2 $osVersion/$($uAD64.Substring(0,20))"
282285
}
283286
#EndRegion '.\Private\New-PasswordPusherUserAgent.ps1' 14
284287
#Region '.\Public\Get-Dashboard.ps1' -1
@@ -457,6 +460,16 @@ function Get-PushAccount {
457460
}
458461
}
459462
#EndRegion '.\Public\Get-PushAccount.ps1' 22
463+
#Region '.\Public\Get-PushApiVersion.ps1' -1
464+
465+
function Get-PushApiVersion {
466+
[CmdletBinding()]
467+
[OutputType([PSCustomObject])]
468+
param()
469+
Initialize-PassPushPosh -Verbose:$VerbosePreference -Debug:$DebugPreference
470+
Invoke-PasswordPusherAPI -Endpoint 'api/v1/version.json'
471+
}
472+
#EndRegion '.\Public\Get-PushApiVersion.ps1' 8
460473
#Region '.\Public\Get-PushAuditLog.ps1' -1
461474

462475
<#
@@ -736,9 +749,9 @@ function Initialize-PassPushPosh {
736749
}
737750
}
738751
'Automatic' {
739-
Write-Debug 'Legacy auth status not specified Checking for /up'
740-
if ((Invoke-WebRequest "$_baseUrl/up" -SkipHttpErrorCheck).StatusCode -eq 200) {
741-
Write-Debug "Current version detected via /up"
752+
Write-Debug 'Legacy auth status not specified Checking for /version'
753+
if ((Invoke-RestMethod "$_baseUrl/api/v1/version.json" -SkipHttpErrorCheck).Api_Version -gt 1.0) {
754+
Write-Debug "Current version detected via /version"
742755
Set-Variable -Scope Script -Name PPPHeaders -WhatIf:$false -Value @{
743756
'Authorization' = "Bearer $_apiKey"
744757
}

0 commit comments

Comments
 (0)