feat: add API key validation and client credentials validation#63
feat: add API key validation and client credentials validation#63LifeJiggy wants to merge 2 commits intodigitalocean:mainfrom
Conversation
LifeJiggy
commented
Oct 16, 2025
- Add validate_api_key() function for API key format validation
- Add validate_client_credentials() function for comprehensive credential validation
- Add proper error messages for invalid credentials
- Add tests for validation functions
- Update utils init.py to export new validation functions
|
Could you provide some more information as to how this is expected to be used? I would assume all validation should be done of a created client itself, not just the parameters. I would also expect that if someone is going to the trouble of validating the client that more than "is set" checks are needed. I'm inclined to close this PR given the issues presented here. |
|
PR enhances the API key validation functionality to address reviewer feedback by providing comprehensive client instance validation beyond simple "is set" checks. Changes Made🔧 Enhanced Validation Functions
New
🧪 Comprehensive Test Coverage
📚 API Documentation
Key Improvements
Usage Examplesfrom gradient import Gradient
from gradient._utils import validate_client_instance
# Create a client
client = Gradient(access_token="sk-1234567890abcdef")
# Validate the client instance
validate_client_instance(client) # Raises ValueError if invalid |
|
Your motivation is very unclear and doesn't move the pr in the suggested direction. Closing for now. |