Skip to content

Commit

Permalink
Revert "[APM] Set explicit access options for APM public APIs (elasti…
Browse files Browse the repository at this point in the history
…c#197435)" (elastic#200750)

closes elastic#200742

This PR reverts changes introduced in
[PR](elastic#197435) to avoid duplicating
logic.
  • Loading branch information
miloszmarcinkowski authored and CAWilson94 committed Dec 12, 2024
1 parent 8fe6872 commit d7d8f8d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,7 @@ const invalidateAgentKeyRoute = createApmServerRoute({

const createAgentKeyRoute = createApmServerRoute({
endpoint: 'POST /api/apm/agent_keys 2023-10-31',
options: {
tags: ['access:apm', 'access:apm_settings_write', 'oas-tag:APM agent keys'],
access: 'public',
},
options: { tags: ['access:apm', 'access:apm_settings_write', 'oas-tag:APM agent keys'] },
params: t.type({
body: t.type({
name: t.string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const fleetAgentsRoute = createApmServerRoute({

const saveApmServerSchemaRoute = createApmServerRoute({
endpoint: 'POST /api/apm/fleet/apm_server_schema 2023-10-31',
options: { tags: ['access:apm', 'access:apm_write'], access: 'public' },
options: { tags: ['access:apm', 'access:apm_write'] },
params: t.type({
body: t.type({
schema: t.record(t.string, t.unknown),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ const serviceAnnotationsRoute = createApmServerRoute({
}),
query: t.intersection([environmentRt, rangeRt]),
}),
options: { tags: ['access:apm', 'oas-tag:APM annotations'], access: 'public' },
options: { tags: ['access:apm', 'oas-tag:APM annotations'] },
handler: async (resources): Promise<ServiceAnnotationResponse> => {
const apmEventClient = await getApmEventClient(resources);
const { params, plugins, context, request, logger, config } = resources;
Expand Down Expand Up @@ -440,7 +440,6 @@ const serviceAnnotationsCreateRoute = createApmServerRoute({
endpoint: 'POST /api/apm/services/{serviceName}/annotation 2023-10-31',
options: {
tags: ['access:apm', 'access:apm_write', 'oas-tag:APM annotations'],
access: 'public',
},
params: t.type({
path: t.type({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function throwNotFoundIfAgentConfigNotAvailable(featureFlags: ApmFeatureFlags):
// get list of configurations
const agentConfigurationRoute = createApmServerRoute({
endpoint: 'GET /api/apm/settings/agent-configuration 2023-10-31',
options: { tags: ['access:apm'], access: 'public' },
options: { tags: ['access:apm'] },
handler: async (
resources
): Promise<{
Expand Down Expand Up @@ -68,7 +68,7 @@ const getSingleAgentConfigurationRoute = createApmServerRoute({
params: t.partial({
query: serviceRt,
}),
options: { tags: ['access:apm'], access: 'public' },
options: { tags: ['access:apm'] },
handler: async (resources): Promise<AgentConfiguration> => {
throwNotFoundIfAgentConfigNotAvailable(resources.featureFlags);

Expand Down Expand Up @@ -100,7 +100,6 @@ const deleteAgentConfigurationRoute = createApmServerRoute({
endpoint: 'DELETE /api/apm/settings/agent-configuration 2023-10-31',
options: {
tags: ['access:apm', 'access:apm_settings_write'],
access: 'public',
},
params: t.type({
body: t.type({
Expand Down Expand Up @@ -157,7 +156,6 @@ const createOrUpdateAgentConfigurationRoute = createApmServerRoute({
endpoint: 'PUT /api/apm/settings/agent-configuration 2023-10-31',
options: {
tags: ['access:apm', 'access:apm_settings_write'],
access: 'public',
},
params: t.intersection([
t.partial({ query: t.partial({ overwrite: toBooleanRt }) }),
Expand Down Expand Up @@ -226,7 +224,7 @@ const agentConfigurationSearchRoute = createApmServerRoute({
params: t.type({
body: searchParamsRt,
}),
options: { tags: ['access:apm'], disableTelemetry: true, access: 'public' },
options: { tags: ['access:apm'], disableTelemetry: true },
handler: async (
resources
): Promise<SearchHit<AgentConfiguration, undefined, undefined> | null> => {
Expand Down Expand Up @@ -288,7 +286,7 @@ const listAgentConfigurationEnvironmentsRoute = createApmServerRoute({
params: t.partial({
query: t.partial({ serviceName: t.string }),
}),
options: { tags: ['access:apm'], access: 'public' },
options: { tags: ['access:apm'] },
handler: async (
resources
): Promise<{
Expand Down Expand Up @@ -329,7 +327,7 @@ const agentConfigurationAgentNameRoute = createApmServerRoute({
params: t.type({
query: t.type({ serviceName: t.string }),
}),
options: { tags: ['access:apm'], access: 'public' },
options: { tags: ['access:apm'] },
handler: async (resources): Promise<{ agentName: string | undefined }> => {
throwNotFoundIfAgentConfigNotAvailable(resources.featureFlags);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function throwNotImplementedIfSourceMapNotAvailable(featureFlags: ApmFeatureFlag

const listSourceMapRoute = createApmServerRoute({
endpoint: 'GET /api/apm/sourcemaps 2023-10-31',
options: { tags: ['access:apm'], access: 'public' },
options: { tags: ['access:apm'] },
params: t.partial({
query: t.partial({
page: toNumberRt,
Expand Down Expand Up @@ -87,7 +87,6 @@ const uploadSourceMapRoute = createApmServerRoute({
options: {
tags: ['access:apm', 'access:apm_write'],
body: { accepts: ['multipart/form-data'] },
access: 'public',
},
params: t.type({
body: t.type({
Expand Down Expand Up @@ -160,7 +159,7 @@ const uploadSourceMapRoute = createApmServerRoute({

const deleteSourceMapRoute = createApmServerRoute({
endpoint: 'DELETE /api/apm/sourcemaps/{id} 2023-10-31',
options: { tags: ['access:apm', 'access:apm_write'], access: 'public' },
options: { tags: ['access:apm', 'access:apm_write'] },
params: t.type({
path: t.type({
id: t.string,
Expand Down

0 comments on commit d7d8f8d

Please sign in to comment.