What does this MR do?
The anti-spam engine, spamcheck, is going to utilize gRPC in production but for now, it provides an HTTP endpoint that accepts and returns JSON. However, the JSON has to be formatted to match the structure of the protocol buffers that will eventually be used.
This MR reformats the JSON to match spamcheck's protobufs.
How to test
- Check out and run
docker-compose up -d
in theinspector
project directory - Check out the
spamcheck
project - Copy
config/config.toml.example
toconfig/config.toml
- Modify
config/config.toml
to set theinspectorUrl
tohttp://localhost:8888/api/v1/isspam/issue"
-
make run
in thespamcheck
project directory
In GitLab rails:
bundle install && bin/rails db:migrate
- In your local Gitlab UI, go to the Admin area -> Settings -> Reporting
- Check
Enable Spam Check via external API endpoint
- Enter
grpc://localhost:55381
in theURL of the external Spam Check endpoint
- Set Gitlab's setting to allow calling local services
- Admin area -> Settings -> Network -> Outbound requests
- In your local Gitlab instance, as a "normal" user, impersonate them (or switch to them)
- Create an issue that seems reasonable and "real"
- It should succeed
- In your console where you're running spamcheck, you should see a log message indicating it sent an
ALLOW
response.
Screenshots (strongly suggested)
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Related to #299558 (closed)