@@ -20,36 +20,10 @@ import (
2020 "google.golang.org/grpc"
2121)
2222
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-
5023type Plugin struct {
5124 goplugin.GRPCPlugin
5225 v1.GatewayDPluginServiceServer
26+
5327 Logger hclog.Logger
5428 Threshold float32
5529 EnableLibinjection bool
@@ -68,6 +42,7 @@ type Plugin struct {
6842
6943type InjectionDetectionPlugin struct {
7044 goplugin.NetRPCUnsupportedPlugin
45+
7146 Impl Plugin
7247}
7348
0 commit comments