MCPcopy Create free account
hub / github.com/ronreiter/interactive-tutorials / setnonce

Method setnonce

suds/wsse.py:130–147  ·  view source on GitHub ↗

Set I{nonce} which is arbitraty set of bytes to prevent reply attacks. @param text: The nonce text value. Generated when I{None}. @type text: str

(self, text=None)

Source from the content-addressed store, hash-verified

128 self.created = None
129
130 def setnonce(self, text=None):
131 """
132 Set I{nonce} which is arbitraty set of bytes to prevent
133 reply attacks.
134 @param text: The nonce text value.
135 Generated when I{None}.
136 @type text: str
137 """
138 if text is None:
139 s = []
140 s.append(self.username)
141 s.append(self.password)
142 s.append(Token.sysdate())
143 m = sha256()
144 m.update(':'.join(s).encode("utf-8"))
145 self.nonce = m.hexdigest()
146 else:
147 self.nonce = text
148
149 def setcreated(self, dt=None):
150 """

Callers

nothing calls this directly

Calls 4

sysdateMethod · 0.80
appendMethod · 0.45
updateMethod · 0.45
encodeMethod · 0.45

Tested by

no test coverage detected