@@ -20,36 +20,10 @@ import (
20
20
"google.golang.org/grpc"
21
21
)
22
22
23
- const (
24
- DecodedQueryField string = "decodedQuery"
25
- DetectorField string = "detector"
26
- ScoreField string = "score"
27
- QueryField string = "query"
28
- ErrorField string = "error"
29
- IsInjectionField string = "is_injection"
30
- ResponseField string = "response"
31
- OutputsField string = "outputs"
32
- TokensField string = "tokens"
33
- StringField string = "String"
34
- ResponseTypeField string = "response_type"
35
-
36
- DeepLearningModel string = "deep_learning_model"
37
- Libinjection string = "libinjection"
38
-
39
- ResponseType string = "error"
40
- ErrorSeverity string = "EXCEPTION"
41
- ErrorNumber string = "42000"
42
- ErrorMessage string = "SQL injection detected"
43
- ErrorDetail string = "Back off, you're not welcome here."
44
- LogLevel string = "error"
45
-
46
- TokenizeAndSequencePath string = "/tokenize_and_sequence"
47
- PredictPath string = "/v1/models/%s/versions/%s:predict"
48
- )
49
-
50
23
type Plugin struct {
51
24
goplugin.GRPCPlugin
52
25
v1.GatewayDPluginServiceServer
26
+
53
27
Logger hclog.Logger
54
28
Threshold float32
55
29
EnableLibinjection bool
@@ -68,6 +42,7 @@ type Plugin struct {
68
42
69
43
type InjectionDetectionPlugin struct {
70
44
goplugin.NetRPCUnsupportedPlugin
45
+
71
46
Impl Plugin
72
47
}
73
48
0 commit comments