oauth

package
v0.0.52 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package oauth provides adapters for integrating the github.com/giantswarm/mcp-oauth library with the mcp-kubernetes MCP server.

This package bridges the mcp-oauth library with our existing server architecture, providing token provider integration and configuration mapping for Kubernetes contexts that may require OAuth authentication.

Dependency Security Note: This package depends on github.com/giantswarm/mcp-oauth for OAuth 2.1 implementation. The library provides: PKCE enforcement, refresh token rotation, rate limiting, and audit logging. Security posture: Actively maintained, implements OAuth 2.1 specification.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithAccessToken

func ContextWithAccessToken(ctx context.Context, idToken string) context.Context

ContextWithAccessToken creates a context with the given OAuth ID token. This is used to pass the user's Google OAuth ID token for downstream Kubernetes OIDC authentication. Note: Kubernetes OIDC requires the ID token, not the access token.

func GetAccessTokenFromContext

func GetAccessTokenFromContext(ctx context.Context) (string, bool)

GetAccessTokenFromContext retrieves the OAuth ID token from the context. This returns the user's Google OAuth ID token that can be used for downstream Kubernetes OIDC authentication. Returns the ID token and true if present, or empty string and false if not available.

func GetIDToken

func GetIDToken(token *oauth2.Token) string

GetIDToken extracts the ID token from an OAuth2 token. Google OAuth responses include an id_token in the Extra data. Kubernetes OIDC authentication requires the ID token, not the access token.

Types

type UserInfo

type UserInfo = providers.UserInfo

UserInfo represents Google user information. This is a type alias for the library's providers.UserInfo type.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL