(20250801) - ICICIBreeze library commented from each main.py and api/ request.py
This commit is contained in:
@@ -263,40 +263,40 @@ async def request_oauth_authorization_url(
|
||||
# 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:
|
||||
auth_url = await current_app.icici_breeze_controller.get_authorization_url(api_key = inbound_data.auth.apiKey)
|
||||
|
||||
# Immediately save the details against that token id:
|
||||
success = await current_app.icici_breeze_controller.set_token_direct(
|
||||
sql_conn = current_app.sql_writer,
|
||||
mongo_data_conn = current_app.data_mongo,
|
||||
auth_token = CoreAuthTokenModel(
|
||||
serviceType = "stockTrading",
|
||||
client = inbound_data.client,
|
||||
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 = None
|
||||
),
|
||||
token_notes = {
|
||||
"userId": inbound_data.auth.userId,
|
||||
"apiKey": inbound_data.auth.apiKey,
|
||||
"authUrl": auth_url
|
||||
},
|
||||
display_name = inbound_data.auth.userId,
|
||||
display_picture = None,
|
||||
session_token = inbound_headers["X-Session-Token"]
|
||||
)
|
||||
|
||||
# Check if things were successful:
|
||||
if not success: auth_url = None
|
||||
# if inbound_data.client == "iciciBreeze":
|
||||
#
|
||||
# # Prepare the inputs:
|
||||
# auth_url = await current_app.icici_breeze_controller.get_authorization_url(api_key = inbound_data.auth.apiKey)
|
||||
#
|
||||
# # Immediately save the details against that token id:
|
||||
# success = await current_app.icici_breeze_controller.set_token_direct(
|
||||
# sql_conn = current_app.sql_writer,
|
||||
# mongo_data_conn = current_app.data_mongo,
|
||||
# auth_token = CoreAuthTokenModel(
|
||||
# serviceType = "stockTrading",
|
||||
# client = inbound_data.client,
|
||||
# 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 = None
|
||||
# ),
|
||||
# token_notes = {
|
||||
# "userId": inbound_data.auth.userId,
|
||||
# "apiKey": inbound_data.auth.apiKey,
|
||||
# "authUrl": auth_url
|
||||
# },
|
||||
# display_name = inbound_data.auth.userId,
|
||||
# display_picture = None,
|
||||
# session_token = inbound_headers["X-Session-Token"]
|
||||
# )
|
||||
#
|
||||
# # Check if things were successful:
|
||||
# if not success: auth_url = None
|
||||
|
||||
# ┳┓
|
||||
# ┣┫┏┓┏┏┓┏┓┏┓┏┏┓
|
||||
@@ -471,40 +471,40 @@ async def request_oauth_authorization_update_url(
|
||||
# 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:
|
||||
auth_url = await current_app.icici_breeze_controller.get_authorization_url(api_key = inbound_data.auth.apiKey)
|
||||
|
||||
# Immediately save the details against that token id:
|
||||
success = await current_app.icici_breeze_controller.set_token_direct(
|
||||
sql_conn = current_app.sql_writer,
|
||||
mongo_data_conn = current_app.data_mongo,
|
||||
auth_token = CoreAuthTokenModel(
|
||||
serviceType = "stockTrading",
|
||||
client = inbound_data.client,
|
||||
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 = None
|
||||
),
|
||||
token_notes = {
|
||||
"userId": inbound_data.auth.userId,
|
||||
"apiKey": inbound_data.auth.apiKey,
|
||||
"authUrl": auth_url
|
||||
},
|
||||
display_name = inbound_data.auth.userId,
|
||||
display_picture = None,
|
||||
session_token = inbound_headers["X-Session-Token"]
|
||||
)
|
||||
|
||||
# Check if things were successful:
|
||||
if not success: auth_url = None
|
||||
# if inbound_data.client == "iciciBreeze":
|
||||
#
|
||||
# # Prepare the inputs:
|
||||
# auth_url = await current_app.icici_breeze_controller.get_authorization_url(api_key = inbound_data.auth.apiKey)
|
||||
#
|
||||
# # Immediately save the details against that token id:
|
||||
# success = await current_app.icici_breeze_controller.set_token_direct(
|
||||
# sql_conn = current_app.sql_writer,
|
||||
# mongo_data_conn = current_app.data_mongo,
|
||||
# auth_token = CoreAuthTokenModel(
|
||||
# serviceType = "stockTrading",
|
||||
# client = inbound_data.client,
|
||||
# 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 = None
|
||||
# ),
|
||||
# token_notes = {
|
||||
# "userId": inbound_data.auth.userId,
|
||||
# "apiKey": inbound_data.auth.apiKey,
|
||||
# "authUrl": auth_url
|
||||
# },
|
||||
# display_name = inbound_data.auth.userId,
|
||||
# display_picture = None,
|
||||
# session_token = inbound_headers["X-Session-Token"]
|
||||
# )
|
||||
#
|
||||
# # Check if things were successful:
|
||||
# if not success: auth_url = None
|
||||
|
||||
# ┳┓
|
||||
# ┣┫┏┓┏┏┓┏┓┏┓┏┏┓
|
||||
|
||||
Reference in New Issue
Block a user