Skip to content
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

beater/api/mux: fix Fleet agent config enablement #5917

Merged
merged 2 commits into from
Aug 10, 2021

Conversation

axw
Copy link
Member

@axw axw commented Aug 10, 2021

Motivation/summary

If Fleet-managed, apm-server should not return 403 Forbidden just because there's no agent config. Add the "kill switch" middleware only if the server is not Fleet-managed, and has no Kibana config. Extend the agent config system test to cover Fleet.

There is some light refactoring to inject a common auth.Authenticator and model.BatchProcessor into both the HTTP mux and gRPC services.

Checklist

How to test these changes

  1. Create a fresh cluster, add APM integration to an Elastic Agent
  2. Query agent config. It should not return 403 Forbidden.

Related issues

None.

If Fleet-managed, apm-server should not return 403 Forbidden
just because there's no agent config. Add the "kill switch"
middleware only if the server is _not_ Fleet-managed, and
has no Kibana config. Extend the agent config system test to
cover Fleet.
@axw axw force-pushed the thread-server-params branch from a3aabef to 1e2628c Compare August 10, 2021 07:17
@axw axw requested a review from a team August 10, 2021 07:53
@axw axw marked this pull request as ready for review August 10, 2021 07:53
@apmmachine
Copy link
Contributor

apmmachine commented Aug 10, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2021-08-10T08:47:01.533+0000

  • Duration: 40 min 51 sec

  • Commit: f676328

Test stats 🧪

Test Results
Failed 0
Passed 5914
Skipped 14
Total 5928

Trends 🧪

Image of Build Times

Image of Tests

Copy link
Contributor

@stuartnelson3 stuartnelson3 left a comment

Choose a reason for hiding this comment

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

great changes to newServer/newHTTPServer

@axw axw merged commit 44b684b into elastic:master Aug 10, 2021
@axw axw deleted the thread-server-params branch August 10, 2021 10:11
mergify bot pushed a commit that referenced this pull request Aug 10, 2021
* beater/api/mux: fix Fleet agent config enablement

If Fleet-managed, apm-server should not return 403 Forbidden
just because there's no agent config. Add the "kill switch"
middleware only if the server is _not_ Fleet-managed, and
has no Kibana config. Extend the agent config system test to
cover Fleet.

* systemtest: increase timeout for fleet

(cherry picked from commit 44b684b)

# Conflicts:
#	changelogs/head.asciidoc
axw added a commit that referenced this pull request Aug 11, 2021
…) (#5920)

* beater/api/mux: fix Fleet agent config enablement (#5917)

* beater/api/mux: fix Fleet agent config enablement

If Fleet-managed, apm-server should not return 403 Forbidden
just because there's no agent config. Add the "kill switch"
middleware only if the server is _not_ Fleet-managed, and
has no Kibana config. Extend the agent config system test to
cover Fleet.

* systemtest: increase timeout for fleet

(cherry picked from commit 44b684b)

# Conflicts:
#	changelogs/head.asciidoc

* Delete head.asciidoc

Co-authored-by: Andrew Wilkins <[email protected]>
@stuartnelson3
Copy link
Contributor

Confirmed with BC3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants