VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
authInterceptor.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright (c) 2026 MAK Technologies, Inc.
3  * All rights reserved.
4  ******************************************************************************/
5 
6 #pragma once
7 
8 #include "sessionManager.h"
9 #include "webServerSettings.h"
10 
11 #include <oatpp/web/server/interceptor/RequestInterceptor.hpp>
12 #include <oatpp/web/protocol/http/outgoing/ResponseFactory.hpp>
13 #include <oatpp/web/protocol/http/Http.hpp>
14 #include <json/json.h>
15 
16 #include <string>
17 
35 class DtAuthInterceptor : public oatpp::web::server::interceptor::RequestInterceptor
36 {
37 public:
38  std::shared_ptr<OutgoingResponse> intercept(
39  const std::shared_ptr<IncomingRequest>& request) override;
40 
41 private:
43  static bool requiresAuth(const std::string& path);
44 
46  static std::shared_ptr<OutgoingResponse> unauthorized(const std::string& message);
47 };
DtAuthInterceptor — oatpp request interceptor that enforces session key authentication on all REST AP...
Definition: authInterceptor.h:35
std::shared_ptr< OutgoingResponse > intercept(const std::shared_ptr< IncomingRequest > &request) override
static bool requiresAuth(const std::string &path)
Returns true if the path should be checked for a valid session key.
static std::shared_ptr< OutgoingResponse > unauthorized(const std::string &message)
Builds a minimal JSON 401 response.

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)