Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6b32538

Browse files
Fix up doc references
Signed-off-by: Jordan Borean <jborean93@gmail.com>
1 parent 08e2b09 commit 6b32538

File tree

7 files changed

+156
-81
lines changed

7 files changed

+156
-81
lines changed

‎gssapi/names.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class Name(rname.Name):
2424
2525
This class may be pickled and unpickled, as well as copied.
2626
27-
The :func:`str` and :func:`bytes` methods may be used to retrieve the
27+
The :class:`str` and :class:`bytes` methods may be used to retrieve the
2828
text of the name.
2929
3030
Note:
@@ -322,13 +322,13 @@ def mech(self) -> roids.OID:
322322
return self._inquire(mech_name=True).mech
323323

324324
@property
325-
def attributes(self) -> t.Optional["_NameAttributeMapping"]:
325+
def attributes(self) -> t.Optional[MutableMapping]:
326326
"""The attributes of this name (:requires-ext:`rfc6680`)
327327
328328
The attributes are presenting in the form of a
329-
:class:`~collections.MutableMapping` (a dict-like object).
329+
:class:`~collections.abc.MutableMapping` (a dict-like object).
330330
331-
Retrieved values will always be in the form of :class:`frozensets`.
331+
Retrieved values will always be in the form of :class:`frozenset`.
332332
333333
When assigning values, if iterables are used, they be considered to be
334334
the set of values for the given attribute. If a non-iterable is used,

‎gssapi/raw/_enum_extensions/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,9 @@ def __new__(
3333
else:
3434
classdict[extra_name] = extra_val
3535

36-
return super(ExtendableEnum, metacl).__new__(metacl, name,
37-
bases, classdict)
36+
return super(ExtendableEnum, metacl).__new__(
37+
metacl,
38+
name,
39+
bases,
40+
classdict, # type: ignore[arg-type] # Uses private explicit type
41+
)

‎gssapi/raw/creds.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def add_cred(
9494
and new credential), or to add a new element to an existing credential.
9595
9696
Args:
97-
input_cred (Cred): the set of credentials to which to add the new
97+
input_cred (Creds): the set of credentials to which to add the new
9898
credentials
9999
name (~gssapi.raw.names.Name): name of principal to acquire a
100100
credential for

‎gssapi/raw/named_tuples.py

Lines changed: 141 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -4,150 +4,220 @@
44
from gssapi.raw.types import RequirementFlag
55

66
if TYPE_CHECKING:
7-
import gssapi.rawasg
7+
import gssapi
88

99

1010
class AcquireCredResult(NamedTuple):
1111
"""Credential result when acquiring a GSSAPI credential."""
12-
creds: "g.Creds" #: GSSAPI credentials that were acquired
13-
mechs: Set[OID] #: Set of mechs the cred is for
14-
lifetime: int #: Number of seconds for which the cred will remain valid
12+
#: GSSAPI credentials that were acquired
13+
creds: "gssapi.raw.creds.Creds"
14+
#: Set of mechs the cred is for
15+
mechs: Set[OID]
16+
#: Number of seconds for which the cred will remain valid
17+
lifetime: int
1518

1619

1720
class InquireCredResult(NamedTuple):
1821
"""Information about the credential."""
19-
name: Optional["g.Name"] #: The principal associated with the credential
20-
lifetime: Optional[int] #: Number of seconds which the cred is valid for
21-
usage: Optional[str] #: How the credential can be used
22-
mechs: Optional[Set[OID]] #: Set of mechs the cred is for
22+
#: The principal associated with the credential
23+
name: Optional["gssapi.raw.names.Name"]
24+
#: Number of seconds which the cred is valid for
25+
lifetime: Optional[int]
26+
#: How the credential can be used
27+
usage: Optional[str]
28+
#: Set of mechs the cred is for
29+
mechs: Optional[Set[OID]]
2330

2431

2532
class InquireCredByMechResult(NamedTuple):
2633
"""Information about the credential for a specific mechanism."""
27-
name: Optional["g.Name"] #: The principal associated with the credential
28-
init_lifetime: Optional[int] #: Time valid for initiation, in seconds
29-
accept_lifetime: Optional[int] #: Time valid for accepting, in seconds
30-
usage: Optional[str] #: How the credential can be used
34+
#: The principal associated with the credential
35+
name: Optional["gssapi.raw.names.Name"]
36+
#: Time valid for initiation, in seconds
37+
init_lifetime: Optional[int]
38+
#: Time valid for accepting, in seconds
39+
accept_lifetime: Optional[int]
40+
#: How the credential can be used
41+
usage: Optional[str]
3142

3243

3344
class AddCredResult(NamedTuple):
3445
"""Result of adding to a GSSAPI credential."""
35-
creds: Optional["g.Creds"] #: The credential that was generated
36-
mechs: Set[OID] #: Set of mechs the cred is for
37-
init_lifetime: int #: Time valid for initiation, in seconds
38-
accept_lifetime: int #: Time valid for accepting, in seconds
46+
#: The credential that was generated
47+
creds: Optional["gssapi.raw.creds.Creds"]
48+
#: Set of mechs the cred is for
49+
mechs: Set[OID]
50+
#: Time valid for initiation, in seconds
51+
init_lifetime: int
52+
#: Time valid for accepting, in seconds
53+
accept_lifetime: int
3954

4055

4156
class DisplayNameResult(NamedTuple):
4257
"""Textual representation of a GSSAPI name."""
43-
name: bytes #: The representation of the GSSAPI name
44-
name_type: Optional[OID] #: The type of GSSAPI name
58+
#: The representation of the GSSAPI name
59+
name: bytes
60+
#: The type of GSSAPI name
61+
name_type: Optional[OID]
4562

4663

4764
class WrapResult(NamedTuple):
4865
"""Wrapped message result."""
49-
message: bytes #: The wrapped message
50-
encrypted: bool #: Whether the message is encrypted and not just signed
66+
#: The wrapped message
67+
message: bytes
68+
#: Whether the message is encrypted and not just signed
69+
encrypted: bool
5170

5271

5372
class UnwrapResult(NamedTuple):
5473
"""Unwrapped message result."""
55-
message: bytes #: The unwrapped message
56-
encrypted: bool #: Whether the message was encrypted and not just signed
57-
qop: int #: The quality of protection applied to the message
74+
#: The unwrapped message
75+
message: bytes
76+
#: Whether the message was encrypted and not just signed
77+
encrypted: bool
78+
#: The quality of protection applied to the message
79+
qop: int
5880

5981

6082
class AcceptSecContextResult(NamedTuple):
6183
"""Result when accepting a security context by an initiator."""
62-
context: "g.SecurityContext" #: The acceptor security context
63-
initiator_name: "g.Name" #: The authenticated name of the initiator
64-
mech: OID #: Mechanism with which the context was established
65-
token: Optional[bytes] #: Token to be returned to the initiator
66-
flags: RequirementFlag #: Services requested by the initiator
67-
lifetime: int #: Seconds for which the context is valid for
68-
delegated_creds: Optional["g.Creds"] #: Delegated credentials
69-
more_steps: bool #: More input is required to complete the exchange
84+
#: The acceptor security context
85+
context: "gssapi.raw.sec_contexts.SecurityContext"
86+
#: The authenticated name of the initiator
87+
initiator_name: "gssapi.raw.names.Name"
88+
#: Mechanism with which the context was established
89+
mech: OID
90+
#: Token to be returned to the initiator
91+
token: Optional[bytes]
92+
#: Services requested by the initiator
93+
flags: RequirementFlag
94+
#: Seconds for which the context is valid for
95+
lifetime: int
96+
#: Delegated credentials
97+
delegated_creds: Optional["gssapi.raw.creds.Creds"]
98+
#: More input is required to complete the exchange
99+
more_steps: bool
70100

71101

72102
class InitSecContextResult(NamedTuple):
73103
"""Result when initiating a security context"""
74-
context: "g.SecurityContext" #: The initiator security context
75-
mech: OID #: Mechanism used in the security context
76-
flags: RequirementFlag #: Services available for the context
77-
token: Optional[bytes] #: Token to be sent to the acceptor
78-
lifetime: int #: Seconds for which the context is valid for
79-
more_steps: bool #: More input is required to complete the exchange
104+
#: The initiator security context
105+
context: "gssapi.raw.sec_contexts.SecurityContext"
106+
#: Mechanism used in the security context
107+
mech: OID
108+
#: Services available for the context
109+
flags: RequirementFlag
110+
#: Token to be sent to the acceptor
111+
token: Optional[bytes]
112+
#: Seconds for which the context is valid for
113+
lifetime: int
114+
#: More input is required to complete the exchange
115+
more_steps: bool
80116

81117

82118
class InquireContextResult(NamedTuple):
83119
"""Information about the security context."""
84-
initiator_name: Optional["g.Name"] #: Name of the initiator
85-
target_name: Optional["g.Name"] #: Name of the acceptor
86-
lifetime: Optional[int] #: Time valid for the security context, in seconds
87-
mech: Optional[OID] #: Mech used to create the security context
88-
flags: Optional[RequirementFlag] #: Services available for the context
89-
locally_init: Optional[bool] #: Context was initiated locally
90-
complete: Optional[bool] #: Context has been established and ready to use
120+
#: Name of the initiator
121+
initiator_name: Optional["gssapi.raw.names.Name"]
122+
#: Name of the acceptor
123+
target_name: Optional["gssapi.raw.names.Name"]
124+
#: Time valid for the security context, in seconds
125+
lifetime: Optional[int]
126+
#: Mech used to create the security context
127+
mech: Optional[OID]
128+
#: Services available for the context
129+
flags: Optional[RequirementFlag]
130+
#: Context was initiated locally
131+
locally_init: Optional[bool]
132+
#: Context has been established and ready to use
133+
complete: Optional[bool]
91134

92135

93136
class StoreCredResult(NamedTuple):
94137
"""Result of the credential storing operation."""
95-
mechs: List[OID] #: Mechs that were stored in the credential store
96-
usage: str #: How the credential can be used
138+
#: Mechs that were stored in the credential store
139+
mechs: List[OID]
140+
#: How the credential can be used
141+
usage: str
97142

98143

99144
class IOVUnwrapResult(NamedTuple):
100145
"""Unwrapped IOV message result."""
101-
encrypted: bool #: Whether the message was encrypted and not just signed
102-
qop: int #: The quality of protection applied to the message
146+
#: Whether the message was encrypted and not just signed
147+
encrypted: bool
148+
#: The quality of protection applied to the message
149+
qop: int
103150

104151

105152
class InquireNameResult(NamedTuple):
106153
"""Information about a GSSAPI Name."""
107-
attrs: List[bytes] #: Set of attribute names
108-
is_mech_name: bool #: Name is a mechanism name
109-
mech: OID #: The mechanism if is_name_mech is True
154+
#: Set of attribute names
155+
attrs: List[bytes]
156+
#: Name is a mechanism name
157+
is_mech_name: bool
158+
#: The mechanism if is_name_mech is True
159+
mech: OID
110160

111161

112162
class GetNameAttributeResult(NamedTuple):
113163
"""GSSAPI Name attribute values."""
114-
values: List[bytes] #: Raw values
115-
display_values: List[bytes] #: Human-readable values
116-
authenticated: bool #: Attribute has been authenticated
117-
complete: bool #: Attribute value is marked as complete
164+
#: Raw values
165+
values: List[bytes]
166+
#: Human-readable values
167+
display_values: List[bytes]
168+
#: Attribute has been authenticated
169+
authenticated: bool
170+
#: Attribute value is marked as complete
171+
complete: bool
118172

119173

120174
class InquireAttrsResult(NamedTuple):
121175
"""Set of attributes supported and known by a mechanism."""
122-
mech_attrs: Set[OID] #: The mechanisms attributes
123-
known_mech_attrs: Set[OID] #: Known attributes of the mechanism
176+
#: The mechanisms attributes
177+
mech_attrs: Set[OID]
178+
#: Known attributes of the mechanism
179+
known_mech_attrs: Set[OID]
124180

125181

126182
class DisplayAttrResult(NamedTuple):
127183
"""Information about an attribute."""
128-
name: bytes #: The mechanism name
129-
short_desc: bytes #: Short description of the mechanism
130-
long_desc: bytes #: Long description of the mechanism
184+
#: The mechanism name
185+
name: bytes
186+
#: Short description of the mechanism
187+
short_desc: bytes
188+
#: Long description of the mechanism
189+
long_desc: bytes
131190

132191

133192
class InquireSASLNameResult(NamedTuple):
134193
"""SASL informmation about a GSSAPI Name."""
135-
sasl_mech_name: bytes #: The SASL name
136-
mech_name: bytes #: The mechanism name
137-
mech_description: bytes #: The mechanism description
194+
#: The SASL name
195+
sasl_mech_name: bytes
196+
#: The mechanism name
197+
mech_name: bytes
198+
#: The mechanism description
199+
mech_description: bytes
138200

139201

140202
class Rfc1964KeyData(NamedTuple):
141203
"""Security context key data based on RFC1964."""
142-
sign_alg: int #: Signing algorithm identifier
143-
seal_alg: int #: Sealing algorithm identifier
144-
key_type: int #: Key encryption type identifier
145-
key: bytes #: Encryption key data
204+
#: Signing algorithm identifier
205+
sign_alg: int
206+
#: Sealing algorithm identifier
207+
seal_alg: int
208+
#: Key encryption type identifier
209+
key_type: int
210+
#: Encryption key data
211+
key: bytes
146212

147213

148214
class CfxKeyData(NamedTuple):
149215
"""Securty context key data."""
150-
ctx_key_type: int #: Context key encryption type identifier
151-
ctx_key: bytes #: Context key data - session or sub-session key
152-
acceptor_subkey_type: Optional[int] #: Acceptor key enc type identifier
153-
acceptor_subkey: Optional[bytes] #: Acceptor key data
216+
#: Context key encryption type identifier
217+
ctx_key_type: int
218+
#: Context key data - session or sub-session key
219+
ctx_key: bytes
220+
#: Acceptor key enc type identifier
221+
acceptor_subkey_type: Optional[int]
222+
#: Acceptor key data
223+
acceptor_subkey: Optional[bytes]

‎gssapi/raw/oids.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ class OID:
66
77
A new OID may be created by passing the `elements` argument
88
to the constructor. The `elements` argument should be a
9-
`bytes` consisting of the BER-encoded values in the OID.
9+
:class:`bytes` consisting of the BER-encoded values in the OID.
1010
11-
To retrieve the underlying bytes, use the :func:`bytes`
11+
To retrieve the underlying bytes, use the :class:`bytes`
1212
function in Python 3.
1313
1414
This object is hashable, and may be compared using equality

‎setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ source-dir=docs/source
33
build-dir=docs/build
44
all_files=1
55
warning-is-error=1
6+
nitpicky=1
67

78
[upload_sphinx]
89
upload-dir = docs/build/html

‎test-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ parameterized
33
Cython
44
k5test
55
decorator
6-
mypy
6+
mypy==0.971
77
types-decorator

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /