@@ -22,7 +22,8 @@ class SecurityContext(rsec_contexts.SecurityContext):
22
22
:class:`~gssapi.raw.sec_contexts.SecurityContext` class,
23
23
and thus may used with both low-level and high-level API methods.
24
24
25
- This class may be pickled an unpickled.
25
+ This class may be pickled and unpickled (the attached delegated
26
+ credentials object will not be preserved, however).
26
27
"""
27
28
28
29
def __new__ (cls , base = None , token = None ,
@@ -106,7 +107,7 @@ def __init__(self, base=None, token=None,
106
107
self ._channel_bindings = channel_bindings
107
108
self ._creds = creds
108
109
109
- self .delegated_creds = None
110
+ self ._delegated_creds = None
110
111
111
112
else :
112
113
# we already have a context in progress, just inspect it
@@ -418,6 +419,18 @@ def lifetime(self):
418
419
"""The amount of time for which this context remains valid"""
419
420
return rsec_contexts .context_time (self )
420
421
422
+ @property
423
+ def delegated_creds (self ):
424
+ """The credentials delegated from the initiator to the acceptor
425
+
426
+ .. warning::
427
+
428
+ This value will not be preserved across picklings. These should
429
+ be separately exported and transfered.
430
+
431
+ """
432
+ return self ._delegated_creds
433
+
421
434
initiator_name = _utils .inquire_property (
422
435
'initiator_name' , 'The :class:`Name` of the initiator of this context' )
423
436
target_name = _utils .inquire_property (
@@ -512,9 +525,9 @@ def _acceptor_step(self, token):
512
525
self , self ._channel_bindings )
513
526
514
527
if res .delegated_creds is not None :
515
- self .delegated_creds = Credentials (res .delegated_creds )
528
+ self ._delegated_creds = Credentials (res .delegated_creds )
516
529
else :
517
- self .delegated_creds = None
530
+ self ._delegated_creds = None
518
531
519
532
self ._complete = not res .more_steps
520
533
0 commit comments