1
1
from typing import Iterable , List , NamedTuple , Optional , Set , TYPE_CHECKING
2
2
3
3
if TYPE_CHECKING :
4
- from gssapi .raw .creds import Creds
5
- from gssapi .raw .names import Name
6
- from gssapi .raw .oids import OID
7
- from gssapi .raw .sec_contexts import SecurityContext
8
- from gssapi .raw .types import RequirementFlag
4
+ import gssapi .raw as g
9
5
10
6
11
7
class AcquireCredResult (NamedTuple ):
12
8
"""Credential result when acquiring a GSSAPI credential."""
13
- creds : "Creds" #: GSSAPI credentials that were acquired
14
- mechs : Set ["OID" ] #: Set of mechs the cred is for
9
+ creds : "g. Creds" #: GSSAPI credentials that were acquired
10
+ mechs : Set ["g. OID" ] #: Set of mechs the cred is for
15
11
lifetime : int #: Number of seconds for which the cred will remain valid
16
12
17
13
18
14
class InquireCredResult (NamedTuple ):
19
15
"""Information about the credential."""
20
- name : Optional ["Name" ] #: The principal associated with the credential
16
+ name : Optional ["g. Name" ] #: The principal associated with the credential
21
17
lifetime : Optional [int ] #: Number of seconds which the cred is valid for
22
18
usage : Optional [str ] #: How the credential can be used
23
- mechs : Optional [Set ["OID" ]] #: Set of mechs the cred is for
19
+ mechs : Optional [Set ["g. OID" ]] #: Set of mechs the cred is for
24
20
25
21
26
22
class InquireCredByMechResult (NamedTuple ):
27
23
"""Information about the credential for a specific mechanism."""
28
- name : Optional ["Name" ] #: The principal associated with the credential
24
+ name : Optional ["g. Name" ] #: The principal associated with the credential
29
25
init_lifetime : Optional [int ] #: Time valid for initiation
30
26
accept_lifetime : Optional [int ] #: Time valid for accepting
31
27
usage : Optional [str ] #: How the credential can be used
32
28
33
29
34
30
class AddCredResult (NamedTuple ):
35
31
"""Result of adding to a GSSAPI credential."""
36
- creds : Optional ["Creds" ] #: The credential that was generated
37
- mechs : Set ["OID" ] #: Set of mechs the cred is for
32
+ creds : Optional ["g. Creds" ] #: The credential that was generated
33
+ mechs : Set ["g. OID" ] #: Set of mechs the cred is for
38
34
init_lifetime : int #: Time valid for initiation
39
35
accept_lifetime : int #: Time valid for accepting
40
36
41
37
42
38
class DisplayNameResult (NamedTuple ):
43
39
"""Textual representation of a GSSAPI name."""
44
40
name : bytes #: The representation of the GSSAPI name
45
- name_type : Optional ["OID" ] #: The type of GSSAPI name
41
+ name_type : Optional ["g. OID" ] #: The type of GSSAPI name
46
42
47
43
48
44
class WrapResult (NamedTuple ):
@@ -60,40 +56,40 @@ class UnwrapResult(NamedTuple):
60
56
61
57
class AcceptSecContextResult (NamedTuple ):
62
58
"""Result when accepting a security context by an initiator."""
63
- context : "SecurityContext" #: The acceptor security context
64
- initiator_name : "Name" #: The authenticated name of the initiator
65
- mech : "OID" #: Mechanism with which the context was established
59
+ context : "g. SecurityContext" #: The acceptor security context
60
+ initiator_name : "g. Name" #: The authenticated name of the initiator
61
+ mech : "g. OID" #: Mechanism with which the context was established
66
62
token : Optional [bytes ] #: Token to be returned to the initiator
67
- flags : "RequirementFlag " #: Services requested by the initiator
63
+ flags : "g.equirementFlag " #: Services requested by the initiator
68
64
lifetime : int #: Seconds for which the context is valid for
69
- delegated_creds : Optional ["Creds" ] #: Delegated credentials
65
+ delegated_creds : Optional ["g. Creds" ] #: Delegated credentials
70
66
more_steps : bool #: More input is required to complete the exchange
71
67
72
68
73
69
class InitSecContextResult (NamedTuple ):
74
70
"""Result when initiating a security context"""
75
- context : "SecurityContext" #: The initiator security context
76
- mech : "OID" #: Mechanism used in the security context
77
- flags : "RequirementFlag" #: Services available for the context
71
+ context : "g. SecurityContext" #: The initiator security context
72
+ mech : "g. OID" #: Mechanism used in the security context
73
+ flags : "g. RequirementFlag" #: Services available for the context
78
74
token : Optional [bytes ] #: Token to be sent to the acceptor
79
75
lifetime : int #: Seconds for which the context is valid for
80
76
more_steps : bool #: More input is required to complete the exchange
81
77
82
78
83
79
class InquireContextResult (NamedTuple ):
84
80
"""Information about the security context."""
85
- initiator_name : Optional ["Name" ] #: Name of the initiator
86
- target_name : Optional ["Name" ] #: Name of the acceptor
81
+ initiator_name : Optional ["g. Name" ] #: Name of the initiator
82
+ target_name : Optional ["g. Name" ] #: Name of the acceptor
87
83
lifetime : Optional [int ] #: Time valid for the security context
88
- mech : Optional ["OID" ] #: Mech used to create the security context
89
- flags : Optional ["RequirementFlag" ] #: Services available for the context
84
+ mech : Optional ["g. OID" ] #: Mech used to create the security context
85
+ flags : Optional ["g. RequirementFlag" ] #: Services available for the context
90
86
locally_init : Optional [bool ] #: Context was initiated locally
91
87
complete : Optional [bool ] #: Context has been established and ready to use
92
88
93
89
94
90
class StoreCredResult (NamedTuple ):
95
91
"""Result of the credential storing operation."""
96
- mechs : List ["OID" ] #: Mechs that were stored in the credential store
92
+ mechs : List ["g. OID" ] #: Mechs that were stored in the credential store
97
93
usage : str #: How the credential can be used
98
94
99
95
@@ -107,7 +103,7 @@ class InquireNameResult(NamedTuple):
107
103
"""Information about a GSSAPI Name."""
108
104
attrs : List [bytes ] #: Set of attribute names
109
105
is_mech_name : bool #: Name is a mechanism name
110
- mech : "OID" #: The mechanism if is_name_mech is True
106
+ mech : "g. OID" #: The mechanism if is_name_mech is True
111
107
112
108
113
109
class GetNameAttributeResult (NamedTuple ):
@@ -120,8 +116,8 @@ class GetNameAttributeResult(NamedTuple):
120
116
121
117
class InquireAttrsResult (NamedTuple ):
122
118
"""Set of attributes supported and known by a mechanism."""
123
- mech_attrs : Set ["OID" ] #: The mechanisms attributes
124
- known_mech_attrs : Set ["OID" ] #: Known attributes of the mechanism
119
+ mech_attrs : Set ["g. OID" ] #: The mechanisms attributes
120
+ known_mech_attrs : Set ["g. OID" ] #: Known attributes of the mechanism
125
121
126
122
127
123
class DisplayAttrResult (NamedTuple ):
0 commit comments