Skip to content

Add Google Search Console OAuth connection foundation #140

Closed as not planned

Description

@PascaleBeier

Parent

#139

What to build

Add the first PR boundary for Google Search Console: config, team-level OAuth connection storage, safe status/connect/callback/disconnect APIs, audit events, and a basic dashboard integration page route for disconnected, connected, and missing-credential states.

Use TDD with red-green-refactor tracer bullets. Do not implement behavior before a failing behavior test exists.

Acceptance criteria

  • Add HITKEEP_GOOGLE_SEARCH_CONSOLE_CLIENT_ID, HITKEEP_GOOGLE_SEARCH_CONSOLE_CLIENT_SECRET, and HITKEEP_GOOGLE_SEARCH_CONSOLE_REDIRECT_URL config fields, with the client secret treated as sensitive.
  • Default the redirect URL to ${HITKEEP_PUBLIC_URL}/api/integrations/google-search-console/oauth/callback when unset.
  • Add control-plane storage for team-level connection metadata and token material.
  • Add OAuth state validation that binds authenticated user, team, redirect target, and CSRF protection.
  • Add status, connect, callback, and disconnect APIs for team-level Google Search Console connection management.
  • Request only https://www.googleapis.com/auth/webmasters.readonly.
  • Store connection metadata on mocked successful callback and append safe team audit entries for connect success/failure and disconnect.
  • Add /integration/google-search-console outside share mode with disconnected, connected, and missing-credentials states.
  • Keep google.golang.org/api/searchconsole/v1 behind an internal adapter; generated Google types must not leak outside that adapter.
  • No token, OAuth code, or client secret appears in API responses, logs, or audit details.

TDD tracer bullets

  • RED: self-hosted status reports credentials_missing without echoing configured values. GREEN: config diagnostics only.
  • RED: connect returns a read-only OAuth URL when credentials are configured. GREEN: OAuth URL builder and endpoint.
  • RED: callback rejects missing/invalid state. GREEN: state validation.
  • RED: callback stores team connection metadata and appends a safe audit entry. GREEN: callback persistence.
  • RED: disconnect removes or inactivates token material and appends audit. GREEN: disconnect flow.
  • RED: integration page renders disconnected, connected, and missing-credentials states. GREEN: Angular service/page shell.

Blocked by

None - can start immediately.

Activity

  1. added
    enhancement
    ready
    on May 5, 2026
  2. PascaleBeier commented on May 5, 2026

    @PascaleBeier
    CollaboratorAuthor

    Closing this implementation-slice issue because we are keeping the Google Search Console breakdown local in docs/triage/139-implementation-plan.md instead of tracking these slices as separate GitHub issues.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementready

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions