Secure your software empower your team.
Table of Contents
If you'd like to contribute code or documentation, please see CONTRIBUTING.md for guidelines on how to do so.
Please report any issues with the setup process or other problems encountered while using this repository by opening a new issue in this project's GitHub page.
The following repository contains the source code material for our public API, powered by NestJS.
-
make build
-
make build-dev
-
TEST_EMAIL=<test-email-address> MAIL_AUTH_PASSWORD=<smtp-password> make up-dev
<test-email-address>
is an email address on which you will recieve all emails during development. This is so we do not spam real-world email addresses of real people during development.<smtp-password>
the password needed to authenticate to the smtp server. Under no circumstance put this into one of the .env files!- To make your life easier, export these environment variables in
/etc/environment
, so you don't need to specify them every time.
Every response from the API includes two fields:
status
a textual indication of whether the request succeeded or not ("success"
or"failure"
)status_code
the numerical http status code (200
,400
,500
, ...)
Every error returned from the API includes two additional fields:
error_code
a textual error code ("UnkownAnalysis"
,"UnkownWorkspace"
,"UnprocessableEntity"
, ...)error_message
an error message/description
Note: that the presence of these fields is enforced by the ExceptionFilter
and the ResponseBodyInterceptor
.
- Error handling: Our API indicates failures and success via HTTP status codes (
200
,400
,500
) and also by including respective fields in the returned JSON body. Allowing consumers of the API to employ their preffered style of error handling.Success
:// HTTP status code: 200 { "status_code": 200, "status": "success", "data": { ... } }
Error
:// HTTP status code: 400 { "status_code": 400, "status": "failure", "error_code": "UnkownWorkspace", "error_message": "The referenced workspace does not exist" }
- Casing: All the responses from our API are in underscore/snake case. The same applies to query and body parameters.