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

Added ok_as_delegate flags #218

Merged
merged 1 commit into from
Jul 14, 2020
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
28 changes: 28 additions & 0 deletions docs/source/gssapi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,34 @@ imported in the high-level API :mod:`gssapi` module:
.. autoclass:: gssapi.RequirementFlag
:show-inheritance:

The ``ok_as_delegate`` flag corresponds to the C level flag
``GSS_C_DELEG_POLICY_FLAG``. This flag is similar to ``delegate_to_peer``
except it only delegates if the KDC delegation policies for the service
principal allow it to use delegation. This is typically used on Microsoft
domain environments to control whether constrained or unconstrained delegation
is allowed for a service principal. By setting this flag, the delegation
process follows the same behaviour as delegation on SSPI/Windows.

Here are the four cases when either of these flags are set or not.

Neither flag set
No delegation occurs.

delegate_to_peer
Always try to delegate regardless of the KDC delegation policies.
``delegate_to_peer`` is set in the return flags if successful.

ok_as_delegate
jborean93 marked this conversation as resolved.
Show resolved Hide resolved
Try to delegate but only if the KDC trusts the service principal for
delegation. ``delegate_to_peer`` and ``ok_as_delegate`` are set in the
return flags if successful.

delegate_to_peer | ok_as_delegate
Acts like ``delegate_to_peer`` being set but will also set
``ok_as_delegate`` in the return flags if the service principal was trusted
for delegation by the KDC.


.. autoclass:: gssapi.AddressType
:show-inheritance:

Expand Down
1 change: 1 addition & 0 deletions gssapi/raw/cython_types.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ cdef extern from "python_gssapi.h":
OM_uint32 GSS_C_ANON_FLAG
OM_uint32 GSS_C_TRANS_FLAG
OM_uint32 GSS_C_PROT_READY_FLAG
OM_uint32 GSS_C_DELEG_POLICY_FLAG

# address types
OM_uint32 GSS_C_AF_UNSPEC
Expand Down
1 change: 1 addition & 0 deletions gssapi/raw/types.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class RequirementFlag(IntEnum, metaclass=ExtendableEnum):
anonymity = GSS_C_ANON_FLAG
protection_ready = GSS_C_PROT_READY_FLAG
transferable = GSS_C_TRANS_FLAG
ok_as_delegate = GSS_C_DELEG_POLICY_FLAG


class AddressType(IntEnum, metaclass=ExtendableEnum):
Expand Down