-
Notifications
You must be signed in to change notification settings - Fork 1.5k
change auth type from strin to enum #21862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| allow_redirects: Optional[bool] = None | ||
| auth_token: Optional[AuthToken] = None | ||
| auth_type: Optional[str] = None | ||
| auth_type: Optional[Literal['basic', 'digest', 'ntlm', 'kerberos', 'aws']] = None | ||
| aws_host: Optional[str] = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enum enforces lowercase auth_type values only
Changing auth_type to Literal['basic', 'digest', 'ntlm', 'kerberos', 'aws'] makes the field validation case-sensitive. The HTTP wrapper lowercases whatever string is provided (datadog_checks_base/datadog_checks/base/utils/http.py), so configurations using values like 'NTLM' or 'Kerberos' currently succeed. After this change those previously accepted values will fail validation before the normalization step, breaking existing deployments across integrations that rely on the HTTP spec. Consider accepting case-insensitive inputs or keeping the field as a free string and normalizing it.
Useful? React with 👍 / 👎.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files🚀 New features to boost your workflow:
|
What does this PR do?
The option here I think is better as a enum since we only allow for a set of options. Doesn't change any functionality.