Skip to content

fix: preserve empty platform discovery configuration - #185

Open
Gambit-Checkmate wants to merge 1 commit into
b-long:mainfrom
Gambit-Checkmate:fix/preserve-empty-platform-configuration
Open

Gambit-Checkmate wants to merge 1 commit into
b-long:mainfrom
Gambit-Checkmate:fix/preserve-empty-platform-configuration

Conversation

@Gambit-Checkmate

Copy link
Copy Markdown

Summary

Fixes #183.

Only fall back to the top-level OpenTDF configuration when the nested configuration value is missing or None. An explicitly empty configuration now stays empty instead of allowing unrelated outer idp or platform_issuer fields to affect discovery.

The existing discovery error is preserved for an empty configuration. This does not add new response-type validation or change the handling of nonempty nested, top-level, or explicit-null configurations.

Tests

Add eight parameterized regression cases:

  • Empty nested configurations ignore either outer field, raise the existing AutoConfigureException, leave the token endpoint unset, and make no additional HTTP discovery request. Both cases fail with the original code.
  • Direct IDP endpoints and issuer-based discovery continue working with a missing wrapper, a null wrapper, and a nonempty nested configuration. The nested cases include conflicting outer values to verify precedence; every case checks the exact HTTP calls.

Local validation on Windows, Python 3.12.10, using the frozen dependency lock:

  • SDK unit tests: 244 passed, 41 integration tests deselected (baseline: 236 passed).
  • Proto package tests: 29 passed.
  • ruff check and ruff format --check: passed.
  • SDK source distribution and wheel build: passed; twine check passed for both artifacts.
  • git diff --check: passed.

The Docker-backed platform integration tests were not run locally because the Docker daemon is unavailable. The existing CI workflow covers those tests on Python 3.10–3.14.

AI assistance was used to implement, review, and test this contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Config discovery fallback breaks on empty configuration

1 participant