Skip to content
This repository has been archived by the owner on May 10, 2022. It is now read-only.

feat(security): implement start negotiation #134

Merged
merged 11 commits into from
Sep 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions idl/recompile_thrift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ rm -rf $TMP_DIR
mkdir -p $TMP_DIR
$thrift --gen java rrdb.thrift
$thrift --gen java replication.thrift
$thrift --gen java security.thrift

for gen_file in `find $TMP_DIR -name "*.java"`; do
cat apache-licence-template $gen_file > $gen_file.tmp
Expand Down
61 changes: 61 additions & 0 deletions idl/security.thrift
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);
}
Loading