From dec88d0f564a6deb4e19baa78bb6edab8e8efe36 Mon Sep 17 00:00:00 2001 From: "Robbie Harwood (frozencemetery)" Date: Mon, 5 Jan 2015 15:06:38 -0500 Subject: [PATCH] Default first arg where it can be None and was not previously The goal here is to change all calls to methods of the form `add_cred(None)` to `add_cred()` for convenience and clarity. It has been verified that `acquire_cred_from()` can take nulls. This closes #29. --- gssapi/raw/creds.pyx | 2 +- gssapi/raw/ext_cred_store.pyx | 4 +--- gssapi/raw/names.pyx | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/gssapi/raw/creds.pyx b/gssapi/raw/creds.pyx index a4ec11a6..b9bf49f2 100644 --- a/gssapi/raw/creds.pyx +++ b/gssapi/raw/creds.pyx @@ -80,7 +80,7 @@ cdef class Creds: self.raw_creds = NULL -def acquire_cred(Name name, lifetime=None, mechs=None, usage='both'): +def acquire_cred(Name name=None, lifetime=None, mechs=None, usage='both'): """ Get GSSAPI credentials for the given name and mechanisms. diff --git a/gssapi/raw/ext_cred_store.pyx b/gssapi/raw/ext_cred_store.pyx index c835b2e5..98869cea 100644 --- a/gssapi/raw/ext_cred_store.pyx +++ b/gssapi/raw/ext_cred_store.pyx @@ -92,9 +92,7 @@ cdef void c_free_key_value_set(gss_key_value_set_desc *kvset): free(kvset) -# TODO(directxman12): some of these probably need a "not null", -# but that's not clear from the wiki page -def acquire_cred_from(dict store, Name name, lifetime=None, +def acquire_cred_from(dict store=None, Name name=None, lifetime=None, mechs=None, usage='both'): """Acquire credentials from the given store diff --git a/gssapi/raw/names.pyx b/gssapi/raw/names.pyx index b9f5d2a8..8ffeb7e3 100644 --- a/gssapi/raw/names.pyx +++ b/gssapi/raw/names.pyx @@ -163,7 +163,7 @@ def display_name(Name name not None, name_type=True): raise GSSError(maj_stat, min_stat) -def compare_name(Name name1, Name name2): +def compare_name(Name name1=None, Name name2=None): """ Check two GSSAPI names to see if they are the same.