Skip to content

Commit

Permalink
Merge pull request #119 from newrelic/unittest/introspector-api
Browse files Browse the repository at this point in the history
New API in Introspector for unit test cases
  • Loading branch information
lovesh-ap authored Oct 9, 2023
2 parents 65d6fed + 9e96948 commit 86e5c9a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,7 @@ public interface SecurityIntrospector {

void setK2TracingData(String value);

void setK2ParentId(String value);

void clear();
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.newrelic.agent.security.introspec.SecurityIntrospector;
import com.newrelic.api.agent.security.Agent;
import com.newrelic.api.agent.security.NewRelicSecurity;
import com.newrelic.api.agent.security.instrumentation.helpers.GenericHelper;
import com.newrelic.api.agent.security.instrumentation.helpers.JdbcHelper;
import com.newrelic.api.agent.security.schema.AbstractOperation;
import com.newrelic.api.agent.security.schema.HttpRequest;
Expand Down Expand Up @@ -108,6 +109,11 @@ public void setK2TracingData(String value) {
NewRelicSecurity.getAgent().getSecurityMetaData().setTracingHeaderValue(value);
}

@Override
public void setK2ParentId(String value) {
NewRelicSecurity.getAgent().getSecurityMetaData().addCustomAttribute(GenericHelper.CSEC_PARENT_ID, value);
}

@Override
public void setRequestInputStreamHash(int hashCode) {
NewRelicSecurity.getAgent().getSecurityMetaData().addCustomAttribute(REQUEST_INPUTSTREAM_HASH, Collections.singleton(hashCode));
Expand Down

0 comments on commit 86e5c9a

Please sign in to comment.