File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -40,8 +40,8 @@ def __init__(self, **config):
40
40
self ._next_token = self ._client_ctx .step (None )
41
41
42
42
def auth_bytes (self ):
43
- if self ._is_done :
44
- self ._is_authenticated = True
43
+ if self ._is_authenticated :
44
+ self ._is_done = True
45
45
return self ._next_token or b''
46
46
47
47
def receive (self , auth_bytes ):
@@ -71,10 +71,12 @@ def receive(self, auth_bytes):
71
71
# add authorization identity to the response, and GSS-wrap
72
72
self ._next_token = self ._client_ctx .wrap (b'' .join (message_parts ), False ).message
73
73
# GSSAPI Auth does not have a final broker->client message
74
- # so mark is_done after the final token is generated
74
+ # so we need to be able to identify when the final token is generated
75
+ # here we set _is_authenticated after receiving the final response,
76
+ # but wait until the final send (auth_bytes() call) to set _is_done.
75
77
# in practice we'll still receive a response when using SaslAuthenticate
76
78
# but not when using the prior unframed approach.
77
- self ._is_done = True
79
+ self ._is_authenticated = True
78
80
79
81
def is_done (self ):
80
82
return self ._is_done
You can’t perform that action at this time.
0 commit comments