Skip to content

Commit 4ec03e4

Browse files
committed
SaslAuthenticate v0/v1 protocol defs
1 parent 51b66ff commit 4ec03e4

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
from __future__ import absolute_import
2+
3+
from kafka.protocol.api import Request, Response
4+
from kafka.protocol.types import Array, Bytes, Int16, Int64, Schema, String
5+
6+
7+
class SaslAuthenticateResponse_v0(Response):
8+
API_KEY = 36
9+
API_VERSION = 0
10+
SCHEMA = Schema(
11+
('error_code', Int16),
12+
('error_message', String('utf-8')),
13+
('auth_bytes', Bytes))
14+
15+
16+
class SaslAuthenticateResponse_v1(Response):
17+
API_KEY = 36
18+
API_VERSION = 1
19+
SCHEMA = Schema(
20+
('error_code', Int16),
21+
('error_message', String('utf-8')),
22+
('auth_bytes', Bytes),
23+
('session_lifetime_ms', Int64))
24+
25+
26+
class SaslAuthenticateRequest_v0(Request):
27+
API_KEY = 36
28+
API_VERSION = 0
29+
RESPONSE_TYPE = SaslAuthenticateResponse_v0
30+
SCHEMA = Schema(
31+
('auth_bytes', Bytes))
32+
33+
34+
class SaslAuthenticateRequest_v1(Request):
35+
API_KEY = 36
36+
API_VERSION = 1
37+
RESPONSE_TYPE = SaslAuthenticateResponse_v1
38+
SCHEMA = SaslAuthenticateRequest_v0.SCHEMA
39+
40+
41+
SaslAuthenticateRequest = [SaslAuthenticateRequest_v0, SaslAuthenticateRequest_v1]
42+
SaslAuthenticateResponse = [SaslAuthenticateResponse_v0, SaslAuthenticateResponse_v1]

0 commit comments

Comments
 (0)