forked from acouzens/open5gs
[UDM/UDR] Handle UEAuthentication authRemovalInd
This commit is contained in:
parent
89c3f3e1c0
commit
bdc9c1373f
|
@ -229,6 +229,11 @@ bool udm_nudm_ueau_handle_result_confirmation_inform(
|
|||
return false;
|
||||
}
|
||||
|
||||
if (udm_ue->auth_event) {
|
||||
OpenAPI_auth_event_free(udm_ue->auth_event);
|
||||
udm_ue->auth_event = NULL;
|
||||
}
|
||||
|
||||
udm_ue->auth_event = OpenAPI_auth_event_copy(
|
||||
udm_ue->auth_event, message->AuthEvent);
|
||||
|
||||
|
|
|
@ -103,8 +103,12 @@ ogs_sbi_request_t *udm_nudr_dr_build_update_authentication_status(
|
|||
message.h.resource.component[3] =
|
||||
(char *)OGS_SBI_RESOURCE_NAME_AUTHENTICATION_STATUS;
|
||||
|
||||
message.AuthEvent = OpenAPI_auth_event_copy(
|
||||
message.AuthEvent, udm_ue->auth_event);
|
||||
if (udm_ue->auth_event->auth_removal_ind) {
|
||||
message.h.method = (char *)OGS_SBI_HTTP_METHOD_DELETE;
|
||||
} else {
|
||||
message.AuthEvent = OpenAPI_auth_event_copy(
|
||||
message.AuthEvent, udm_ue->auth_event);
|
||||
}
|
||||
|
||||
request = ogs_sbi_build_request(&message);
|
||||
ogs_assert(request);
|
||||
|
|
|
@ -338,20 +338,27 @@ bool udm_nudr_dr_handle_subscription_authentication(
|
|||
|
||||
memset(&sendmsg, 0, sizeof(sendmsg));
|
||||
|
||||
memset(&header, 0, sizeof(header));
|
||||
header.service.name = (char *)OGS_SBI_SERVICE_NAME_NUDM_UEAU;
|
||||
header.api.version = (char *)OGS_SBI_API_V1;
|
||||
header.resource.component[0] = udm_ue->supi;
|
||||
header.resource.component[1] =
|
||||
(char *)OGS_SBI_RESOURCE_NAME_AUTH_EVENTS;
|
||||
header.resource.component[2] = udm_ue->ctx_id;
|
||||
if (AuthEvent->auth_removal_ind) {
|
||||
OpenAPI_auth_event_free(AuthEvent);
|
||||
udm_ue->auth_event = NULL;
|
||||
response = ogs_sbi_build_response(&sendmsg,
|
||||
OGS_SBI_HTTP_STATUS_NO_CONTENT);
|
||||
} else {
|
||||
memset(&header, 0, sizeof(header));
|
||||
header.service.name = (char *)OGS_SBI_SERVICE_NAME_NUDM_UEAU;
|
||||
header.api.version = (char *)OGS_SBI_API_V1;
|
||||
header.resource.component[0] = udm_ue->supi;
|
||||
header.resource.component[1] =
|
||||
(char *)OGS_SBI_RESOURCE_NAME_AUTH_EVENTS;
|
||||
header.resource.component[2] = udm_ue->ctx_id;
|
||||
|
||||
sendmsg.http.location = ogs_sbi_server_uri(server, &header);
|
||||
sendmsg.AuthEvent = OpenAPI_auth_event_copy(
|
||||
sendmsg.AuthEvent, udm_ue->auth_event);
|
||||
sendmsg.http.location = ogs_sbi_server_uri(server, &header);
|
||||
sendmsg.AuthEvent = OpenAPI_auth_event_copy(
|
||||
sendmsg.AuthEvent, udm_ue->auth_event);
|
||||
|
||||
response = ogs_sbi_build_response(&sendmsg,
|
||||
OGS_SBI_HTTP_STATUS_CREATED);
|
||||
response = ogs_sbi_build_response(&sendmsg,
|
||||
OGS_SBI_HTTP_STATUS_CREATED);
|
||||
}
|
||||
ogs_assert(response);
|
||||
ogs_assert(true == ogs_sbi_server_send_response(stream, response));
|
||||
|
||||
|
|
|
@ -83,6 +83,22 @@ void udm_ue_state_operational(ogs_fsm_t *s, udm_event_t *e)
|
|||
END
|
||||
break;
|
||||
|
||||
CASE(OGS_SBI_HTTP_METHOD_PUT)
|
||||
SWITCH(message->h.resource.component[1])
|
||||
CASE(OGS_SBI_RESOURCE_NAME_AUTH_EVENTS)
|
||||
udm_nudm_ueau_handle_result_confirmation_inform(
|
||||
udm_ue, stream, message);
|
||||
break;
|
||||
DEFAULT
|
||||
ogs_error("[%s] Invalid resource name [%s]",
|
||||
udm_ue->suci, message->h.resource.component[1]);
|
||||
ogs_assert(true ==
|
||||
ogs_sbi_server_send_error(stream,
|
||||
OGS_SBI_HTTP_STATUS_BAD_REQUEST, message,
|
||||
"Invalid resource name", message->h.method));
|
||||
END
|
||||
break;
|
||||
|
||||
DEFAULT
|
||||
ogs_error("[%s] Invalid HTTP method [%s]",
|
||||
udm_ue->suci, message->h.method);
|
||||
|
|
|
@ -195,10 +195,12 @@ bool udr_nudr_dr_handle_subscription_authentication(
|
|||
CASE(OGS_SBI_RESOURCE_NAME_AUTHENTICATION_STATUS)
|
||||
SWITCH(recvmsg->h.method)
|
||||
CASE(OGS_SBI_HTTP_METHOD_PUT)
|
||||
CASE(OGS_SBI_HTTP_METHOD_DELETE)
|
||||
OpenAPI_auth_event_t *AuthEvent = NULL;
|
||||
|
||||
AuthEvent = recvmsg->AuthEvent;
|
||||
if (!AuthEvent) {
|
||||
if (!AuthEvent &&
|
||||
!strcmp(recvmsg->h.method, OGS_SBI_HTTP_METHOD_PUT)) {
|
||||
ogs_error("[%s] No AuthEvent", supi);
|
||||
ogs_assert(true ==
|
||||
ogs_sbi_server_send_error(
|
||||
|
|
Loading…
Reference in New Issue