Skip to content

refactor: update usage#7

Merged
gao-sun merged 2 commits intomasterfrom
gao-update-usage
May 2, 2025
Merged

refactor: update usage#7
gao-sun merged 2 commits intomasterfrom
gao-update-usage

Conversation

@gao-sun
Copy link
Copy Markdown
Contributor

@gao-sun gao-sun commented May 2, 2025

  • reorg files for easier imports
  • update params for better dev experience

@gao-sun gao-sun requested a review from Copilot May 2, 2025 19:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the library to simplify import paths and improve the developer experience by updating parameter usage and eliminating redundant definitions. Key changes include reorganization of module imports, removal of the old MCPAuthConfig in favor of direct AuthServerConfig usage, and renaming of configuration classes in the middleware.

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/utils/validate_server_config_test.py Updated import paths for server configuration models
tests/utils/fetch_server_config_test.py Revised import sources and parameter usage in tests
tests/__init__test.py Updated test cases to use the new MCPAuth API
samples/server/starlette.py Adjusted variable names and route configuration
mcpauth/utils/_validate_server_config.py Updated import from models to new config location
mcpauth/utils/_fetch_server_config.py Revised import and helper function call
mcpauth/utils/_create_verify_jwt.py Changed leeway type and removed obsolete options
mcpauth/utils/init.py Removed export of obsolete ServerMetadataPaths
mcpauth/types.py Updated comments regarding exception naming
mcpauth/models/oauth.py Removed redundant OAuth model definitions
mcpauth/models/auth_server.py Removed merged configuration models
mcpauth/models/init.py Removed obsolete model re-exports
mcpauth/middleware/create_bearer_auth.py Renamed BaseBearerAuthConfig to BearerAuthConfig
mcpauth/config.py Merged configuration definitions and definitions update
mcpauth/init.py Updated MCPAuth to accept AuthServerConfig directly
Comments suppressed due to low confidence (2)

tests/utils/fetch_server_config_test.py:74

  • Using 'type' as a parameter name may shadow the built-in 'type'. Consider renaming it to 'auth_type' or a similar descriptive name to improve clarity.
            type=AuthServerType.OAUTH,

mcpauth/config.py:3

  • Duplicate import of 'BaseModel' is present. Remove the redundant import to improve code clarity and maintainability.
from pydantic import BaseModel

@codecov
Copy link
Copy Markdown

codecov bot commented May 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@gao-sun gao-sun merged commit 992d93c into master May 2, 2025
5 checks passed
@gao-sun gao-sun deleted the gao-update-usage branch May 2, 2025 19:20
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.

2 participants