From a94c51ed7ec9e3474df94541b3055c96f075b287 Mon Sep 17 00:00:00 2001 From: yujingwei Date: Thu, 16 Nov 2023 15:37:37 +0800 Subject: [PATCH] feat(thirdparty): introduce gssapi into http client --- src/http/http_client.cpp | 20 ++++++++++---------- src/http/http_method.h | 11 ++++++----- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/http/http_client.cpp b/src/http/http_client.cpp index 6e4b805a13..41e6b7f426 100644 --- a/src/http/http_client.cpp +++ b/src/http/http_client.cpp @@ -221,21 +221,21 @@ dsn::error_s http_client::set_method(http_method method) dsn::error_s http_client::set_auth(http_auth_type authType) { - switch(authType){ + switch (authType) { case http_auth_type::SPNEGO: - RETURN_IF_SETOPT_NOT_OK(CURLOPT_HTTPAUTH, CURLAUTH_NEGOTIATE); - break; + RETURN_IF_SETOPT_NOT_OK(CURLOPT_HTTPAUTH, CURLAUTH_NEGOTIATE); + break; case http_auth_type::DIGEST: - RETURN_IF_SETOPT_NOT_OK(CURLOPT_HTTPAUTH, CURLAUTH_DIGEST); - break; + RETURN_IF_SETOPT_NOT_OK(CURLOPT_HTTPAUTH, CURLAUTH_DIGEST); + break; case http_auth_type::BASIC: - RETURN_IF_SETOPT_NOT_OK(CURLOPT_HTTPAUTH, CURLAUTH_BASIC); - break; + RETURN_IF_SETOPT_NOT_OK(CURLOPT_HTTPAUTH, CURLAUTH_BASIC); + break; case http_auth_type::NONE: - break; + break; default: - RETURN_IF_SETOPT_NOT_OK(CURLOPT_HTTPAUTH, CURLAUTH_ANY); - break; + RETURN_IF_SETOPT_NOT_OK(CURLOPT_HTTPAUTH, CURLAUTH_ANY); + break; } return dsn::error_s::ok(); diff --git a/src/http/http_method.h b/src/http/http_method.h index 2fa5adb1d0..5e13c756fc 100644 --- a/src/http/http_method.h +++ b/src/http/http_method.h @@ -28,11 +28,12 @@ enum class http_method INVALID = 100, }; -enum class http_auth_type { - NONE, - BASIC, - DIGEST, - SPNEGO, +enum class http_auth_type +{ + NONE, + BASIC, + DIGEST, + SPNEGO, }; ENUM_BEGIN(http_method, http_method::INVALID)