Skip to content

Clarify or remove get_auth() methods on APICAuth/CatalystCenterAuth/SDWANManagerAuth (currently only exercised by unit tests) #52

Description

@aitestino

Follow-up from #46.

Context

APICAuth.get_auth(), CatalystCenterAuth.get_auth(), and SDWANManagerAuth.get_auth() all resolve ControllerContext + credentials + verify_ssl and delegate to the respective get_token/get_session_auth/get_token_auth helpers.

Grep across src/, tests/, and the consumer repos (nac-sdwan-terraform, nac-catalystcenter-terraform, ACI-as-Code-Demo) shows they're only exercised by this package's own unit tests — no production code path calls any of them.

Pre-existing pattern (predates #46), flagged in that PR's review since the file was touched by the migration.

What to do

Two clean options:

  1. Keep them as a public API surface — document the intended external callers (or the intent) in the class docstrings, and add non-test-only coverage that reflects that use case. Otherwise it reads as ceremonial code with unit tests that only exist to keep it green.

  2. Remove them — along with the unit-test coverage that only exists to exercise them (TestAPIC.get_auth, TestCatalystCenter.get_auth, TestSDWAN.get_auth). The migration in refactor: replace direct env var reads with nac-test core controller resolvers #46 has the test bases resolve ControllerContext/credentials themselves and pass the pieces into the specific get_token/get_session_auth/get_token_auth methods — get_auth() is a wrapper for a call pattern nobody uses.

Either is fine; the current state (dead-in-production + test-only coverage) is the worst of both worlds.

P.S. — This comment was drafted using voice-to-text via Claude Code. If the tone comes across as overly direct or terse, please know that's just how it tends to phrase things. No offense or criticism is intended — this is purely an objective technical review of the PR. Thanks for understanding! 🙂

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions