VC-60045: Add workspace support to the NGTS connector - #228
Open
eunenbat-panw wants to merge 1 commit into
Open
eunenbat-panw wants to merge 1 commit into
eunenbat-panw wants to merge 1 commit into
Conversation
NGTS calls can now be scoped to a workspace. When set, every NGTS API and GraphQL request carries a workspace_id query parameter; with no workspace, requests are unchanged. - NGTSConnection: optional workspace argument and set_workspace(). The workspace is applied in one place for REST and GraphQL, merging with any existing query string. It is not sent to the OAuth token endpoint, which ignores it. - Workspace IDs must be numeric (1-10 digits); invalid values raise ClientBadData before any request is sent. - set_policy raises ClientBadData on a workspace-scoped connection: issuing templates belong to the tenant and are read-only within a workspace. - venafi_connection(workspace=...) passes the workspace to NGTS and raises VenafiError if it would reach a non-NGTS connector. - Round-trip policy test sets serviceGenerated=False (required by NGTS to create a template) and no longer asserts max_valid_days, which never reads back due to a pre-existing parsing bug. - README-NGTS.md Workspaces section and 0.23.0 version history entry. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
eunenbat-panw
requested review from
luispresuelVenafi and
tr1ck3r
as code owners
September 24, 2026 22:13
eunenbat-panw
requested review from
SahilWikhe-sw,
anapatil-panw,
ndevarapalli-panw and
sbanic-panw
September 24, 2026 23:27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
VC-60045: Add workspace support to the NGTS connector
Summary
Adds optional workspace scoping to the Palo Alto Networks NGTS connector. When a workspace is set, every NGTS API and GraphQL request carries
workspace_id=<id>, so certificate operations run in that workspace. When no workspace is set, behaviour is unchanged.Companion to VC-60044 (vcert Go).
Usage
What changed
NGTSConnectionworkspaceargument and aset_workspace()method.workspace_idquery parameter in one place, which covers REST and GraphQL. Any existing query parameters are kept.ClientBadDatabefore any request is sent.set_policyinside a workspace: raisesClientBadDatawith a clear message. Issuing templates belong to the tenant and are read-only within a workspace, so NGTS would reject the write with 403/1002 anyway.venafi_connection(workspace=...): passes the workspace to NGTS, and raisesVenafiErrorif the workspace would end up on a non-NGTS connector, so it's never silently dropped.README-NGTS.mdhas a new Workspaces section, anddocs/version_history.mdhas a 0.23.0 entry.Backward compatibility
workspaceis optional and was added as the last argument, so existing calls are unaffected.master. This was checked by recording the requests on both branches.master's unmodified offline tests pass against this branch.Testing
set_policyguardNGTS_WORKSPACE=1000: 8 passed, 2 skipped (revoke; the policy round-trip, which needs tenant level).NGTS_WORKSPACEis optional in the live suite, so leaving it unset still tests the default path.Also included
test_ngts_set_get_policy_roundtripnow setsserviceGenerated=False, which NGTS requires to create a template. The test no longer checksmax_valid_days, because that value never reads back (a separate, pre-existing bug).Known issues (existing, not addressed here)
set_policyreplaces the whole template, andconsumerTsgIdsisn't part of the policy spec, so an update removes the template from every workspace. The fix is planned as a follow-up.get_policydoesn't round-trip intoset_policyin two cases:domains: [".*"]is escaped into a restrictive regex.maxValidDaysalways reads back asNone, because the parser looks at the top level while the value is stored underproduct.🤖 Generated with Claude Code