Skip to content

fix: close round-3 OAuth strict-proto config-field gaps (v0.2.4)#14

Merged
intel352 merged 1 commit into
mainfrom
fix/round-3-oauth-fields-v0.2.4
May 13, 2026
Merged

fix: close round-3 OAuth strict-proto config-field gaps (v0.2.4)#14
intel352 merged 1 commit into
mainfrom
fix/round-3-oauth-fields-v0.2.4

Conversation

@intel352
Copy link
Copy Markdown
Contributor

Summary

BMW v0.51.5 local smoke surfaced two OAuth strict-proto gaps the v0.2.3 sweep missed. Both involve fields BMW supplies via the step's config: block (templated at runtime, but strict-proto validates Config at build-time when templates are still unresolved literals).

  • OAuthProviderConfig: added string return_to = 11 (BMW's step.auth_oauth_start passes return_to: '{{ .return_to }}' in config).
  • OAuthProviderConfig: added string access_token = 12 (BMW's step.auth_oauth_userinfo passes access_token: '{{ index .steps "exchange_code" "access_token" }}' in config).

Handlers now prefer Config when non-empty, falling back to OAuthProviderInput (runtime input) — new oauthConfigOrCurrent helper enforces the rule.

Exhaustive third-pass BMW yaml audit of every step.auth_oauth_* config block confirmed these were the only two remaining gaps; provider and the google_oauth_* fields were already on the contract.

Test plan

  • go test ./... passes (full suite, including 7 new test cases)
  • go build ./cmd/workflow-plugin-auth succeeds
  • protoc regenerated internal/contracts/auth.pb.go from updated .proto
  • Test added: TestOAuthProviderConfig_AcceptsReturnToAndAccessToken (strict-proto acceptance across all 4 OAuth step types)
  • Tests added: TestOAuthStart_{UsesReturnToFromConfig, ConfigReturnToWinsOverCurrent, FallsBackToCurrentReturnTo} (handler precedence for return_to)
  • Tests added: TestOAuthUserinfo_{UsesAccessTokenFromConfig, ConfigAccessTokenWinsOverCurrent, FallsBackToCurrentAccessToken} (handler precedence for access_token via httptest Bearer assertion)
  • CI fixture .github/fixtures/workflow-compat.yaml exercises both new config fields on step.auth_oauth_start and step.auth_oauth_userinfo
  • plugin.json bumped 0.2.3 → 0.2.4 (download URLs updated)
  • CHANGELOG.md updated with v0.2.4 section

Closes the BMW v0.51.5 → workflow-plugin-auth strict-proto rejection chain for the OAuth pipelines (start + userinfo).

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

BMW v0.51.5 local smoke surfaced two OAuth gaps the v0.2.3 sweep missed:
both fields BMW supplies via the step's config: block (templated at
runtime, but strict-proto validates Config at build-time as unresolved
literals).

- OAuthProviderConfig: added `string return_to = 11`. BMW's
  step.auth_oauth_start passes `return_to: '{{ .return_to }}'` in
  config. Handler now prefers config.return_to when non-empty, falls
  back to current.return_to (OAuthProviderInput).
- OAuthProviderConfig: added `string access_token = 12`. BMW's
  step.auth_oauth_userinfo passes
  `access_token: '{{ index .steps "exchange_code" "access_token" }}'`
  in config. Handler now prefers config.access_token when non-empty,
  falls back to current.access_token (OAuthProviderInput).

New helper `oauthConfigOrCurrent(config, current, key)` enforces the
Config-when-non-empty rule. OAuthProviderInput remains valid for the
runtime-input shape; Config wins as tie-breaker.

Exhaustive BMW app.yaml audit of every step.auth_oauth_* config block
confirmed only `return_to` (start) and `access_token` (userinfo) were
the remaining gaps; provider + google_oauth_* fields are already on
the contract.

Tests:
- TestOAuthProviderConfig_AcceptsReturnToAndAccessToken — strict-proto
  acceptance across all 4 OAuth step types.
- TestOAuthStart_{UsesReturnToFromConfig,ConfigReturnToWinsOverCurrent,
  FallsBackToCurrentReturnTo} — start_oauth precedence.
- TestOAuthUserinfo_{UsesAccessTokenFromConfig,
  ConfigAccessTokenWinsOverCurrent,FallsBackToCurrentAccessToken} —
  userinfo precedence via httptest Bearer assertion.

CI fixture (.github/fixtures/workflow-compat.yaml) now exercises both
new config fields.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@intel352 intel352 merged commit f66e2db into main May 13, 2026
6 checks passed
@intel352 intel352 deleted the fix/round-3-oauth-fields-v0.2.4 branch May 13, 2026 12:52
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