Просмотр исходного кода

Basic Auth API: renamed struct and union members

Evgeny Grin (Karlson2k) 1 год назад
Родитель
Сommit
92f24c17a3

+ 1 - 1
src/examples2/minimal_auth_basic.c

@@ -49,7 +49,7 @@ req_cb (void *cls,
   static const size_t allowed_password_len =
     (sizeof(allowed_password) / sizeof(char) - 1);
   union MHD_RequestInfoDynamicData req_data;
-  const struct MHD_BasicAuthInfo *creds; /* a shortcut */
+  const struct MHD_AuthBasicCreds *creds; /* a shortcut */
   enum MHD_StatusCode res;
 
   (void) cls;

+ 5 - 5
src/include/microhttpd2.h

@@ -8257,7 +8257,7 @@ MHD_STATIC_INLINE_END_
  *
  * If access to any resource should be limited to specific users, authenticated
  * by Basic Authentication mechanism, and the request for this resource does not
- * have Basic Authentication information (see #MHD_BasicAuthInfo), then response
+ * have Basic Authentication information (see #MHD_AuthBasicCreds), then response
  * with Basic Authentication "challenge" should be sent. This works as
  * an indication that Basic Authentication should be used for the access.
  *
@@ -8304,7 +8304,7 @@ MHD_FN_PAR_NONNULL_ (2) MHD_FN_PAR_CSTR_ (2);
  *
  * If access to any resource should be limited to specific users, authenticated
  * by Basic Authentication mechanism, and the request for this resource does not
- * have Basic Authentication information (see #MHD_BasicAuthInfo), then response
+ * have Basic Authentication information (see #MHD_AuthBasicCreds), then response
  * with Basic Authentication "challenge" should be sent. This works as
  * an indication that Basic Authentication should be used for the access.
  *
@@ -8433,7 +8433,7 @@ MHD_STATIC_INLINE_END_
  *
  * @see #MHD_REQUEST_INFO_DYNAMIC_AUTH_BASIC_CREDS
  */
-struct MHD_BasicAuthInfo
+struct MHD_AuthBasicCreds
 {
   /**
    * The username
@@ -10003,11 +10003,11 @@ union MHD_RequestInfoDynamicData
   const struct MHD_DigestAuthInfo *v_dauth_info;
 
   /**
-   * The information about client's basic auth.
+   * The username and password provided by the client's basic auth header.
    * If #MHD_request_get_info_dynamic_sz() returns #MHD_SC_OK then this pointer
    * is NOT NULL and at least the username data is provided.
    */
-  const struct MHD_BasicAuthInfo *v_auth_basic_creds;
+  const struct MHD_AuthBasicCreds *v_auth_basic_creds;
 };
 
 

+ 5 - 5
src/include/microhttpd2_main.h.in

@@ -3664,7 +3664,7 @@ MHD_STATIC_INLINE_END_
  *
  * If access to any resource should be limited to specific users, authenticated
  * by Basic Authentication mechanism, and the request for this resource does not
- * have Basic Authentication information (see #MHD_BasicAuthInfo), then response
+ * have Basic Authentication information (see #MHD_AuthBasicCreds), then response
  * with Basic Authentication "challenge" should be sent. This works as
  * an indication that Basic Authentication should be used for the access.
  *
@@ -3711,7 +3711,7 @@ MHD_FN_PAR_NONNULL_(2) MHD_FN_PAR_CSTR_ (2);
  *
  * If access to any resource should be limited to specific users, authenticated
  * by Basic Authentication mechanism, and the request for this resource does not
- * have Basic Authentication information (see #MHD_BasicAuthInfo), then response
+ * have Basic Authentication information (see #MHD_AuthBasicCreds), then response
  * with Basic Authentication "challenge" should be sent. This works as
  * an indication that Basic Authentication should be used for the access.
  *
@@ -3840,7 +3840,7 @@ MHD_STATIC_INLINE_END_
  *
  * @see #MHD_REQUEST_INFO_DYNAMIC_AUTH_BASIC_CREDS
  */
-struct MHD_BasicAuthInfo
+struct MHD_AuthBasicCreds
 {
   /**
    * The username
@@ -5410,11 +5410,11 @@ union MHD_RequestInfoDynamicData
   const struct MHD_DigestAuthInfo *v_dauth_info;
 
   /**
-   * The information about client's basic auth.
+   * The username and password provided by the client's basic auth header.
    * If #MHD_request_get_info_dynamic_sz() returns #MHD_SC_OK then this pointer
    * is NOT NULL and at least the username data is provided.
    */
-  const struct MHD_BasicAuthInfo *v_auth_basic_creds;
+  const struct MHD_AuthBasicCreds *v_auth_basic_creds;
 };
 
 

+ 1 - 1
src/mhd2/auth_basic.c

@@ -117,7 +117,7 @@ MHD_INTERNAL MHD_FN_MUST_CHECK_RESULT_ MHD_FN_PAR_NONNULL_ALL_
 MHD_FN_PAR_OUT_ (2) enum MHD_StatusCode
 mhd_request_get_auth_basic_creds (
   struct MHD_Request *restrict req,
-  const struct MHD_BasicAuthInfo **restrict v_auth_basic_creds)
+  const struct MHD_AuthBasicCreds **restrict v_auth_basic_creds)
 {
   enum MHD_StatusCode res;
   mhd_assert (mhd_HTTP_STAGE_HEADERS_PROCESSED <=

+ 1 - 1
src/mhd2/auth_basic.h

@@ -45,7 +45,7 @@
 MHD_INTERNAL enum MHD_StatusCode
 mhd_request_get_auth_basic_creds (
   struct MHD_Request *restrict req,
-  const struct MHD_BasicAuthInfo **restrict v_auth_basic_creds)
+  const struct MHD_AuthBasicCreds **restrict v_auth_basic_creds)
 MHD_FN_MUST_CHECK_RESULT_ MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_OUT_ (2);
 
 #endif /* ! MHD_AUTH_BASIC_H */

+ 3 - 3
src/mhd2/mhd_request.h

@@ -287,8 +287,8 @@ union mhd_ReqContentParsingData
 #ifdef MHD_SUPPORT_AUTH_BASIC
 /**
  * Request Basic Auth internal data
- * The same format as struct MHD_BasicAuthInfo, but wiht nullable username.
- * Keep in sync with MHD_BasicAuthInfo!
+ * The same format as struct MHD_AuthBasicCreds, but wiht nullable username.
+ * Keep in sync with MHD_AuthBasicCreds!
  */
 struct mhd_ReqAuthBasicInternalData
 {
@@ -315,7 +315,7 @@ union mhd_ReqAuthBasicData
   /**
    * The external (application) Basic Auth data
    */
-  struct MHD_BasicAuthInfo extr;
+  struct MHD_AuthBasicCreds extr;
 };
 
 #endif /* MHD_SUPPORT_AUTH_BASIC */

+ 1 - 1
src/tests/client_server/libtest_convenience_server_reply.c

@@ -736,7 +736,7 @@ MHDT_server_reply_check_basic_auth (
   const char *cred = cls;
   union MHD_RequestInfoDynamicData dd;
   enum MHD_StatusCode sc;
-  const struct MHD_BasicAuthInfo *ba;
+  const struct MHD_AuthBasicCreds *ba;
 
   /* should not be needed, except to make gcc happy */
   memset (&dd,