Skip to content

Commit

Permalink
feat(thirdparty): introduce gssapi into http client
Browse files Browse the repository at this point in the history
  • Loading branch information
Samunroyu committed Nov 16, 2023
1 parent 4372af4 commit b74985b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
20 changes: 10 additions & 10 deletions src/http/http_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
11 changes: 6 additions & 5 deletions src/http/http_method.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b74985b

Please sign in to comment.