Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions build/scripts/NewBcContainer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,64 @@ if ($platformVersion) {

New-BcContainer @parameters

if ($parameters.auth -in @('UserPassword', 'NavUserPassword')) {
if (-not $parameters.credential) {
throw "The BCApps UserPassword test container requires a credential."
}

$apiTestPasswordFile = 'C:\Run\my\ApiTestPassword'
$apiTestPassword = $parameters.credential.GetNetworkCredential().Password
$hostPasswordFile = Join-Path ([System.IO.Path]::GetTempPath()) "BCAppsApiTestPassword-$([Guid]::NewGuid().ToString('N'))"
try {
[System.IO.File]::WriteAllText($hostPasswordFile, $apiTestPassword)

try {
Copy-FileToBcContainer -containerName $parameters.ContainerName -localPath $hostPasswordFile -containerPath $apiTestPasswordFile
Invoke-ScriptInBcContainer -containerName $parameters.ContainerName -argumentList $apiTestPasswordFile -scriptblock {
param(
[string]$FilePath
)

$fileSecurity = [System.Security.AccessControl.FileSecurity]::new()
$fileSecurity.SetAccessRuleProtection($true, $false)
foreach ($accessEntry in @(
@{ Sid = 'S-1-5-18'; Rights = [System.Security.AccessControl.FileSystemRights]::FullControl },
@{ Sid = 'S-1-5-20'; Rights = [System.Security.AccessControl.FileSystemRights]::Read },
@{ Sid = 'S-1-5-32-544'; Rights = [System.Security.AccessControl.FileSystemRights]::FullControl }
)) {
$identity = [System.Security.Principal.SecurityIdentifier]::new($accessEntry.Sid)
$accessRule = [System.Security.AccessControl.FileSystemAccessRule]::new(
$identity,
$accessEntry.Rights,
[System.Security.AccessControl.AccessControlType]::Allow)
$fileSecurity.AddAccessRule($accessRule)
}
Set-Acl -LiteralPath $FilePath -AclObject $fileSecurity
}
}
catch {
$originalError = $_
try {
Invoke-ScriptInBcContainer -containerName $parameters.ContainerName -argumentList $apiTestPasswordFile -scriptblock {
param(
[string]$FilePath
)

Remove-Item -LiteralPath $FilePath -Force -ErrorAction SilentlyContinue
}
}
catch {
Write-Warning "Could not remove the API test credential file after setup failed."
}
throw $originalError
}
}
finally {
Remove-Item -LiteralPath $hostPasswordFile -Force -ErrorAction SilentlyContinue
Clear-Variable apiTestPassword -ErrorAction SilentlyContinue
}
}

Set-BcContainerServerConfiguration -containerName $parameters.ContainerName -keyName "EnforceUserPathForAlFileOperations" -keyValue "false"
Set-BcContainerServerConfiguration -containerName $parameters.ContainerName -keyName "UsePermissionSetsFromExtensions" -keyValue "true"
Restart-BcContainer -containerName $parameters.ContainerName
Expand Down
5 changes: 5 additions & 0 deletions src/Apps/US/IRSForms/test/src/IRS1099APITests.Codeunit.al
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ codeunit 148018 "IRS 1099 API Tests"
TestType = Uncategorized;
TestPermissions = Disabled;

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
end;

var
LibraryTestInitialize: Codeunit "Library - Test Initialize";
LibraryGraphMgt: Codeunit "Library - Graph Mgt";
Expand Down
1 change: 1 addition & 0 deletions src/Apps/W1/APIV1/test/src/APIV1AccountsE2E.Codeunit.al
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ codeunit 139701 "APIV1 - Accounts E2E"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [Account]
end;

Expand Down
1 change: 1 addition & 0 deletions src/Apps/W1/APIV1/test/src/APIV1AgedAPE2E.Codeunit.al
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ codeunit 139719 "APIV1 - Aged AP E2E"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [Purchase] [Aged Report]
end;

Expand Down
1 change: 1 addition & 0 deletions src/Apps/W1/APIV1/test/src/APIV1AgedARE2E.Codeunit.al
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ codeunit 139720 "APIV1 - Aged AR E2E"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [Sales] [Aged Report]
end;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ codeunit 139733 "APIV1 - Attachments E2E"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [Attachment]
end;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ codeunit 139731 "APIV1 - Automation RS Package"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [Config. Package]
end;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ codeunit 139715 "APIV1 - Balance Sheet E2E"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [Balance Sheet]
end;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ codeunit 139717 "APIV1 - CashFlow Statement E2E"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [Cash Flow Statement]
end;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ codeunit 139706 "APIV1 - Company Info. E2E"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [Company Information]
end;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ codeunit 139713 "APIV1 - Currencies E2E"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [Currency]
end;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ codeunit 139743 "APIV1 - Customer Payments E2E"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [Customer Payments]
end;

Expand Down
1 change: 1 addition & 0 deletions src/Apps/W1/APIV1/test/src/APIV1CustomersE2E.Codeunit.al
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ codeunit 139702 "APIV1 - Customers E2E"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [Customer]
end;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ codeunit 139732 "APIV1 - Default Dimensions E2E"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [Default Dimension]
end;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ codeunit 139725 "APIV1 - Dimension Lines E2E"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [Dimension Line]
end;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ codeunit 139724 "APIV1 - Dimensions E2E"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [Dimension]
end;

Expand Down
1 change: 1 addition & 0 deletions src/Apps/W1/APIV1/test/src/APIV1EmployeesE2E.Codeunit.al
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ codeunit 139722 "APIV1 - Employees E2E"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [Employee]
end;

Expand Down
1 change: 1 addition & 0 deletions src/Apps/W1/APIV1/test/src/APIV1GLEntriesE2E.Codeunit.al
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ codeunit 139730 "APIV1 - GLEntries E2E"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [G/L Entry]
end;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ codeunit 139716 "APIV1 - Income Statement E2E"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [Income Statement]
end;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ codeunit 139707 "APIV1 - Item Categories E2E"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [Item Category]
end;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ codeunit 139739 "APIV1 - Item Variants E2E"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [Item] [Variant]
end;

Expand Down
1 change: 1 addition & 0 deletions src/Apps/W1/APIV1/test/src/APIV1ItemsE2E.Codeunit.al
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ codeunit 139700 "APIV1 - Items E2E"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [Item]
end;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ codeunit 139745 "APIV1 - Journal Lines E2E"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [JournalLines]
end;

Expand Down
1 change: 1 addition & 0 deletions src/Apps/W1/APIV1/test/src/APIV1JournalsE2E.Codeunit.al
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ codeunit 139727 "APIV1 - Journals E2E"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [Journal]
end;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ codeunit 139744 "APIV1 - PDF Document E2E"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [PDF]
end;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ codeunit 139704 "APIV1 - Payment Terms E2E"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [Payment Terms]
end;

Expand Down
1 change: 1 addition & 0 deletions src/Apps/W1/APIV1/test/src/APIV1PicturesE2E.Codeunit.al
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ codeunit 139742 "APIV1 - Pictures E2E"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [Image]
end;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ codeunit 139738 "APIV1 - Purchase Inv Lines E2E"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [Purchase] [Invoice]
end;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ codeunit 139729 "APIV1 - Purchase Invoices E2E"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [Purchase] [Invoice]
end;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ codeunit 139721 "APIV1 - Ret. Earnings E2E"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [Retained Earnings]
end;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ codeunit 139737 "APIV1 - Sales CrMemo Lines E2E"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [Sales] [Credit Memo]
end;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ codeunit 139728 "APIV1 - Sales Credit Memos E2E"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [Sales] [Credit Memo]
end;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ codeunit 139734 "APIV1 - Sales Inv. Lines E2E"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [Sales] [Invoice]
end;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ codeunit 139735 "APIV1 - Sales Order Lines E2E"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [Sales] [Order]
end;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ codeunit 139711 "APIV1 - Sales Orders E2E"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [Sales] [Order]
end;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ codeunit 139736 "APIV1 - Sales Quote Lines E2E"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [Sales] [Quote]
end;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ codeunit 139723 "APIV1 - Sales Quotes E2E"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [Sales] [Quote]
end;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ codeunit 139705 "APIV1 - Shipment Methods E2E"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [Shipment Method]
end;

Expand Down
1 change: 1 addition & 0 deletions src/Apps/W1/APIV1/test/src/APIV1TaxAreasE2E.Codeunit.al
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ codeunit 139726 "APIV1 - Tax Areas E2E"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [Tax Area]
end;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ codeunit 139718 "APIV1 - Trial Balance E2E"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [Trial Balance]
end;

Expand Down
1 change: 1 addition & 0 deletions src/Apps/W1/APIV1/test/src/APIV1UofME2E.Codeunit.al
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ codeunit 139712 "APIV1 - UofM E2E"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [Unit of Measure]
end;

Expand Down
1 change: 1 addition & 0 deletions src/Apps/W1/APIV1/test/src/APIV1VendorsE2E.Codeunit.al
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ codeunit 139703 "APIV1 - Vendors E2E"

trigger OnRun()
begin
LibraryGraphMgt.BindAuthentication();
// [FEATURE] [Graph] [Vendor]
end;

Expand Down
Loading
Loading