Commit Graph

33 Commits

Author SHA1 Message Date
da9f382d2c web_service: avoid undefined behavior assert of std::string::back (#7347)
Co-authored-by: BuildTools <unconfigured@null.spigotmc.org>
2024-01-12 20:24:01 -08:00
3e692eb383 externals: Upgrade httplib (#6147) 2022-10-06 03:01:37 +02:00
af24f75c18 externals: update httplib and libressl ...
* In older `httplib`, SSL connections were not handled correctly and
  will have issues with proxy servers. Also, keep alive directives were
  not available back then, which is probably necessary to implement
  HTTP_C service correctly.
* Another reason being `httplib` now requires OpenSSL 1.1+ API while
  LibreSSL 2.x provided OpenSSL 1.0 compatible API.
* The bundled LibreSSL has been updated to 3.2.2 so it now provides
  OpenSSL 1.1 compatible API now.
* Also the path hint has been added so that it will find the correct
  path to the CA certs on *nix systems.
* An option is provided so that *nix system distributions/providers can
  use their own SSL implementations when compiling Yuzu/Citra to
  (hopefully) complies with their maintenance guidelines.
* LURLParse is also removed since `httplib` can handle
  `scheme:host:port` string itself now.
2022-01-13 19:32:50 -07:00
Ben
e3dbdcbdff HTTP_C::Implement Context::MakeRequest (#4754)
* HTTP_C::Implement Context::MakeRequest

* httplib: Add add_client_cert_ASN1 and set_verify

* HTTP_C: Fix request methode strings case in MakeRequest

* HTTP_C: clang-format and cleanups

* HTTP_C: Add comment about async in BeginRequest and BeginRequestAsync

* Update httplib to contain all the changes we need; adapt http_c and web_services to the changes in httplib; addressed minor review comments

* Add android-ifaddrs
2020-02-21 19:04:04 +01:00
21c71d21ae general: Use deducation guides for std::lock_guard and std::unique_lock
Since C++17, the introduction of deduction guides for locking facilities
means that we no longer need to hardcode the mutex type into the locks
themselves, making it easier to switch mutex types, should it ever be
necessary in the future.
2019-04-07 15:14:29 +02:00
386bf5c861 citra_qt: Use the new verify backend; UI changes
Displayed username along with nickname (when they are not identical); Requested and displayed user's avatar; Made the dialog bigger for extended names.

Added a few functions to web_backend (GetImage, GetPlain) to support getting data in multiple content-types.

Added a no_avatar icon for users without avatars.
2018-12-15 11:02:54 +08:00
e04f75e1bf web_backend: added GetExternalJWT function
To support requesting external JWTs to use them as verification tokens.
2018-12-15 11:02:53 +08:00
d28233961b Put WebResult into a seperate file 2018-10-27 00:39:02 +02:00
8b98560ebb web_backend: Make Client use the PImpl idiom
Like with TelemetryJson, we can make the implementation details private
and avoid the need to expose httplib to external libraries that need to
use the Client class.
2018-10-23 15:42:22 +02:00
65ec8de31e web_service: hide dependencies to private 2018-10-20 10:47:17 -04:00
57d68bb541 Address review comments 2018-10-20 10:35:55 -04:00
9901b289b6 Review comments -part 4 2018-10-20 10:35:55 -04:00
b0aed19823 Address a bunch of review comments 2018-10-20 10:35:55 -04:00
f3d59556ef web_backend: protect jwt cache with a mutex 2018-09-17 14:28:58 -04:00
77c1f647cb web_service: stop using std::future + callback style async 2018-09-13 16:14:34 -04:00
b82bf1ccdb Change variable name to web_api_url 2018-09-12 19:07:06 +02:00
d408f89a91 Rename announce-url, use variable for JWT retrieval url 2018-09-05 03:07:04 +02:00
604c1b5fc3 web_service: Change authentication system to use JWT (#4041)
* Change authentication system to JWT

* Address review comments
* Get rid of global variable, fix some documentations, fix a bug when verificating
* Refactor PostJson to avoid code duplication
* Rename jwt_token, add functionality to request a new JWT when getting a 401
* Take bools by value instead of const reference
* Send request again when JWT is invalid and use forward declarations
* Omit brackets
2018-08-25 21:39:23 +02:00
0eab948728 reformat all files with clang-format 2018-06-29 16:56:12 +03:00
7c5a76e58b log: replace all NGLOG with LOG 2018-06-29 14:18:07 +03:00
d184a3a1ee Update cpp-httplib for gzip + chunked encoding fixes 2018-06-14 16:00:07 +10:00
c82cd30f62 web_service: Migrate logging macros
Follow-up of #3533

Replace prefix of all logging macros from LOG to NGLOG
2018-03-25 15:35:06 +08:00
9283053701 Move WebServices to use LibreSSL + cpp-httplib (#3501)
Move WebServices to use LibreSSL + cpp-httplib

Remove curl + openssl build dependencies
2018-03-24 13:19:35 -06:00
eba2351f9e Announce-Service: Add conditional variable for the wait in the announce thread 2017-12-14 12:36:37 +01:00
0432fc17eb Add a service to announce multiplayer rooms to web service; Add the abiltiy to receive a list of all announced rooms from web service 2017-12-14 12:36:37 +01:00
28c726f205 WebService: Verify username and token (#2930)
* WebService: Verify username and token; Log errors in PostJson

* Fixup: added docstrings to the functions

* Webservice: Added Icons to the verification, imrpved error detection in cpr, fixup nits

* fixup: fmt warning
2017-09-18 21:18:26 -04:00
7698567fc9 web_backend: Fix CPR bug where Winsock is not properly initializing. 2017-08-26 19:45:41 -04:00
c8562b21d9 web_backend: Fix asynchronous JSON post by spawning new thread. 2017-08-25 23:37:47 -04:00
04bd0c957e web_services: Refactor to remove dependency on Core. 2017-08-25 23:10:02 -04:00
41328afb58 web_backend: User config for username and token, support anonymous post. 2017-08-25 23:10:01 -04:00
28c3575679 web_backend: Specify api-version on JSON post. 2017-07-11 18:34:30 -04:00
a634efa40e web_backend: Add initial interface to POST data to Citra Web Services. 2017-07-11 18:33:25 -04:00
52fbe1e10c web_service: Add skeleton project. 2017-07-10 00:15:40 -04:00