feat(security_integration): complete custom OAuth field coverage - #63
Conversation
PR #37 landed custom OAuth (OAUTH_CLIENT = CUSTOM) but omitted four real CREATE SECURITY INTEGRATION options. Add them: oauth_allow_non_tls_redirect_uri, oauth_single_use_refresh_tokens_required, oauth_enable_role_selection, and oauth_any_role_mode (+ OAuthAnyRoleMode enum), wired through props, __init__, docstring, fetch, and the fixture so they round-trip. Also soften fetch_security_integration: an unmodeled integration type now logs a warning and returns None instead of raising, so one unknown integration can't break list/export. Add YAML-config and polymorphic-resolver tests.
…e partner OAuth Code-review caught that softening the fetch fallthrough to warn+None also swallowed partner OAuth (LOOKER/TABLEAU) -- which is modeled and declarable but has no fetch branch. Returning None made a declared partner integration look absent and plan a spurious CREATE every apply. Raise for partner OAuth; warn+None only for genuinely unmodeled types (SAML2/SCIM/EXTERNAL_OAUTH). Adds a test for each path.
Review of PR #63Reviewed the diff ( Notes on what I checked:
No over-engineering, no unsafe string interpolation, no privilege/grant logic touched. This is a small, additive, well-tested change. |
A live plan showed oauth_enable_role_selection drifting empty -> False every run: Snowflake accepts it at CREATE but DESC never echoes it back, so fetch always saw None while the spec default is False. Mark it fetchable=False (like oauth_alternate_redirect_uris) so it's excluded from the diff. The other three new fields do round-trip via DESC and are unchanged.
Review of PR #63Reviewed the diff ( No issues found:
Nothing else stood out — no injection risk (all new values flow through the existing typed |
What
Completes
SnowflakeCustomOAuthSecurityIntegration(OAUTH_CLIENT = CUSTOM). PR #37 landed the resource but omitted four realCREATE SECURITY INTEGRATIONoptions; this adds them so the full custom-OAuth surface round-trips:oauth_allow_non_tls_redirect_uri(bool, FALSE)oauth_single_use_refresh_tokens_required(bool, FALSE)oauth_enable_role_selection(bool, FALSE)oauth_any_role_mode(DISABLE/ENABLE/ENABLE_FOR_PRIVILEGE, DISABLE) + newOAuthAnyRoleModeenumEach is wired through the spec,
Props,__init__, docstring,fetch_security_integration, and the JSON fixture. Verified against the Snowflake docs that all four are valid forOAUTH_CLIENT = CUSTOM.Also
fetch_security_integration: a security integration type snowcap doesn't model (SAML2/SCIM/EXTERNAL_OAUTH) now logs a warning and returnsNoneinstead of raising, so one unmodeled integration can't breaklist/export. Partner OAuth (LOOKER/TABLEAU) still raises — it's modeled and declarable but not fetchable, so returningNonewould make a declared resource look absent and churn a spuriousCREATE(caught in review).ALTER SECURITY INTEGRATION ... SET; onlyoauth_client_typetriggers replacement (fails the plan, doesn't rotate credentials).Tests
YAML-config resolver test, polymorphic resolver test, fetch round-trip for the new fields, and separate tests pinning the warn+None (unmodeled) vs raise (partner OAuth) paths.
create_sqland fixture identity updated. Full gate green: black, ruff, codespell, mypy, 2053 passed. Integration tests need a live account (skipped here).Reviews
code-review + ponytail run per request; the one real finding (partner-OAuth swallowed by the softened error) is fixed.