fix(events): align V1 posting with OpenAPI#665
Open
Teko012 wants to merge 5 commits into
Open
Conversation
Allow typed and raw event posting with an API key alone while rejecting OAuth-only configurations, including raw endpoints with query strings or fragments. Preserve read authentication and legacy CLI behavior while supporting documented request fields, enum values, and limits. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Allow typed and raw event posting with an API key alone while rejecting OAuth-only configurations, including raw endpoints with query strings or fragments. Preserve read authentication and legacy CLI behavior while supporting documented request fields, enum values, and limits. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Allow typed and raw event posting with an API key alone while rejecting OAuth-only configurations, including raw endpoints with query strings or fragments. Preserve read authentication and legacy CLI behavior while supporting documented request fields, enum values, and limits. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Allow typed and raw event posting with an API key alone while rejecting OAuth-only configurations, including raw endpoints with query strings or fragments. Preserve read authentication and legacy CLI behavior while supporting documented request fields, enum values, and limits. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Allow typed and raw event posting with an API key alone while rejecting OAuth-only configurations, including raw endpoints with query strings or fragments. Preserve read authentication and legacy CLI behavior while supporting documented request fields, enum values, and limits. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes
pup events postand genericpup api -X POST v1/eventsauthentication to match the Datadog V1 Events API. The create-event endpoint now acceptsDD_API_KEYwithout requiringDD_APP_KEY, rejects unsupported bearer-only authentication before sending a request, and emits onlyDD-API-KEY.The event-post command also aligns with the pinned V1 OpenAPI specification by supporting every documented request field, all seven alert types, and the documented aggregation-key, text-length, and event-age limits. Existing dogshell-compatible aliases and
--handlebehavior remain available.Motivation
PR #654 added dogshell-compatible event posting, but the command inherited Pup's general authentication validation, which requires both an API key and an application key. The generated V1
create_eventoperation requires onlyapiKeyAuth, so valid API-key-only configurations were rejected before the request could be sent.This follow-up brings both typed and raw event posting in line with the endpoint security requirement and current request schema without changing authentication for event list, search, or get operations.
Additional Notes
POST /api/v1/eventspath.DD_API_KEYandDD_APP_KEY.--device-nameand--source-type-nameflags retain the legacy--device,--type, and underscore-style aliases.--no_hostbehavior remain unchanged.cargo clippy --tests -- -D warningsandcargo fmt --all --checkpass.Checklist
Related Issues
Follow-up to #654.