Skip to content

Commit

Permalink
NR-319863: User class detection support in Spring GraphQL
Browse files Browse the repository at this point in the history
  • Loading branch information
IshikaDawda committed Oct 4, 2024
1 parent 5d0d385 commit 9f927c2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
4 changes: 3 additions & 1 deletion instrumentation-security/spring-web/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ dependencies {
implementation("com.newrelic.agent.java:newrelic-weaver-api:${nrAPIVersion}")
implementation("org.springframework:spring-context:4.3.0.RELEASE")
implementation("org.springframework:spring-web:4.3.0.RELEASE")
implementation("org.springframework.graphql:spring-graphql:1.0.0")
testImplementation("org.jetbrains.kotlin:kotlin-stdlib:1.6.20")
}

Expand All @@ -19,7 +20,8 @@ jar {
}

verifyInstrumentation {
passesOnly 'org.springframework:spring-web:[0,)'
passes 'org.springframework:spring-web:[0,)'
passes 'org.springframework.graphql:spring-graphql:[0,)'

excludeRegex 'org.springframework:spring-web:.*(RC|SEC|M)[0-9]*$'
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
/*
*
* * Copyright 2020 New Relic Corporation. All rights reserved.
* * SPDX-License-Identifier: Apache-2.0
*
*/

package com.newrelic.agent.security.instrumentation.springweb;

import com.newrelic.api.agent.security.instrumentation.helpers.ServletHelper;
Expand All @@ -24,7 +17,13 @@ public class SpringController_Instrumentation {
"org.springframework.web.bind.annotation.PutMapping",
"org.springframework.web.bind.annotation.GetMapping",
"org.springframework.web.bind.annotation.PostMapping",
"org.springframework.web.bind.annotation.DeleteMapping"})
"org.springframework.web.bind.annotation.DeleteMapping",
"org.springframework.graphql.data.method.annotation.MutationMapping",
"org.springframework.graphql.data.method.annotation.QueryMapping",
"org.springframework.graphql.data.method.annotation.SchemaMapping",
"org.springframework.graphql.data.method.annotation.SubscriptionMapping",
"org.springframework.graphql.data.method.annotation.BatchMapping"
})
@WeaveIntoAllMethods
private static void requestMapping() {
ServletHelper.registerUserLevelCode("spring-annotation");
Expand Down

0 comments on commit 9f927c2

Please sign in to comment.