This repository has been archived by the owner on May 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(security): implement start negotiation (#134)
- Loading branch information
Showing
11 changed files
with
2,238 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
include "base.thrift" | ||
|
||
namespace cpp dsn.apps | ||
namespace java com.xiaomi.infra.pegasus.apps | ||
namespace py pypegasus.rrdb | ||
|
||
// negotiation process: | ||
// | ||
// client server | ||
// | --- SASL_LIST_MECHANISMS --> | | ||
// | <-- SASL_LIST_MECHANISMS_RESP --- | | ||
// | -- SASL_SELECT_MECHANISMS --> | | ||
// | <-- SASL_SELECT_MECHANISMS_RESP --- | | ||
// | | | ||
// | --- SASL_INITIATE --> | | ||
// | | | ||
// | <-- SASL_CHALLENGE --- | | ||
// | --- SASL_CHALLENGE_RESP --> | | ||
// | | | ||
// | ..... | | ||
// | | | ||
// | <-- SASL_CHALLENGE --- | | ||
// | --- SASL_CHALLENGE_RESP --> | | ||
// | | (authentication will succeed | ||
// | | if all challenges passed) | ||
// | <-- SASL_SUCC --- | | ||
// (client won't response | | | ||
// if servers says ok) | | | ||
// | --- RPC_CALL ---> | | ||
// | <-- RPC_RESP ---- | | ||
|
||
enum negotiation_status { | ||
INVALID | ||
SASL_LIST_MECHANISMS | ||
SASL_LIST_MECHANISMS_RESP | ||
SASL_SELECT_MECHANISMS | ||
SASL_SELECT_MECHANISMS_RESP | ||
SASL_INITIATE | ||
SASL_CHALLENGE | ||
SASL_CHALLENGE_RESP | ||
SASL_SUCC | ||
SASL_AUTH_DISABLE | ||
SASL_AUTH_FAIL | ||
} | ||
|
||
struct negotiation_request | ||
{ | ||
1: negotiation_status status; | ||
2: base.blob msg; | ||
} | ||
|
||
struct negotiation_response | ||
{ | ||
1: negotiation_status status; | ||
2: base.blob msg; | ||
} | ||
|
||
service security | ||
{ | ||
negotiation_response negotiate(1:negotiation_request request); | ||
} |
Oops, something went wrong.