@@ -80,7 +80,7 @@ cdef class Creds:
80
80
self .raw_creds = NULL
81
81
82
82
83
- def acquire_cred (Name name , ttl = None , mechs = None , usage = ' both' ):
83
+ def acquire_cred (Name name , lifetime = None , mechs = None , usage = ' both' ):
84
84
"""
85
85
Get GSSAPI credentials for the given name and mechanisms.
86
86
@@ -91,7 +91,8 @@ def acquire_cred(Name name, ttl=None, mechs=None, usage='both'):
91
91
Args:
92
92
name (Name): the name for which to acquire the credentials (or None
93
93
for the "no name" functionality)
94
- ttl (int): the lifetime for the credentials (or None for indefinite)
94
+ lifetime (int): the lifetime for the credentials (or None for
95
+ indefinite)
95
96
mechs ([MechType]): the desired mechanisms for which the credentials
96
97
should work, or None for the default set
97
98
usage (str): the usage type for the credentials: may be
@@ -112,7 +113,7 @@ def acquire_cred(Name name, ttl=None, mechs=None, usage='both'):
112
113
else :
113
114
desired_mechs = GSS_C_NO_OID_SET
114
115
115
- cdef OM_uint32 input_ttl = c_py_ttl_to_c(ttl )
116
+ cdef OM_uint32 input_ttl = c_py_ttl_to_c(lifetime )
116
117
117
118
cdef gss_name_t c_name
118
119
if name is None :
@@ -173,7 +174,8 @@ def release_cred(Creds creds not None):
173
174
174
175
175
176
def add_cred (Creds input_cred , Name name not None , OID mech not None ,
176
- usage = ' initiate' , initiator_ttl = None , acceptor_ttl = None ):
177
+ usage = ' initiate' , init_lifetime = None ,
178
+ accept_lifetime = None ):
177
179
""" Add a credential element to a credential.
178
180
179
181
This method can be used to either compose two credentials (i.e., original
@@ -186,9 +188,9 @@ def add_cred(Creds input_cred, Name name not None, OID mech not None,
186
188
mech (MechType): the desired security mechanism (required).
187
189
usage (str): usage type for credentials. Possible values:
188
190
'initiate' (default), 'accept', 'both' (failsafe).
189
- initiator_ttl (int): lifetime of credentials for use in initiating
191
+ init_lifetime (int): lifetime of credentials for use in initiating
190
192
security contexts (None for indefinite)
191
- acceptor_ttl (int): lifetime of credentials for use in accepting
193
+ accept_lifetime (int): lifetime of credentials for use in accepting
192
194
security contexts (None for indefinite)
193
195
194
196
Returns:
@@ -214,8 +216,8 @@ def add_cred(Creds input_cred, Name name not None, OID mech not None,
214
216
else :
215
217
raw_input_cred = GSS_C_NO_CREDENTIAL
216
218
217
- cdef OM_uint32 input_initiator_ttl = c_py_ttl_to_c(initiator_ttl )
218
- cdef OM_uint32 input_acceptor_ttl = c_py_ttl_to_c(acceptor_ttl )
219
+ cdef OM_uint32 input_initiator_ttl = c_py_ttl_to_c(init_lifetime )
220
+ cdef OM_uint32 input_acceptor_ttl = c_py_ttl_to_c(accept_lifetime )
219
221
220
222
cdef gss_cred_id_t output_creds
221
223
cdef gss_OID_set actual_mechs
@@ -241,16 +243,16 @@ def add_cred(Creds input_cred, Name name not None, OID mech not None,
241
243
raise GSSError(maj_stat, min_stat)
242
244
243
245
244
- def inquire_cred (Creds creds not None , name = True , ttl = True ,
245
- usage = True , mechs = True ):
246
+ def inquire_cred (Creds creds not None , name = True , lifetime = True , usage = True ,
247
+ mechs = True ):
246
248
""" Inspect credentials for information
247
249
248
250
This method inspects a :class:`Creds` object for information.
249
251
250
252
Args:
251
253
creds (Creds): the credentials to inspect
252
254
name (bool): get the Name associated with the credentials
253
- ttl (bool): get the TTL for the credentials
255
+ lifetime (bool): get the TTL for the credentials
254
256
usage (bool): get the usage type of the credentials
255
257
mechs (bool): the mechanims used with the credentials
256
258
@@ -270,7 +272,7 @@ def inquire_cred(Creds creds not None, name=True, ttl=True,
270
272
271
273
cdef OM_uint32 res_ttl
272
274
cdef OM_uint32 * res_ttl_ptr = NULL
273
- if ttl :
275
+ if lifetime :
274
276
res_ttl_ptr = & res_ttl
275
277
276
278
cdef gss_cred_usage_t res_usage
@@ -305,7 +307,7 @@ def inquire_cred(Creds creds not None, name=True, ttl=True,
305
307
py_usage = ' both'
306
308
307
309
py_ttl = None
308
- if ttl :
310
+ if lifetime :
309
311
py_ttl = c_c_ttl_to_py(res_ttl)
310
312
311
313
py_mechs = None
@@ -318,8 +320,8 @@ def inquire_cred(Creds creds not None, name=True, ttl=True,
318
320
319
321
320
322
def inquire_cred_by_mech (Creds creds not None , OID mech not None ,
321
- name = True , initiator_ttl = True ,
322
- acceptor_ttl = True , usage = True ):
323
+ name = True , init_lifetime = True ,
324
+ accept_lifetime = True , usage = True ):
323
325
""" Inspect credentials for mechanism-specific
324
326
325
327
This method inspects a :class:`Creds` object for information
@@ -329,8 +331,8 @@ def inquire_cred_by_mech(Creds creds not None, OID mech not None,
329
331
creds (Creds): the credentials to inspect
330
332
mech (OID): the desired mechanism
331
333
name (bool): get the Name associated with the credentials
332
- initiator_ttl (bool): get the initiator TTL for the credentials
333
- acceprot_ttl (bool): get the acceptor TTL for the credentials
334
+ init_lifetime (bool): get the initiator TTL for the credentials
335
+ accept_lifetime (bool): get the acceptor TTL for the credentials
334
336
usage (bool): get the usage type of the credentials
335
337
336
338
Returns:
@@ -349,12 +351,12 @@ def inquire_cred_by_mech(Creds creds not None, OID mech not None,
349
351
350
352
cdef OM_uint32 res_initiator_ttl
351
353
cdef OM_uint32 * res_initiator_ttl_ptr = NULL
352
- if initiator_ttl :
354
+ if init_lifetime :
353
355
res_initiator_ttl_ptr = & res_initiator_ttl
354
356
355
357
cdef OM_uint32 res_acceptor_ttl
356
358
cdef OM_uint32 * res_acceptor_ttl_ptr = NULL
357
- if acceptor_ttl :
359
+ if accept_lifetime :
358
360
res_acceptor_ttl_ptr = & res_acceptor_ttl
359
361
360
362
cdef gss_cred_usage_t res_usage
@@ -376,11 +378,11 @@ def inquire_cred_by_mech(Creds creds not None, OID mech not None,
376
378
rn = None
377
379
378
380
py_initiator_ttl = None
379
- if initiator_ttl :
381
+ if init_lifetime :
380
382
py_initiator_ttl = c_c_ttl_to_py(res_initiator_ttl)
381
383
382
384
py_acceptor_ttl = None
383
- if acceptor_ttl :
385
+ if accept_lifetime :
384
386
py_acceptor_ttl = c_c_ttl_to_py(res_acceptor_ttl)
385
387
386
388
py_usage = None
0 commit comments