Skip to content

Commit

Permalink
switch to cryptographically-secure source
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-mkeller committed Jan 16, 2025
1 parent 8fde1fc commit 6d025e5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/snowflake/connector/auth/oauth_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@

import json
import logging
import random
import secrets
import socket
import string
import time
import urllib.parse
import webbrowser
Expand Down Expand Up @@ -71,7 +70,7 @@ def __init__(
self.token_request_url = token_request_url
self.redirect_uri = redirect_uri
self.scope = scope
self._state = "".join(random.choices(string.ascii_letters, k=10))
self._state = secrets.token_urlsafe(43)
logger.debug("chose oauth state: %s", self._state)
self._oauth_token = None
self._protocol = "http"
Expand Down

0 comments on commit 6d025e5

Please sign in to comment.