Skip to content

Extract IsSPOG and ResolveConfigType into libs/auth#4939

Open
mihaimitrea-db wants to merge 2 commits intomihaimitrea-db/fix-profiles-spog-classificationfrom
mihaimitrea-db/extract-resolve-config-type
Open

Extract IsSPOG and ResolveConfigType into libs/auth#4939
mihaimitrea-db wants to merge 2 commits intomihaimitrea-db/fix-profiles-spog-classificationfrom
mihaimitrea-db/extract-resolve-config-type

Conversation

@mihaimitrea-db
Copy link
Copy Markdown
Contributor

Summary

  • Extract the SPOG detection heuristic into a shared IsSPOG(cfg, accountID) predicate in libs/auth/config_type.go, replacing inline checks in both profiles.go and ToOAuthArgument.
  • Extract ResolveConfigType(cfg) that wraps ConfigType() with SPOG-aware overrides, used by profiles.go.
  • ToOAuthArgument now calls IsSPOG instead of duplicating the DiscoveryURL + IsUnifiedHost checks inline.

Follow-up to #4929 as suggested in review comment #2 (logic duplication).

Test plan

  • TestResolveConfigType — 9-case table-driven unit test in libs/auth/config_type_test.go.
  • All existing TestProfileLoad* and TestToOAuthArgument* tests pass.
  • go test ./libs/auth/ ./cmd/auth/ passes.

Deduplicate SPOG detection logic between profiles.go and
ToOAuthArgument. IsSPOG checks DiscoveryURL and IsUnifiedHost,
ResolveConfigType wraps ConfigType with SPOG-aware overrides.
@github-actions
Copy link
Copy Markdown

Approval status: pending

/cmd/auth/ - needs approval

Files: cmd/auth/profiles.go
Suggested: @simonfaltum
Also eligible: @tanmay-db, @renaudhartert-db, @tejaskochar-db, @hectorcast-db, @parthban-db, @Divyansh-db, @chrisst, @rauchy

/libs/auth/ - needs approval

Files: libs/auth/arguments.go, libs/auth/config_type.go, libs/auth/config_type_test.go
Suggested: @simonfaltum
Also eligible: @tanmay-db, @renaudhartert-db, @tejaskochar-db, @hectorcast-db, @parthban-db, @Divyansh-db, @chrisst, @rauchy

Any maintainer (@andrewnester, @anton-107, @denik, @pietern, @shreyas-goenka, @simonfaltum, @renaudhartert-db) can approve all areas.
See OWNERS for ownership rules.

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.

1 participant