MCPcopy Create free account
hub / github.com/oauthlib/oauthlib / generate_timestamp

Function generate_timestamp

oauthlib/common.py:176–185  ·  view source on GitHub ↗

Get seconds since epoch (UTC). Per `section 3.3`_ of the OAuth 1 RFC 5849 spec. Per `section 3.2.1`_ of the MAC Access Authentication spec. .. _`section 3.2.1`: https://tools.ietf.org/html/draft-ietf-oauth-v2-http-mac-01#section-3.2.1 .. _`section 3.3`: https://tools.ietf.org/html/

()

Source from the content-addressed store, hash-verified

174
175
176def generate_timestamp():
177 """Get seconds since epoch (UTC).
178
179 Per `section 3.3`_ of the OAuth 1 RFC 5849 spec.
180 Per `section 3.2.1`_ of the MAC Access Authentication spec.
181
182 .. _`section 3.2.1`: https://tools.ietf.org/html/draft-ietf-oauth-v2-http-mac-01#section-3.2.1
183 .. _`section 3.3`: https://tools.ietf.org/html/rfc5849#section-3.3
184 """
185 return str(int(time.time()))
186
187
188def generate_token(length=30, chars=UNICODE_ASCII_CHARACTER_SET):

Callers 3

get_oauth_paramsMethod · 0.90
generate_nonceFunction · 0.85

Calls

no outgoing calls

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…