-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsecurity_api.go
43 lines (31 loc) · 1.14 KB
/
security_api.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright 2023 New Relic Corporation. All rights reserved.
// SPDX-License-Identifier: New Relic Software License v1.0
package newrelic_security_agent
import (
"net/http"
sec_intercept "github.com/newrelic/csec-go-agent/security_intercept"
)
type securityAgent struct {
}
func (t securityAgent) RefreshState(connectionData map[string]string) bool {
sec_intercept.UpdateLinkData(connectionData)
return true
}
func (t securityAgent) DeactivateSecurity() {
sec_intercept.DeactivateSecurity()
}
func (t securityAgent) SendEvent(caseType string, data ...interface{}) interface{} {
return sec_intercept.SendEvent(caseType, data...)
}
func (t securityAgent) SendExitEvent(secureAgentevent interface{}, err error) {
sec_intercept.SendExitEvent(secureAgentevent, err)
}
func (t securityAgent) IsSecurityActive() bool {
return !sec_intercept.IsDisable() || !sec_intercept.IsForceDisable()
}
func (t securityAgent) DistributedTraceHeaders(hdrs *http.Request, secureAgentevent interface{}) {
sec_intercept.DistributedTraceHeaders(hdrs, secureAgentevent)
}
func (t securityAgent) RequestBodyReadLimit() int {
return sec_intercept.RequestBodyReadLimit()
}