Updated discovery stream access#140
Open
rsaha-qlik wants to merge 14 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds discovery-time stream accessibility probing so streams that the provided credentials can’t access are excluded from the generated Singer catalog (instead of failing later during sync).
Changes:
- Added per-stream probe configuration and
check_stream_access()to test access during discovery. - Updated
discover()to filter inaccessible streams (and exclude child streams when their parent is inaccessible). - Added unit tests for access probing + discovery filtering, and bumped version/changelog.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
tap_mambu/helpers/discover.py |
Adds probe config + access-checking logic and updates discovery to exclude inaccessible streams. |
tap_mambu/__init__.py |
Passes the instantiated client into discovery. |
tests/unittests/test_discover.py |
New unit tests covering stream probing behavior and discovery filtering rules. |
setup.py |
Bumps package version to 4.7.0. |
CHANGELOG.md |
Adds 4.7.0 entry describing discovery-time access checks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…nger-io/tap-mambu into SAC-30946-discovery-auth-perm
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…nger-io/tap-mambu into SAC-30946-discovery-auth-perm
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.
Description of change
Summary
Added discovery-time access checks to
tap-mambuso that streams the API credentials cannot access are excluded from the catalog rather than causing a runtime error.Changes
tap_mambu/helpers/discover.pySTREAM_PROBE_CONFIG— a static mapping of each stream to its probe parameters (method,path,version,apikey_type). Child streams (cards,loan_repayments) are marked with aparentkey instead of a direct probe config.check_stream_access(client, stream_name) -> bool:pageSize=1)FalseonMambuUnauthorizedError,MambuForbiddenError, orMambuNoAuditApikeyInConfigTrueon any otherMambuError(server responded → credentials are valid)discover()→discover(client):tap_mambu/__init__.pydo_discover()to accept and passclienttodiscover(client)tests/unittests/test_discover.py(new file)TestCheckStreamAccess: covers accessible (True), 401/403/missing-audit-key (False), non-authMambuErrorfallback (True), GET vs POST method selection,auditapikey type,v1version,pageSize=1param, re-raise of non-Mambu errorsTestDiscover: all accessible, inaccessible stream excluded, child stream excluded/included based on parent accessibility, child streams never probed directly, warning logged for excluded streams, all-inaccessible raises exception, incremental replication key markedautomaticin metadataCHANGELOG.md4.7.0entryTesting
Manual QA steps
Risks
Rollback steps
AI generated code
https://internal.qlik.dev/general/ways-of-working/code-reviews/#guidelines-for-ai-generated-code