Skip to content

[API tests] Default to web service key authentication - #12674

Draft
Prangshuman Das (t-prda) wants to merge 1 commit into
mainfrom
features/646383-stack-a-webkey-auth
Draft

Prangshuman Das (t-prda) wants to merge 1 commit into
mainfrom
features/646383-stack-a-webkey-auth

Conversation

@t-prda

@t-prda Prangshuman Das (t-prda) commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Review focus: MicrosoftTestAuthProvider (about 60 lines) and the enum default; the build/ changes are deletions plus the anti-SSRF line in NewBcContainer.ps1.

Defaults API test authentication (Library - Graph Mgt) to the current user's web service key. API tests no longer need per-app auth uptake or a container password.

  • API Test Authentication enum: DefaultImplementation = Microsoft Test Auth Provider. Removes No API Test Auth Provider and the explicit Microsoft Test Environment value.
  • Microsoft Test Auth Provider: on-premises with NavUserPassword, sends Basic auth with UserId() and the web service key. The key is created (24h expiry) when missing or expired and committed, because the API request runs in a separate server session.
  • Library - Graph Mgt: adds the SetLicenseSafeWorkDate and AddFieldToIgnoreIfExists helpers used by later layers.
  • Build: removes the container password and Key Vault credential plumbing (ApiTestCredential.psm1, Remove-ApiTestPassword.ps1, PipelineFinalize hooks and their tests). Keeps the clean-tenant execution logic. Sets NavHttpClientAntiSSRFEnabled=false in the test container, as NAV RunALTests.ps1 does: since Migrate API test libraries off Http Web Request Mgt. #12323, API tests call the container's own endpoint through AL HttpClient, which anti-SSRF blocks.
  • CU 139494 API Test Auth Provider Tests: covers key creation and renewal.

Related: AB#646383, AB#653393

Stack (each PR shows only its own layer; merge bottom first)

  1. [API tests] Default to web service key authentication #12674 A: web service key auth (base: main)
  2. [Expense tests] Re-enable Expense Agent API tests #12675 B: Expense API tests + clean test codeunit execution
  3. [API tests] Re-enable APIV1 and APIV2 API tests #12676 C: re-enable APIV1/APIV2 API tests
  4. Area fixes: [API tests] Ensure VAT posting setup in API document fixtures #12677 D1 VAT fixtures → [API tests] Ensure cancellation reason codes in API sales document tests #12678 D2 cancellation reasons → [API tests] Handle localized purchase invoice payment discounts in APIV1 tests #12679 D3 localized discounts → [API tests] Set sales quote document and posting dates in API tests #12680 D4 quote dates → [API tests] Assign a number series to API vendor payment journals #12681 D5 journal numbering → [API tests] Ignore localized fields in API document comparisons #12682 D6 field comparison → [API tests] Return shipment PDF selection and pdfDocument test isolation #12683 D7 PDF documents → [API tests] Improve APIV1 fixture and verification reliability #12684 D8 APIV1 reliability

Experiments (on D8, do not merge): #12685 E single tenant, #12686 F no clean execution. Combined validation (do not merge): #12687, same tree as D8.

Platform: main already pins BCPlatform 30.0.56112.0, which includes the SQL connection-pool fix (AB#653457).

Note for CI: AL-Go's new-warning check needs a CI/CD baseline from the base branch, and features/* bases have none, so a PR build there fails with a 404. The current CI runs were triggered while these PRs targeted main, so their results are valid for the cumulative change.

Authenticate API test requests with the current user's web service key and remove the
container password and Key Vault credential plumbing (ApiTestCredential, password cleanup,
PipelineFinalize hooks). Containers disable NavHttpClient anti-SSRF so API tests can call
the local server. Clean-tenant execution logic is unchanged. Adds the shared
SetLicenseSafeWorkDate and AddFieldToIgnoreIfExists helpers to Library - Graph Mgt.

AB#646383
AB#653393

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
@t-prda
Prangshuman Das (t-prda) force-pushed the features/646383-stack-a-webkey-auth branch from e8e2b21 to 3a7dc6e Compare October 12, 2026 11:28
@t-prda
Prangshuman Das (t-prda) added this pull request to stack #12697 October 12, 2026 15:38

This branch was successfully deployed

1 active (outdated) deployment
triage — e8e2b216 Deployed Oct 12, 2026 by t-prda via Classify team ownership #7443
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Build: scripts & configs Build scripts and configuration files Team: Integrations GitHub request for Integrations area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant