mirror of
https://github.com/Telecominfraproject/wlan-cloud-userportal.git
synced 2025-11-01 19:17:46 +00:00
Merging Security login.
This commit is contained in:
33
src/RESTAPI/RESTAPI_oauth2_handler.h
Normal file
33
src/RESTAPI/RESTAPI_oauth2_handler.h
Normal file
@@ -0,0 +1,33 @@
|
||||
//
|
||||
// Created by stephane bourque on 2021-11-28.
|
||||
//
|
||||
|
||||
#ifndef OWSUB_RESTAPI_OAUTH2_HANDLER_H
|
||||
#define OWSUB_RESTAPI_OAUTH2_HANDLER_H
|
||||
|
||||
#include "framework/MicroService.h"
|
||||
|
||||
namespace OpenWifi {
|
||||
class RESTAPI_oauth2_handler : public RESTAPIHandler {
|
||||
public:
|
||||
RESTAPI_oauth2_handler(const RESTAPIHandler::BindingMap &bindings,
|
||||
Poco::Logger &L,
|
||||
RESTAPI_GenericServer & Server, bool Internal)
|
||||
: RESTAPIHandler(bindings, L,
|
||||
std::vector<std::string>{Poco::Net::HTTPRequest::HTTP_POST,
|
||||
Poco::Net::HTTPRequest::HTTP_DELETE,
|
||||
Poco::Net::HTTPRequest::HTTP_GET,
|
||||
Poco::Net::HTTPRequest::HTTP_OPTIONS},
|
||||
Server,
|
||||
Internal, false, true , RateLimit{.Interval=1000,.MaxCalls=10}) {}
|
||||
static const std::list<const char *> PathName() { return std::list<const char *>{"/api/v1/oauth2/{token}","/api/v1/oauth2"}; };
|
||||
|
||||
void DoGet() final;
|
||||
void DoPost() final;
|
||||
void DoPut() final {};
|
||||
void DoDelete() final;
|
||||
private:
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OWSUB_RESTAPI_OAUTH2_HANDLER_H
|
||||
Reference in New Issue
Block a user