(20250104) Breeze authorization will be accepted now.

This commit is contained in:
2025-01-04 15:22:51 +05:30
parent aadcc87e2a
commit 0c2d7816f4
13 changed files with 316 additions and 83 deletions
@@ -171,6 +171,9 @@ async def request_oauth_authorization_url(
# ┻ ┗┛┛ ┣┛┗┻┣┛┗ ┛ ┻ ┛ ┗┻┗┻┗┛┗┗┫
# ┛ ┛
# This is an internal paper-trading account.
# It won't need daily logins for usage.
if inbound_data.client == "paperTrading":
# Immediately save the details against that token id:
@@ -187,7 +190,7 @@ async def request_oauth_authorization_url(
},
auth = inbound_data.auth.model_dump(),
status = "active",
syncFreq = 1500
syncFreq = None
),
token_notes = {
"username": inbound_data.auth.username
@@ -205,7 +208,7 @@ async def request_oauth_authorization_url(
# ┻ ┗┛┛ ┗┛┗ ┛ ┗┛┗┻┛┗┗┻ ┛┗┛┗┗┗
# PLANNED FLOW FOR ZERODHA-KITE:
# Step 01.: (One time) The user will go to the integrations page and add his API Key and SPI Secret there. We store
# Step 01.: (One time) The user will go to the integrations page and add his API Key and API Secret there. We store
# these values without verification.
# Step 02.: (Daily) The user will go to the investments tab and click on his Zerodha account, which will give him
# a URL that will take him to Zerodha's official site to log in. When he logs in, Zerodha will hit our
@@ -226,17 +229,19 @@ async def request_oauth_authorization_url(
authType = "oauth",
user = kwargs["session_info"],
clientUserId = {
"userId": inbound_data.auth.userId,
"apiKey": inbound_data.auth.apiKey
},
auth = inbound_data.auth.model_dump(),
status = "active",
syncFreq = 1500
syncFreq = None
),
token_notes = {
"userId": inbound_data.auth.userId,
"apiKey": inbound_data.auth.apiKey,
"authUrl": auth_url
},
display_name = None,
display_name = inbound_data.auth.userId,
display_picture = None,
session_token = inbound_headers["X-Session-Token"]
)
@@ -248,6 +253,13 @@ async def request_oauth_authorization_url(
# ┣ ┏┓┏┓ ┃┃ ┃┃ ┃ ┣┫┏┓┏┓┏┓┓┏┓
# ┻ ┗┛┛ ┻┗┛┻┗┛┻ ┻┛┛ ┗ ┗ ┗┗
# PLANNED FLOW FOR ICICI-BREEZE:
# Step 01.: (One time) The user will go to the integrations page and add his Client User ID, API Key, and API Secret
# there. We store these values without verification.
# Step 02.: (Daily) The user will go to the investments tab and click on his Breeze account, which will give him a
# URL that will take him to ICICI's official site to log in. When he logs in, ICICI will hit our callback
# URL and give us the authentication details.
if inbound_data.client == "iciciBreeze":
# Prepare the inputs:
@@ -263,17 +275,19 @@ async def request_oauth_authorization_url(
authType = "oauth",
user = kwargs["session_info"],
clientUserId = {
"userId": inbound_data.auth.userId,
"apiKey": inbound_data.auth.apiKey
},
auth = inbound_data.auth.model_dump(),
status = "active",
syncFreq = 1500
syncFreq = None
),
token_notes = {
"userId": inbound_data.auth.userId,
"apiKey": inbound_data.auth.apiKey,
"authUrl": auth_url
},
display_name = None,
display_name = inbound_data.auth.userId,
display_picture = None,
session_token = inbound_headers["X-Session-Token"]
)