Skip to content

Conversation

zhiyanliu
Copy link

Fixes #56

Description

Fix the api create_mcp_gateway_target for lambda type.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring

Testing

  • Unit tests pass locally
  • Integration tests pass (if applicable)
  • Test coverage remains above 80%
  • Manual testing completed

Checklist

  • My code follows the project's style guidelines (ruff/pre-commit)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Security Checklist

  • No hardcoded secrets or credentials
  • No new security warnings from bandit
  • Dependencies are from trusted sources
  • No sensitive data logged

Breaking Changes

List any breaking changes and migration instructions:

N/A

Additional Notes

Add any additional notes or context about the PR here.

@icoxfog417
Copy link

icoxfog417 commented Jul 26, 2025

This enhancement is crucial for implementing a starter toolkit for customized Lambda functions. Currently, the functionality is limited to default sample Lambda implementations only.

    def __handle_lambda_target_creation(self, role_arn: str) -> Dict[str, Any]:
        """Create a test lambda.

        :return: the targetConfiguration for the Lambda.
        """
        lambda_arn = create_test_lambda(self.session, logger=self.logger, gateway_role_arn=role_arn)

        return {
            "targetConfiguration": {"mcp": {"lambda": {"lambdaArn": lambda_arn, "toolSchema": LAMBDA_CONFIG}}},
            "credentialProviderConfigurations": [{"credentialProviderType": "GATEWAY_IAM_ROLE"}],
        }

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.

[BUG] create_mcp_gateway_target not actually using IAM_ROLE credential provider for lambda when target_payload provide
2 participants