fix: disallow base64 strategies through rpc endpoints
This commit is contained in:
@@ -6,7 +6,7 @@ from fastapi import APIRouter, Depends, HTTPException
|
|||||||
from freqtrade.configuration import validate_config_consistency
|
from freqtrade.configuration import validate_config_consistency
|
||||||
from freqtrade.rpc.api_server.api_pairlists import handleExchangePayload
|
from freqtrade.rpc.api_server.api_pairlists import handleExchangePayload
|
||||||
from freqtrade.rpc.api_server.api_schemas import PairHistory, PairHistoryRequest
|
from freqtrade.rpc.api_server.api_schemas import PairHistory, PairHistoryRequest
|
||||||
from freqtrade.rpc.api_server.deps import get_config, get_exchange
|
from freqtrade.rpc.api_server.deps import get_config, get_exchange, verify_strategy
|
||||||
from freqtrade.rpc.rpc import RPC
|
from freqtrade.rpc.rpc import RPC
|
||||||
|
|
||||||
|
|
||||||
@@ -25,6 +25,7 @@ def pair_history(
|
|||||||
config=Depends(get_config),
|
config=Depends(get_config),
|
||||||
exchange=Depends(get_exchange),
|
exchange=Depends(get_exchange),
|
||||||
):
|
):
|
||||||
|
verify_strategy(strategy)
|
||||||
# The initial call to this endpoint can be slow, as it may need to initialize
|
# The initial call to this endpoint can be slow, as it may need to initialize
|
||||||
# the exchange class.
|
# the exchange class.
|
||||||
config_loc = deepcopy(config)
|
config_loc = deepcopy(config)
|
||||||
@@ -45,6 +46,7 @@ def pair_history(
|
|||||||
|
|
||||||
@router.post("/pair_history", response_model=PairHistory, tags=["Candle data"])
|
@router.post("/pair_history", response_model=PairHistory, tags=["Candle data"])
|
||||||
def pair_history_filtered(payload: PairHistoryRequest, config=Depends(get_config)):
|
def pair_history_filtered(payload: PairHistoryRequest, config=Depends(get_config)):
|
||||||
|
verify_strategy(payload.strategy)
|
||||||
# The initial call to this endpoint can be slow, as it may need to initialize
|
# The initial call to this endpoint can be slow, as it may need to initialize
|
||||||
# the exchange class.
|
# the exchange class.
|
||||||
config_loc = deepcopy(config)
|
config_loc = deepcopy(config)
|
||||||
|
|||||||
Reference in New Issue
Block a user