@@ -109,7 +109,9 @@ func ReceiveIntegration(w http.ResponseWriter, r *http.Request) {
109
109
"sha256=" )
110
110
111
111
if ! ok {
112
- log .Error ("Invalid HMAC signature" )
112
+ log .WithFields (log.Fields {
113
+ "context" : "integrations" ,
114
+ }).Error ("Invalid GitHub/HMAC signature" )
113
115
continue
114
116
}
115
117
case db .IntegrationAuthBitbucket :
@@ -120,7 +122,9 @@ func ReceiveIntegration(w http.ResponseWriter, r *http.Request) {
120
122
"sha256=" )
121
123
122
124
if ! ok {
123
- log .Error ("Invalid HMAC signature" )
125
+ log .WithFields (log.Fields {
126
+ "context" : "integrations" ,
127
+ }).Error ("Invalid Bitbucket/HMAC signature" )
124
128
continue
125
129
}
126
130
case db .IntegrationAuthHmac :
@@ -131,32 +135,42 @@ func ReceiveIntegration(w http.ResponseWriter, r *http.Request) {
131
135
"" )
132
136
133
137
if ! ok {
134
- log .Error ("Invalid HMAC signature" )
138
+ log .WithFields (log.Fields {
139
+ "context" : "integrations" ,
140
+ }).Error ("Invalid HMAC signature" )
135
141
continue
136
142
}
137
143
case db .IntegrationAuthToken :
138
144
if integration .AuthSecret .LoginPassword .Password != r .Header .Get (integration .AuthHeader ) {
139
- log .Error ("Invalid verification token" )
145
+ log .WithFields (log.Fields {
146
+ "context" : "integrations" ,
147
+ }).Error ("Invalid verification token" )
140
148
continue
141
149
}
142
150
case db .IntegrationAuthBasic :
143
151
var username , password , auth = r .BasicAuth ()
144
152
if ! auth || integration .AuthSecret .LoginPassword .Password != password || integration .AuthSecret .LoginPassword .Login != username {
145
- log .Error ("Invalid BasicAuth: incorrect login or password" )
153
+ log .WithFields (log.Fields {
154
+ "context" : "integrations" ,
155
+ }).Error ("Invalid BasicAuth: incorrect login or password" )
146
156
continue
147
157
}
148
158
case db .IntegrationAuthNone :
149
159
// Do nothing
150
160
default :
151
- log .Error ("Unknown verification method: " + integration .AuthMethod )
161
+ log .WithFields (log.Fields {
162
+ "context" : "integrations" ,
163
+ }).Error ("Unknown verification method: " + integration .AuthMethod )
152
164
continue
153
165
}
154
166
155
167
if level != db .IntegrationAliasSingle {
156
168
var matchers []db.IntegrationMatcher
157
169
matchers , err = store .GetIntegrationMatchers (integration .ProjectID , db.RetrieveQueryParams {}, integration .ID )
158
170
if err != nil {
159
- log .Error (err )
171
+ log .WithFields (log.Fields {
172
+ "context" : "integrations" ,
173
+ }).WithError (err ).Error ("Could not retrieve matchers" )
160
174
continue
161
175
}
162
176
0 commit comments