Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tidy up docs and turn warnings into errors #260

Merged
merged 1 commit into from
Aug 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,14 @@ Extensions

In addition to RFC 2743/2744, Python-GSSAPI also has support for:

* RFC 4178 (GSS-API Negotiation Mechanism)

* RFC 5587 (Extended GSS Mechanism Inquiry APIs)

* RFC 5588 (GSS-API Extension for Storing Delegated Credentials)

* RFC 5801 (GSS-API SASL Extensions)

* (Additional) Credential Store Extension

* Services4User
Expand Down
Empty file added docs/source/_static/.keep
Empty file.
42 changes: 42 additions & 0 deletions docs/source/gssapi.raw.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,34 @@ The following is a list of GSSAPI extensions supported by the low-level API.
be compiled, and will simply not be available in the :mod:`gssapi.raw`
namespace.

:rfc:`4178` (GSS-API Negotiation Mechanism)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. automodule:: gssapi.raw.ext_rfc4178
:members:
:undoc-members:

:rfc:`5587` (GSS-API Extension for Mech Attributes)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. automodule:: gssapi.raw.ext_rfc5587
:members:
:undoc-members:

:rfc:`5588` (GSS-API Extension for Storing Delegated Credentials)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. automodule:: gssapi.raw.ext_rfc5588
:members:
:undoc-members:

:rfc:`5801` (GSS-API SASL Extensions)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. automodule:: gssapi.raw.ext_rfc5801
:members:
:undoc-members:

Credential Store Extensions
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -127,6 +148,13 @@ IOV MIC Extensions
:members:
:undoc-members:

Global Grid Forum (GGF) Extensions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. automodule:: gssapi.raw.ext_ggf
:members:
:undoc-members:

Services4User Extensions
~~~~~~~~~~~~~~~~~~~~~~~~

Expand All @@ -145,6 +173,20 @@ Acquiring Credentials With a Password Extensions
:members:
:undoc-members:

Other Extensions
~~~~~~~~~~~~~~~~

.. automodule:: gssapi.raw.ext_set_cred_opt
:members:
:undoc-members:

Results
-------

.. automodule:: gssapi.raw.named_tuples
:members:
:undoc-members:

Exceptions
----------

Expand Down
65 changes: 33 additions & 32 deletions gssapi/creds.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ class Credentials(rcreds.Creds):
:meth:`acquire` method.

Raises:
BadMechanismError
BadNameTypeError
BadNameError
ExpiredCredentialsError
MissingCredentialsError
~gssapi.exceptions.BadMechanismError
~gssapi.exceptions.BadNameTypeError
~gssapi.exceptions.BadNameError
~gssapi.exceptions.ExpiredCredentialsError
~gssapi.exceptions.MissingCredentialsError
"""

__slots__ = ()
Expand Down Expand Up @@ -108,8 +108,8 @@ def acquire(cls, name=None, lifetime=None, mechs=None, usage='both',
extension.

Args:
name (Name): the name associated with the credentials,
or None for the default name
name (~gssapi.names.Name): the name associated with the
credentials, or None for the default name
lifetime (int): the desired lifetime of the credentials, or None
for indefinite
mechs (list): the desired :class:`MechType` OIDs to be used
Expand All @@ -125,11 +125,11 @@ def acquire(cls, name=None, lifetime=None, mechs=None, usage='both',
them

Raises:
BadMechanismError
BadNameTypeError
BadNameError
ExpiredCredentialsError
MissingCredentialsError
~gssapi.exceptions.BadMechanismError
~gssapi.exceptions.BadNameTypeError
~gssapi.exceptions.BadNameError
~gssapi.exceptions.ExpiredCredentialsError
~gssapi.exceptions.MissingCredentialsError
"""

if store is None:
Expand Down Expand Up @@ -166,7 +166,7 @@ def store(self, store=None, usage='both', mech=None,
or None for the default store.
usage (str): the usage to store the credentials with -- either
'both', 'initiate', or 'accept'
mech (OID): the :class:`MechType` to associate with the
mech (~gssapi.OID): the :class:`MechType` to associate with the
stored credentials
overwrite (bool): whether or not to overwrite existing credentials
stored with the same name, etc
Expand All @@ -177,11 +177,11 @@ def store(self, store=None, usage='both', mech=None,
StoreCredResult: the results of the credential storing operation

Raises:
GSSError
ExpiredCredentialsError
MissingCredentialsError
OperationUnavailableError
DuplicateCredentialsElementError
~gssapi.exceptions.GSSError
~gssapi.exceptions.ExpiredCredentialsError
~gssapi.exceptions.MissingCredentialsError
~gssapi.exceptions.OperationUnavailableError
~gssapi.exceptions.DuplicateCredentialsElementError
"""

if store is None:
Expand Down Expand Up @@ -212,7 +212,7 @@ def impersonate(self, name=None, lifetime=None, mechs=None,
:requires-ext:`s4u`

Args:
name (Name): the name to impersonate
name (~gssapi.names.Name): the name to impersonate
lifetime (int): the desired lifetime of the new credentials,
or None for indefinite
mechs (list): the desired :class:`MechType` OIDs for the new
Expand Down Expand Up @@ -251,9 +251,9 @@ def inquire(self, name=True, lifetime=True, usage=True, mechs=True):
with None used when the corresponding argument was False

Raises:
MissingCredentialsError
InvalidCredentialsError
ExpiredCredentialsError
~gssapi.exceptions.MissingCredentialsError
~gssapi.exceptions.InvalidCredentialsError
~gssapi.exceptions.ExpiredCredentialsError
"""

res = rcreds.inquire_cred(self, name, lifetime, usage, mechs)
Expand All @@ -274,7 +274,8 @@ def inquire_by_mech(self, mech, name=True, init_lifetime=True,
about them.

Args:
mech (OID): the mechanism for which to retrive the information
mech (~gssapi.OID): the mechanism for which to retrive the
information
name (bool): get the name associated with the credentials
init_lifetime (bool): get the remaining initiate lifetime for
the credentials
Expand Down Expand Up @@ -327,10 +328,10 @@ def add(self, name, mech, usage='both',
`impersonator` argument.

Args:
name (Name): the name associated with the
credentials
mech (OID): the desired :class:`MechType` to be used with the
name (~gssapi.names.Name): the name associated with the
credentials
mech (~gssapi.OID): the desired :class:`MechType` to be used with
the credentials
usage (str): the usage for the credentials -- either 'both',
'initiate', or 'accept'
init_lifetime (int): the desired initiate lifetime of the
Expand All @@ -349,12 +350,12 @@ def add(self, name, mech, usage='both',
and the newly acquired ones.

Raises:
BadMechanismError
BadNameTypeError
BadNameError
DuplicateCredentialsElementError
ExpiredCredentialsError
MissingCredentialsError
~gssapi.exceptions.BadMechanismError
~gssapi.exceptions.BadNameTypeError
~gssapi.exceptions.BadNameError
~gssapi.exceptions.DuplicateCredentialsElementError
~gssapi.exceptions.ExpiredCredentialsError
~gssapi.exceptions.MissingCredentialsError
"""

if store is not None and impersonator is not None:
Expand Down
8 changes: 4 additions & 4 deletions gssapi/mechs.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,13 @@ def from_name(cls, name=None):
Get a generator of mechanisms that may be able to process the name
Args:
name (Name): a name to inquire about
name (~gssapi.names.Name): a name to inquire about
Returns:
[Mechanism]: a set of mechanisms which support this name
Raises:
GSSError
~gssapi.exceptions.GSSError
"""
return (cls(mech) for mech in rmisc.inquire_mechs_for_name(name))

Expand All @@ -143,7 +143,7 @@ def from_sasl_name(cls, name=None):
Mechanism: the desired mechanism
Raises:
GSSError
~gssapi.exceptions.GSSError
:requires-ext:`rfc5801`
"""
Expand Down Expand Up @@ -173,7 +173,7 @@ def from_attrs(cls, desired_attrs=None, except_attrs=None,
[Mechanism]: A set of mechanisms having the desired features.
Raises:
GSSError
~gssapi.exceptions.GSSError
:requires-ext:`rfc5587`
"""
Expand Down
28 changes: 14 additions & 14 deletions gssapi/names.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ def __init__(self, base=None, name_type=None, token=None, composite=False):
name type.
Raises:
BadNameTypeError
BadNameError
BadMechanismError
~gssapi.exceptions.BadNameTypeError
~gssapi.exceptions.BadNameError
~gssapi.exceptions.BadMechanismError
"""

if rname_rfc6680 is not None:
Expand Down Expand Up @@ -137,14 +137,14 @@ def display_as(self, name_type):
:requires-ext:`rfc6680`
Args:
name_type (OID): the :class:`NameType` to use to display the given
name
name_type (~gssapi.OID): the :class:`NameType` to use to display
the given name
Returns:
str: the displayed name
Raises:
OperationUnavailableError
~gssapi.exceptions.OperationUnavailableError
"""

if rname_rfc6680 is None:
Expand Down Expand Up @@ -189,9 +189,9 @@ def export(self, composite=False):
bytes: the exported name in token form
Raises:
MechanismNameRequiredError
BadNameTypeError
BadNameError
~gssapi.exceptions.MechanismNameRequiredError
~gssapi.exceptions.BadNameTypeError
~gssapi.exceptions.BadNameError
"""

if composite:
Expand All @@ -211,15 +211,15 @@ def canonicalize(self, mech):
to the given mechanism.
Args:
mech (OID): the :class:`MechType` to use
mech (~gssapi.OID): the :class:`MechType` to use
Returns:
Name: the canonicalized name
Raises:
BadMechanismError
BadNameTypeError
BadNameError
~gssapi.exceptions.BadMechanismError
~gssapi.exceptions.BadNameTypeError
~gssapi.exceptions.BadNameError
"""

return type(self)(rname.canonicalize_name(self, mech))
Expand Down Expand Up @@ -249,7 +249,7 @@ def _inquire(self, **kwargs):
fields set to None
Raises:
GSSError
~gssapi.exceptions.GSSError
"""

if rname_rfc6680 is None:
Expand Down
6 changes: 4 additions & 2 deletions gssapi/raw/chan_bindings.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ cdef class ChannelBindings:
acceptor_address=None, application_data=None):
"""
Args:
initiator_address_type (AddressType): the initiator address type
initiator_address_type (~gssapi.AddressType): the initiator address
type
initiator_address (bytes): the initiator address
acceptor_address_type (AddressType): the acceptor address type
acceptor_address_type (~gssapi.AddressType): the acceptor address
type
acceptor_address (bytes): the acceptor address
application_data (bytes): additional application-specific data
"""
Expand Down
Loading