Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-AUSF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-AUSF
Commits
2456a500
Commit
2456a500
authored
Jan 25, 2021
by
HFJ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aka auth json.exception.parse_error.101
parent
4ec402db
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
7 deletions
+28
-7
api/AuthenticationResultDeletionApi.cpp
api/AuthenticationResultDeletionApi.cpp
+4
-0
api/DefaultApi.cpp
api/DefaultApi.cpp
+17
-7
impl/DefaultApiImpl.cpp
impl/DefaultApiImpl.cpp
+6
-0
main-api-server.cpp
main-api-server.cpp
+1
-0
No files found.
api/AuthenticationResultDeletionApi.cpp
View file @
2456a500
...
...
@@ -12,6 +12,9 @@
#include "AuthenticationResultDeletionApi.h"
#include "Helpers.h"
#include <iostream>
using
namespace
std
;
namespace
org
{
namespace
openapitools
{
...
...
@@ -81,6 +84,7 @@ void AuthenticationResultDeletionApi::delete_eap_authentication_result_handler(c
}
void
AuthenticationResultDeletionApi
::
authentication_result_deletion_api_default_handler
(
const
Pistache
::
Rest
::
Request
&
,
Pistache
::
Http
::
ResponseWriter
response
)
{
cout
<<
"----------authentication_result_deletion_api_default_handler------------"
<<
endl
;
response
.
send
(
Pistache
::
Http
::
Code
::
Not_Found
,
"The requested method does not exist-resDel"
);
}
...
...
api/DefaultApi.cpp
View file @
2456a500
...
...
@@ -36,10 +36,10 @@ void DefaultApi::init() {
void
DefaultApi
::
setupRoutes
()
{
using
namespace
Pistache
::
Rest
;
//
Routes::Post(*router, base + "/ue-authentications/:authCtxId/eap-session", Routes::bind(&DefaultApi::eap_auth_method_handler, this));
//
Routes::Post(*router, base + "/rg-authentications", Routes::bind(&DefaultApi::rg_authentications_post_handler, this));
//
Routes::Put(*router, base + "/ue-authentications/:authCtxId/5g-aka-confirmation", Routes::bind(&DefaultApi::ue_authentications_auth_ctx_id5g_aka_confirmation_put_handler, this));
//
Routes::Post(*router, base + "/ue-authentications/deregister", Routes::bind(&DefaultApi::ue_authentications_deregister_post_handler, this));
Routes
::
Post
(
*
router
,
base
+
"/ue-authentications/:authCtxId/eap-session"
,
Routes
::
bind
(
&
DefaultApi
::
eap_auth_method_handler
,
this
));
Routes
::
Post
(
*
router
,
base
+
"/rg-authentications"
,
Routes
::
bind
(
&
DefaultApi
::
rg_authentications_post_handler
,
this
));
Routes
::
Put
(
*
router
,
base
+
"/ue-authentications/:authCtxId/5g-aka-confirmation"
,
Routes
::
bind
(
&
DefaultApi
::
ue_authentications_auth_ctx_id5g_aka_confirmation_put_handler
,
this
));
Routes
::
Post
(
*
router
,
base
+
"/ue-authentications/deregister"
,
Routes
::
bind
(
&
DefaultApi
::
ue_authentications_deregister_post_handler
,
this
));
Routes
::
Post
(
*
router
,
base
+
"/ue-authentications"
,
Routes
::
bind
(
&
DefaultApi
::
ue_authentications_post_handler
,
this
));
// Default handler, called when a route is not found
...
...
@@ -97,6 +97,7 @@ void DefaultApi::rg_authentications_post_handler(const Pistache::Rest::Request &
void
DefaultApi
::
ue_authentications_auth_ctx_id5g_aka_confirmation_put_handler
(
const
Pistache
::
Rest
::
Request
&
request
,
Pistache
::
Http
::
ResponseWriter
response
)
{
// Getting the path params
auto
authCtxId
=
request
.
param
(
":authCtxId"
).
as
<
std
::
string
>
();
cout
<<
"5gaka confirmation received with authctxID %s"
<<
authCtxId
.
c_str
()
<<
endl
;
// Getting the body param
...
...
@@ -143,16 +144,24 @@ void DefaultApi::ue_authentications_deregister_post_handler(const Pistache::Rest
}
void
DefaultApi
::
ue_authentications_post_handler
(
const
Pistache
::
Rest
::
Request
&
request
,
Pistache
::
Http
::
ResponseWriter
response
)
{
cout
<<
"------------ue authentications post handler---------"
<<
endl
;
if
(
!
request
.
body
().
c_str
()){
cout
<<
"empty request body"
<<
endl
;
}
// Getting the body param
AuthenticationInfo
authenticationInfo
;
try
{
cout
<<
"--try module"
<<
endl
;
nlohmann
::
json
::
parse
(
request
.
body
()).
get_to
(
authenticationInfo
);
cout
<<
"parsed successfully"
<<
endl
;
this
->
ue_authentications_post
(
authenticationInfo
,
response
);
}
catch
(
nlohmann
::
detail
::
exception
&
e
)
{
//send a 400 error
cout
<<
"**400 error"
<<
endl
;
response
.
send
(
Pistache
::
Http
::
Code
::
Bad_Request
,
e
.
what
());
return
;
}
catch
(
Pistache
::
Http
::
HttpError
&
e
)
{
...
...
@@ -160,6 +169,7 @@ void DefaultApi::ue_authentications_post_handler(const Pistache::Rest::Request &
return
;
}
catch
(
std
::
exception
&
e
)
{
//send a 500 error
cout
<<
"**500 error"
<<
endl
;
response
.
send
(
Pistache
::
Http
::
Code
::
Internal_Server_Error
,
e
.
what
());
return
;
}
...
...
@@ -167,7 +177,7 @@ void DefaultApi::ue_authentications_post_handler(const Pistache::Rest::Request &
}
void
DefaultApi
::
default_api_default_handler
(
const
Pistache
::
Rest
::
Request
&
,
Pistache
::
Http
::
ResponseWriter
response
)
{
cout
<<
"in default api handler"
<<
endl
;
cout
<<
"
--
in default api handler"
<<
endl
;
response
.
send
(
Pistache
::
Http
::
Code
::
Not_Found
,
"The requested method does not exist-default"
);
}
...
...
impl/DefaultApiImpl.cpp
View file @
2456a500
...
...
@@ -12,6 +12,10 @@
#include "DefaultApiImpl.h"
#include <iostream>
using
namespace
std
;
namespace
org
{
namespace
openapitools
{
namespace
server
{
...
...
@@ -30,12 +34,14 @@ void DefaultApiImpl::rg_authentications_post(const RgAuthenticationInfo &rgAuthe
response
.
send
(
Pistache
::
Http
::
Code
::
Ok
,
"Do some magic
\n
"
);
}
void
DefaultApiImpl
::
ue_authentications_auth_ctx_id5g_aka_confirmation_put
(
const
std
::
string
&
authCtxId
,
const
ConfirmationData
&
confirmationData
,
Pistache
::
Http
::
ResponseWriter
&
response
)
{
cout
<<
"handling 5gaka confirmation -- put"
<<
endl
;
response
.
send
(
Pistache
::
Http
::
Code
::
Ok
,
"Do some magic
\n
"
);
}
void
DefaultApiImpl
::
ue_authentications_deregister_post
(
const
DeregistrationInfo
&
deregistrationInfo
,
Pistache
::
Http
::
ResponseWriter
&
response
)
{
response
.
send
(
Pistache
::
Http
::
Code
::
Ok
,
"Do some magic
\n
"
);
}
void
DefaultApiImpl
::
ue_authentications_post
(
const
AuthenticationInfo
&
authenticationInfo
,
Pistache
::
Http
::
ResponseWriter
&
response
)
{
cout
<<
"handling 5gaka authentication -- post"
<<
endl
;
response
.
send
(
Pistache
::
Http
::
Code
::
Ok
,
"Do some magic
\n
"
);
}
...
...
main-api-server.cpp
View file @
2456a500
...
...
@@ -27,6 +27,7 @@
#include "logger.hpp"
#include "options.hpp"
using
namespace
std
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment