matrix-coro

A WIP highlevel matrix c++ SDK with a MAS first approach
git clone git://archive.git.mtrnord.blog/MTRNord/matrix-coro.git
Log | Files | Refs | README | LICENSE

json.hpp (2710B)


      1 #pragma once
      2 #include <optional>
      3 
      4 #include <json/json.h>
      5 
      6 struct WellKnownResponse {
      7     std::string homeserver;
      8     std::string identity_server;
      9     Json::Value raw;
     10 };
     11 
     12 struct AuthIssuerResponse {
     13     std::string issuer;
     14 };
     15 
     16 struct OpenIDConfiguration {
     17     std::string issuer;
     18     std::string authorization_endpoint;
     19     std::string token_endpoint;
     20     std::string jwks_uri;
     21     std::string registration_endpoint;
     22     std::vector<std::string> scopes_supported;
     23     std::vector<std::string> response_types_supported;
     24     std::vector<std::string> response_modes_supported;
     25     std::vector<std::string> grant_types_supported;
     26     std::vector<std::string> token_endpoint_auth_methods_supported;
     27     std::vector<std::string> token_endpoint_auth_signing_alg_values_supported;
     28     std::string revocation_endpoint;
     29     std::vector<std::string> revocation_endpoint_auth_methods_supported;
     30     std::vector<std::string> revocation_endpoint_auth_signing_alg_values_supported;
     31     std::string introspection_endpoint;
     32     std::vector<std::string> introspection_endpoint_auth_methods_supported;
     33     std::vector<std::string> introspection_endpoint_auth_signing_alg_values_supported;
     34     std::vector<std::string> code_challenge_methods_supported;
     35     std::string userinfo_endpoint;
     36     std::vector<std::string> subject_types_supported;
     37     std::vector<std::string> id_token_signing_alg_values_supported;
     38     std::vector<std::string> userinfo_signing_alg_values_supported;
     39     std::vector<std::string> display_values_supported;
     40     std::vector<std::string> claim_types_supported;
     41     std::vector<std::string> claims_supported;
     42     bool claims_parameter_supported;
     43     bool request_parameter_supported;
     44     bool request_uri_parameter_supported;
     45     std::vector<std::string> prompt_values_supported;
     46     std::string device_authorization_endpoint;
     47     std::string org_matrix_matrix_authentication_service_graphql_endpoint;
     48     std::string account_management_uri;
     49     std::vector<std::string> account_management_actions_supported;
     50 };
     51 
     52 struct ClientRegistrationData {
     53     std::string application_type;
     54     std::string client_name;
     55     std::string client_uri;
     56     std::string token_endpoint_auth_method;
     57     std::vector<std::string> redirect_uris;
     58     std::vector<std::string> response_types;
     59     std::vector<std::string> grant_types;
     60     std::vector<std::string> contacts;
     61 };
     62 
     63 struct ClientRegistrationResponse {
     64     std::string client_id;
     65     int client_id_issued_at;
     66 };
     67 
     68 struct TokenResponse {
     69     std::string access_token;
     70     std::string refresh_token;
     71     std::string token_type;
     72     int expires_in;
     73     std::string scope;
     74 };
     75 
     76 struct WhoamiResponse {
     77     std::string user_id;
     78     std::string device_id;
     79     bool is_guest;
     80 };