mirror of
https://github.com/Telecominfraproject/wlan-cloud-userportal.git
synced 2026-01-27 10:23:21 +00:00
Adding signup process.
This commit is contained in:
@@ -90,7 +90,7 @@ add_executable(owsub
|
||||
src/RESTAPI/RESTAPI_wifiClients_handler.cpp src/RESTAPI/RESTAPI_wifiClients_handler.h
|
||||
src/RESTObjects/RESTAPI_SubObjects.cpp src/RESTObjects/RESTAPI_SubObjects.h
|
||||
src/RESTAPI/RESTAPI_subscriber_handler.cpp src/RESTAPI/RESTAPI_subscriber_handler.h
|
||||
src/RESTAPI/RESTAPI_oauth2_handler.cpp src/RESTAPI/RESTAPI_oauth2_handler.h src/RESTAPI/RESTAPI_action_handler.cpp src/RESTAPI/RESTAPI_action_handler.h src/RESTAPI/RESTAPI_mfa_handler.cpp src/RESTAPI/RESTAPI_mfa_handler.h src/sdks/SDK_prov.cpp src/sdks/SDK_prov.h src/sdks/SDK_gw.cpp src/sdks/SDK_gw.h src/sdks/SDK_sec.cpp src/sdks/SDK_sec.h src/RESTAPI/RESTAPI_claim_handler.cpp src/RESTAPI/RESTAPI_claim_handler.h)
|
||||
src/RESTAPI/RESTAPI_oauth2_handler.cpp src/RESTAPI/RESTAPI_oauth2_handler.h src/RESTAPI/RESTAPI_action_handler.cpp src/RESTAPI/RESTAPI_action_handler.h src/RESTAPI/RESTAPI_mfa_handler.cpp src/RESTAPI/RESTAPI_mfa_handler.h src/sdks/SDK_prov.cpp src/sdks/SDK_prov.h src/sdks/SDK_gw.cpp src/sdks/SDK_gw.h src/sdks/SDK_sec.cpp src/sdks/SDK_sec.h src/RESTAPI/RESTAPI_claim_handler.cpp src/RESTAPI/RESTAPI_claim_handler.h src/RESTAPI/RESTAPI_signup_handler.cpp src/RESTAPI/RESTAPI_signup_handler.h)
|
||||
|
||||
target_link_libraries(owsub PUBLIC
|
||||
${Poco_LIBRARIES} ${MySQL_LIBRARIES}
|
||||
|
||||
@@ -1085,3 +1085,30 @@ paths:
|
||||
type: string
|
||||
details:
|
||||
type: string
|
||||
|
||||
/signup:
|
||||
post:
|
||||
tags:
|
||||
- Subscriber Registration
|
||||
summary: This call allows a new subscriber to register themselves and their devices.
|
||||
operationId: postSignup
|
||||
parameters:
|
||||
- in: query
|
||||
name: email
|
||||
schema:
|
||||
type: string
|
||||
format: email
|
||||
required: true
|
||||
- in: query
|
||||
name: serialNumber
|
||||
schema:
|
||||
type: string
|
||||
required: true
|
||||
responses:
|
||||
200:
|
||||
$ref: '#/components/responses/Success'
|
||||
400:
|
||||
$ref: '#/components/responses/BadRequest'
|
||||
404:
|
||||
$ref: '#/components/responses/Unauthorized'
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "RESTAPI/RESTAPI_action_handler.h"
|
||||
#include "RESTAPI/RESTAPI_mfa_handler.h"
|
||||
#include "RESTAPI/RESTAPI_claim_handler.h"
|
||||
#include "RESTAPI/RESTAPI_signup_handler.h"
|
||||
|
||||
namespace OpenWifi {
|
||||
|
||||
@@ -23,6 +24,7 @@ namespace OpenWifi {
|
||||
RESTAPI_action_handler,
|
||||
RESTAPI_mfa_handler,
|
||||
RESTAPI_claim_handler,
|
||||
RESTAPI_signup_handler,
|
||||
RESTAPI_system_command>(Path, Bindings, L, S, TransactionId);
|
||||
}
|
||||
|
||||
|
||||
14
src/RESTAPI/RESTAPI_signup_handler.cpp
Normal file
14
src/RESTAPI/RESTAPI_signup_handler.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
//
|
||||
// Created by stephane bourque on 2022-02-20.
|
||||
//
|
||||
|
||||
#include "RESTAPI_signup_handler.h"
|
||||
#include "framework/API_Proxy.h"
|
||||
|
||||
namespace OpenWifi {
|
||||
|
||||
void RESTAPI_signup_handler::DoPost() {
|
||||
API_Proxy(Logger_, Request, Response, OpenWifi::uSERVICE_SECURITY.c_str(),"/api/v1/signup");
|
||||
}
|
||||
|
||||
}
|
||||
38
src/RESTAPI/RESTAPI_signup_handler.h
Normal file
38
src/RESTAPI/RESTAPI_signup_handler.h
Normal file
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// Created by stephane bourque on 2022-02-20.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "framework/MicroService.h"
|
||||
|
||||
namespace OpenWifi {
|
||||
class RESTAPI_signup_handler : public RESTAPIHandler {
|
||||
public:
|
||||
RESTAPI_signup_handler(const RESTAPIHandler::BindingMap &bindings, Poco::Logger &L, RESTAPI_GenericServer & Server, uint64_t TransactionId, bool Internal)
|
||||
: RESTAPIHandler(bindings, L,
|
||||
std::vector<std::string>{
|
||||
Poco::Net::HTTPRequest::HTTP_POST,
|
||||
Poco::Net::HTTPRequest::HTTP_OPTIONS},
|
||||
Server,
|
||||
TransactionId,
|
||||
Internal, false, true ){}
|
||||
|
||||
static const std::list<const char *> PathName() { return std::list<const char *>{"/api/v1/action"}; };
|
||||
|
||||
/* inline bool RoleIsAuthorized(std::string & Reason) {
|
||||
if(UserInfo_.userinfo.userRole != SecurityObjects::USER_ROLE::SUBSCRIBER) {
|
||||
Reason = "User must be a subscriber";
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
*/
|
||||
void DoGet() final {};
|
||||
void DoPost() final;
|
||||
void DoPut() final {};
|
||||
void DoDelete() final {};
|
||||
private:
|
||||
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user