[PR #3870] feat: Add mocked NpAuth, NpWebApi responses and basic HTTP functionality #3774

Open
opened 2026-02-27 22:04:56 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/3870
Author: @mercury501
Created: 12/19/2025
Status: 🔄 Open

Base: mainHead: http_research


📝 Commits (10+)

  • 5811184 httplib, np_signaling
  • 75695aa WIP sceHttp
  • 6fe3bf1 sceHttp, sceNpScore
  • 8e1377c mocked sceNpWebApiRequests
  • f4356a2 Clang format
  • 28c44bd Changed size_t to u64, debug log level, invalid argument errors
  • 0fe9a28 Added invalid argument to sceNpWebApiGetHttpStatusCode
  • 98b9918 error handling, added http methods
  • 4a1432a Fixed http method check
  • d6fe116 Small fixes

📊 Changes

17 files changed (+1005 additions, -60 deletions)

View changed files

📝 .gitmodules (+3 -0)
📝 CMakeLists.txt (+3 -1)
📝 externals/CMakeLists.txt (+4 -0)
externals/cpp-httplib (+1 -0)
📝 src/common/logging/filter.cpp (+1 -0)
📝 src/common/logging/types.h (+1 -0)
📝 src/core/libraries/libs.cpp (+2 -0)
📝 src/core/libraries/network/http.cpp (+292 -30)
📝 src/core/libraries/network/http.h (+326 -9)
📝 src/core/libraries/np/np_auth.cpp (+5 -3)
📝 src/core/libraries/np/np_error.h (+5 -1)
📝 src/core/libraries/np/np_score.cpp (+19 -4)
📝 src/core/libraries/np/np_score.h (+2 -1)
src/core/libraries/np/np_signaling.cpp (+186 -0)
src/core/libraries/np/np_signaling.h (+41 -0)
📝 src/core/libraries/np/np_web_api.cpp (+96 -7)
📝 src/core/libraries/np/np_web_api.h (+18 -4)

📄 Description

Made GetAuthorizationCode from NpAuth return a dummy code (could be exposed in configs to be used for custom authentication like a secret)
Added basic mocked responses to sceNpWebApi for friendList and blockList

Added basic http functionality to sceHttp, for now, every call is redirected to localhost.

Open to suggestions on configs, considerations and enhancements in general.

Cheers!


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/3870 **Author:** [@mercury501](https://github.com/mercury501) **Created:** 12/19/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `http_research` --- ### 📝 Commits (10+) - [`5811184`](https://github.com/shadps4-emu/shadPS4/commit/58111848f0a8373c6c9951ba0ace3df52e5216f9) httplib, np_signaling - [`75695aa`](https://github.com/shadps4-emu/shadPS4/commit/75695aa1698f59b5980b1ca7b3000fb9219f32bb) WIP sceHttp - [`6fe3bf1`](https://github.com/shadps4-emu/shadPS4/commit/6fe3bf11343ae92468d7a92d17c50e0bdaaebe82) sceHttp, sceNpScore - [`8e1377c`](https://github.com/shadps4-emu/shadPS4/commit/8e1377c0a9b996124ca2ecfa0f2642688fe454b7) mocked sceNpWebApiRequests - [`f4356a2`](https://github.com/shadps4-emu/shadPS4/commit/f4356a288c7b13a0af9fd732cf48006f68f253b0) Clang format - [`28c44bd`](https://github.com/shadps4-emu/shadPS4/commit/28c44bd09d07e3bfa247655380aa2a9d9952a085) Changed size_t to u64, debug log level, invalid argument errors - [`0fe9a28`](https://github.com/shadps4-emu/shadPS4/commit/0fe9a28b2509777be14fe46745cf750832b4bc4f) Added invalid argument to sceNpWebApiGetHttpStatusCode - [`98b9918`](https://github.com/shadps4-emu/shadPS4/commit/98b99188e7fd82260d12ecea33537559f86726cd) error handling, added http methods - [`4a1432a`](https://github.com/shadps4-emu/shadPS4/commit/4a1432a003ba0847d39ae28148674e44846cb16e) Fixed http method check - [`d6fe116`](https://github.com/shadps4-emu/shadPS4/commit/d6fe116e89c7b2a57017cf7eb6fea951fec85070) Small fixes ### 📊 Changes **17 files changed** (+1005 additions, -60 deletions) <details> <summary>View changed files</summary> 📝 `.gitmodules` (+3 -0) 📝 `CMakeLists.txt` (+3 -1) 📝 `externals/CMakeLists.txt` (+4 -0) ➕ `externals/cpp-httplib` (+1 -0) 📝 `src/common/logging/filter.cpp` (+1 -0) 📝 `src/common/logging/types.h` (+1 -0) 📝 `src/core/libraries/libs.cpp` (+2 -0) 📝 `src/core/libraries/network/http.cpp` (+292 -30) 📝 `src/core/libraries/network/http.h` (+326 -9) 📝 `src/core/libraries/np/np_auth.cpp` (+5 -3) 📝 `src/core/libraries/np/np_error.h` (+5 -1) 📝 `src/core/libraries/np/np_score.cpp` (+19 -4) 📝 `src/core/libraries/np/np_score.h` (+2 -1) ➕ `src/core/libraries/np/np_signaling.cpp` (+186 -0) ➕ `src/core/libraries/np/np_signaling.h` (+41 -0) 📝 `src/core/libraries/np/np_web_api.cpp` (+96 -7) 📝 `src/core/libraries/np/np_web_api.h` (+18 -4) </details> ### 📄 Description Made GetAuthorizationCode from NpAuth return a dummy code (could be exposed in configs to be used for custom authentication like a secret) Added basic mocked responses to sceNpWebApi for friendList and blockList Added basic http functionality to sceHttp, for now, every call is redirected to localhost. Open to suggestions on configs, considerations and enhancements in general. Cheers! --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#3774
No description provided.