Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkRestServerConfig.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkRestServerConfig_h
14 #define mitkRestServerConfig_h
15 
16 #include <MitkRESTAPIExports.h>
17 #include <string>
18 #include <vector>
19 
20 namespace mitk
21 {
27  enum class ClientAccessMode
28  {
30  AllowAll,
31  Whitelist
32  };
33 
39  enum class FileAccessMode
40  {
41  Unrestricted,
43  };
44 
56  {
74  std::string host = "::";
75  int port = 8080;
76  bool enabled = false;
77  int threadPoolSize = 4;
78  int readTimeoutSeconds = 30;
79  int writeTimeoutSeconds = 30;
80 
82  std::vector<std::string> allowedClientIPs;
83 
84  bool requireAuth = false;
85  std::string apiToken;
86 
87  int maxPayloadSizeMB = 512;
88 
90  std::vector<std::string> allowedFileDirectories;
91 
92  bool rateLimitEnabled = false;
93  int rateLimitPerMinute = 120;
94 
95  size_t maxActiveTempDirsPerIp = 5;
96 
97  bool httpsEnabled = false;
98  std::string sslCertPath;
99  std::string sslKeyPath;
100  };
101 
115  MITKRESTAPI_EXPORT std::string GetRestApiDocumentationUrl(int major, int minor, int patch);
116 }
117 
118 #endif
#define MITKRESTAPI_EXPORT
Find image slices visible on a given plane.
FileAccessMode
Access mode for file system path restrictions.
@ Unrestricted
No file path restrictions (default).
@ AllowedDirectories
Only allow paths under configured directories.
ClientAccessMode
Access mode for client IP filtering.
@ Whitelist
Accept connections only from explicitly listed IPs.
@ LocalhostOnly
Only accept connections from 127.0.0.1 and ::1 (default).
@ AllowAll
Accept connections from any IP (not recommended without authentication).
MITKRESTAPI_EXPORT std::string GetRestApiDocumentationUrl(int major, int minor, int patch)
Build the public docs.mitk.org URL of the REST API specification for a given MITK version.
Configuration parameters for the REST API server.
std::string sslCertPath
Path to the SSL/TLS certificate file.
std::vector< std::string > allowedClientIPs
List of allowed client IPs (used with Whitelist mode).
std::string apiToken
The expected API token for Bearer authentication.
std::string sslKeyPath
Path to the SSL/TLS private key file.
std::vector< std::string > allowedFileDirectories
Allowed directories (used with AllowedDirectories mode).