From 24ae03a9f8563f848efef7bd9d14e98a9fb9212f Mon Sep 17 00:00:00 2001 From: Kevin Darby Date: Mon, 3 Dec 2018 18:19:20 -0500 Subject: [PATCH] access permissions api so fix session can report fills and orders --- src/client/spark/Admin/AdminModel.cs | 1 + src/client/spark/Orders/OrdersModel.cs | 6 +- .../admin}/AdminModelWrapper.cs | 4 +- .../admin}/PermissionFilters.cs | 24 ++-- src/client/spark_fix/DropCopySession.cs | 119 ++++++++++++++++++ src/client/spark_fix/FixInit.cs | 4 +- src/client/spark_fix/Initiator.cs | 0 .../{Acceptor.cs => OrderSession.cs} | 3 +- src/client/spark_fix/spark_fix.cfg | 6 +- src/client/spark_fix/spark_fix.csproj | 1 + src/client/sparkcmd/Cmd/ConsoleCommandEx.cs | 2 +- src/client/sparkcmd/Cmd/FIXCommand.cs | 28 +++-- src/client/sparkcmd/Cmd/ServiceTail.cs | 2 +- src/lib/CMakeDeps.cmake | 2 +- .../api/service_helpers/AdminServiceUtils.cpp | 1 + 15 files changed, 169 insertions(+), 34 deletions(-) rename src/client/{spark/Admin => spark_core/admin}/AdminModelWrapper.cs (97%) rename src/client/{spark/Admin => spark_core/admin}/PermissionFilters.cs (66%) create mode 100644 src/client/spark_fix/DropCopySession.cs delete mode 100644 src/client/spark_fix/Initiator.cs rename src/client/spark_fix/{Acceptor.cs => OrderSession.cs} (95%) diff --git a/src/client/spark/Admin/AdminModel.cs b/src/client/spark/Admin/AdminModel.cs index da1ae42f4..1b6ed064e 100644 --- a/src/client/spark/Admin/AdminModel.cs +++ b/src/client/spark/Admin/AdminModel.cs @@ -1,5 +1,6 @@ using bts; using bts.api.admin; +using bts.api.core; using System; using System.Collections.Generic; using System.ComponentModel.Composition; diff --git a/src/client/spark/Orders/OrdersModel.cs b/src/client/spark/Orders/OrdersModel.cs index 7e470f842..bf24da63c 100644 --- a/src/client/spark/Orders/OrdersModel.cs +++ b/src/client/spark/Orders/OrdersModel.cs @@ -44,8 +44,8 @@ namespace mbts.spark { _dynamic_helper = dynamic_helper; var scheduler = ThreadPoolScheduler.Instance; var interval = TimeSpan.FromMilliseconds(100); - on_orders = _service.subscribei_orders().Naggle(interval, scheduler).PermissionFilter(admin_model).Table().Cache(); - on_positions = _position_service.subscribei_position_data().Naggle(interval, scheduler).PermissionFilter(admin_model).Table().Cache(); + on_orders = _service.subscribei_orders().Naggle(interval, scheduler).PermissionFilter(admin_model.on_admin_data).Table().Cache(); + on_positions = _position_service.subscribei_position_data().Naggle(interval, scheduler).PermissionFilter(admin_model.on_admin_data).Table().Cache(); working_orders = on_orders.Scan( ImmutableDictionary.Empty, @@ -55,7 +55,7 @@ namespace mbts.spark { on_order_tuples = order_record_tuple_source.subscribe_incremental_update(); on_order_tuples_table = order_record_tuple_source.subscribe_incremental_table_update(); on_order_securities = order_record_tuple_source.subscribe_order_securities(); - on_fills = _service.subscribei_fills().Naggle(interval, scheduler).PermissionFilter(admin_model).Table().Cache(); + on_fills = _service.subscribei_fills().Naggle(interval, scheduler).PermissionFilter(admin_model.on_admin_data).Table().Cache(); _activity = new OrderActivitySummarizer(bus, on_orders); on_fill_tuples = FillTupleSource.create_observable(bus.subscribe(SparkTags.SecuritiesTag), on_orders, on_fills); _security_orders_demuxer = new TableUpdateDemuxer(o => o.Key, o => o.security_key()); diff --git a/src/client/spark/Admin/AdminModelWrapper.cs b/src/client/spark_core/admin/AdminModelWrapper.cs similarity index 97% rename from src/client/spark/Admin/AdminModelWrapper.cs rename to src/client/spark_core/admin/AdminModelWrapper.cs index 62895933c..f52f016c5 100644 --- a/src/client/spark/Admin/AdminModelWrapper.cs +++ b/src/client/spark_core/admin/AdminModelWrapper.cs @@ -4,9 +4,9 @@ using System; using System.Collections.Generic; using System.Linq; -namespace mbts.spark +namespace bts.api.core { - class AdminModelWrapper + public class AdminModelWrapper { readonly AdminDataImmutable? _admin_data; readonly string _user_name; diff --git a/src/client/spark/Admin/PermissionFilters.cs b/src/client/spark_core/admin/PermissionFilters.cs similarity index 66% rename from src/client/spark/Admin/PermissionFilters.cs rename to src/client/spark_core/admin/PermissionFilters.cs index 115187a45..3da6a137c 100644 --- a/src/client/spark/Admin/PermissionFilters.cs +++ b/src/client/spark_core/admin/PermissionFilters.cs @@ -4,10 +4,6 @@ using bts.api.core; using bts.api.orderman; using bts.api.position; using bts.spark; -using mbts.collections; -using mbts.spark; -using mbts.spark.utilities; -using mbts.utils; using System; using System.Collections.Generic; using System.Collections.Immutable; @@ -18,14 +14,14 @@ using System.Reactive.Linq; namespace bts.api.core { - - static class PermissionFilters + public static class PermissionFilters { - public static IObservable> PermissionFilter(this IObservable> source, AdminModel am) + public static IObservable> + PermissionFilter(this IObservable> source, IObservable am) { var pred = Observable.Create>( observer => { - return am.on_admin_data.Subscribe(x => + return am.Subscribe(x => { Func filter = (z => x.can_view_account(z.Account)); observer.OnNext(filter); @@ -35,13 +31,14 @@ namespace bts.api.core return source.Filter(pred); } - public static IObservable> PermissionFilter(this IObservable> source, AdminModel am) + public static IObservable> + PermissionFilter(this IObservable> source, IObservable am) { var pred = Observable.Create>(observer => { - return am.on_admin_data.Subscribe(x => + return am.Subscribe(x => { - Func filter = (z => x.can_view_account(z.account())); + Func filter = (z => x.can_view_account(z.Def.Account ?? string.Empty)); observer.OnNext(filter); }); }); @@ -49,11 +46,12 @@ namespace bts.api.core return source.Filter(pred); } - public static IObservable> PermissionFilter(this IObservable> source, AdminModel am) + public static IObservable> + PermissionFilter(this IObservable> source, IObservable am) { var pred = Observable.Create>(observer => { - return am.on_admin_data.Subscribe(x => + return am.Subscribe(x => { Func filter = (z => x.can_view_account(z.Account)); observer.OnNext(filter); diff --git a/src/client/spark_fix/DropCopySession.cs b/src/client/spark_fix/DropCopySession.cs new file mode 100644 index 000000000..2d0567005 --- /dev/null +++ b/src/client/spark_fix/DropCopySession.cs @@ -0,0 +1,119 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reactive.Linq; +using System.Reactive.Concurrency; +using System.Text; + +using QuickFix; +using QuickFix.Fields; + + +using bts.api.core; +using bts.api.orderman; +using bts.api.user; +using bts.api.admin; + +namespace bts.fix +{ + + public class DropCopySession : QuickFix.MessageCracker, QuickFix.IApplication + { + static OrderService _orders = bts.api.Locator.locate(); + static UserService _users = bts.api.Locator.locate(); + static AdminService _admin = bts.api.Locator.locate(); + + private string _user_name; + private AuthToken _token; + private IDisposable _fillsdisp, _ordersdisp; + + public DropCopySession() + { + } + + virtual public async void FromAdmin(Message message, SessionID sessionID) + { + MsgType type = Message.IdentifyType(message.ToString()); + switch (type.Obj) + { + case MsgType.LOGON: + { + QuickFix.FIX44.Logon msg = (QuickFix.FIX44.Logon)message; + _user_name = msg.Username.getValue(); + var resp = await _users.authenticate_login_async(new AuthenticateLoginRequest { Login = msg.Username.getValue(), Password = msg.Password.getValue() }); + if (resp.success && resp.value.IsValid) + _token = resp.value.Token; + else + throw new RejectLogon("Logon rejected " + resp.error_message + resp.value?.Reason ?? string.Empty); + } + break; + default: + Console.WriteLine("ADMININ: " + message); + break; + } + } + + virtual public void ToAdmin(Message message, SessionID sessionID) + { + Console.WriteLine("ADMINOUT: " + message); + } + + virtual protected void subscribe_fills_and_orders() + { + var adm = _admin.subscribei_admin_data().Select(x => new AdminModelWrapper(mbts.GlobalExtensions.TryFirst(x.all), _user_name)); + + var scheduler = TaskPoolScheduler.Default; + var interval = TimeSpan.FromMilliseconds(500); + var on_orders = _orders.subscribei_orders().Naggle(interval, scheduler).PermissionFilter(adm).Table().Cache(); + var on_fills = _orders.subscribei_fills().Naggle(interval, scheduler).PermissionFilter(adm).Table().Cache(); + + _ordersdisp = on_orders.Subscribe(o => + { + }); + + _fillsdisp = on_fills.Subscribe(o => + { + }); + } + + virtual public void OnLogon(SessionID sessionID) + { + var msg = sessionID.ToString() + " Logged on"; + Console.WriteLine(msg); + Log.FIX.info(msg); + } + virtual public void OnLogout(SessionID sessionID) + { + var msg = sessionID.ToString() + " Logged out"; + Console.WriteLine(msg); + Log.FIX.info(msg); + } + + virtual public void FromApp(Message message, SessionID sessionID) + { + MsgType type = Message.IdentifyType(message.ToString()); + switch (type.Obj) + { + case MsgType.ORDER_STATUS_REQUEST: + Crack(message, sessionID); + break; + default: + Console.WriteLine("IN: " + message); + throw new UnsupportedMessageType(); + } + } + + virtual public void ToApp(Message message, SessionID sessionID) + { + Console.WriteLine("OUT: " + message); + } + + virtual public void OnCreate(SessionID sessionID) + { + + } + + virtual public void OnMessage(QuickFix.FIX44.BusinessMessageReject n, SessionID s) { } + virtual public void OnMessage(QuickFix.FIX44.News n, SessionID s) { } + } +} \ No newline at end of file diff --git a/src/client/spark_fix/FixInit.cs b/src/client/spark_fix/FixInit.cs index 2191a7d53..715e6bbae 100644 --- a/src/client/spark_fix/FixInit.cs +++ b/src/client/spark_fix/FixInit.cs @@ -10,12 +10,12 @@ namespace bts.fix { public class FixInit { - public static int start_acceptor(string settings_file, string http_address = null) + public static int start_acceptor(string settings_file, bool orders_allowed, string http_address = null) { try { SessionSettings settings = new SessionSettings(settings_file); - IApplication app = new Acceptor(); + IApplication app = (orders_allowed ? new OrderSession() as IApplication : new DropCopySession() as IApplication); IMessageStoreFactory storeFactory = new FileStoreFactory(settings); ILogFactory logFactory = new FileLogFactory(settings); IAcceptor acceptor = new ThreadedSocketAcceptor(app, storeFactory, settings, logFactory); diff --git a/src/client/spark_fix/Initiator.cs b/src/client/spark_fix/Initiator.cs deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/client/spark_fix/Acceptor.cs b/src/client/spark_fix/OrderSession.cs similarity index 95% rename from src/client/spark_fix/Acceptor.cs rename to src/client/spark_fix/OrderSession.cs index ee06dd3ae..653c75113 100644 --- a/src/client/spark_fix/Acceptor.cs +++ b/src/client/spark_fix/OrderSession.cs @@ -14,8 +14,9 @@ namespace bts.fix /// Note that this app is *NOT* a message cracker. /// - public class Acceptor : QuickFix.MessageCracker, QuickFix.IApplication + public class OrderSession : QuickFix.MessageCracker, QuickFix.IApplication { + static readonly decimal DEFAULT_MARKET_PRICE = 10; int orderID = 0; diff --git a/src/client/spark_fix/spark_fix.cfg b/src/client/spark_fix/spark_fix.cfg index a1318b449..71211dc5b 100644 --- a/src/client/spark_fix/spark_fix.cfg +++ b/src/client/spark_fix/spark_fix.cfg @@ -1,3 +1,5 @@ +#http://www.quickfixengine.org/quickfix/doc/html/configuration.html + [DEFAULT] ConnectionType=acceptor SocketAcceptPort=5001 @@ -9,8 +11,10 @@ UseDataDictionary=Y ResetOnLogon=Y ResetOnLogout=Y ResetOnDisconnect=Y -SSLEnable=N +LogonTimeout=30 + +SSLEnable=N # SSLEnable=Y # # It is recommended to install the certificate and refer to it by name instead of using filename + password # SSLCertificate=QuickFixn-TestServer.pfx diff --git a/src/client/spark_fix/spark_fix.csproj b/src/client/spark_fix/spark_fix.csproj index 96a9a9789..9f297b151 100644 --- a/src/client/spark_fix/spark_fix.csproj +++ b/src/client/spark_fix/spark_fix.csproj @@ -25,6 +25,7 @@ + diff --git a/src/client/sparkcmd/Cmd/ConsoleCommandEx.cs b/src/client/sparkcmd/Cmd/ConsoleCommandEx.cs index 18c73075d..1f731b6d9 100644 --- a/src/client/sparkcmd/Cmd/ConsoleCommandEx.cs +++ b/src/client/sparkcmd/Cmd/ConsoleCommandEx.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ManyConsole { +namespace ManyConsole.CommandLineUtils { public static class ConsoleCommandEx { public static string get_argument(this ConsoleCommand _, string arg_name) { var arg = Environment.GetCommandLineArgs().FirstOrDefault(str => str.StartsWith("--"+arg_name)); diff --git a/src/client/sparkcmd/Cmd/FIXCommand.cs b/src/client/sparkcmd/Cmd/FIXCommand.cs index e6ce5d572..3427de8f4 100644 --- a/src/client/sparkcmd/Cmd/FIXCommand.cs +++ b/src/client/sparkcmd/Cmd/FIXCommand.cs @@ -8,27 +8,37 @@ namespace bts { public class FIXCommand : ConsoleCommand { - bool _acceptor, _initiator; + bool _initiator, _orders, _dropcopy; string _config, _http; public FIXCommand() { - IsCommand("fix", "start a fix acceptor or initiator session"); - HasOption("a|acceptor", "Start a FIX Acceptor", h => _acceptor = true); - HasOption("i|initiator", "Start a FIX Initiator", h => _initiator = true); + IsCommand("fix", "start a fix acceptor or initiator session"); HasRequiredOption("f|configfile=", "Set the config file", h => _config = h); + HasOption("i|initiator", "Start a FIX Initiator", h => _initiator = true); HasOption("w|http=", "Start http server {address}", h => _http = h); - HasAdditionalArguments(null, " [other params]"); + + HasOption("o|order_session", "Start a FIX Acceptor session for orders", h => _orders = true); + HasOption("d|dropcopy_only", "Start a FIX Acceptor session for dropcopy", h => _dropcopy = true); + + //HasAdditionalArguments(null, " [other params]"); } public override int Run(string[] remaining_args) { - if (_acceptor) + if (_orders) { - Console.WriteLine("Starting FIX Acceptor using " + _config + " Http server " + _http ?? "no"); - return FixInit.start_acceptor(_config, (string.IsNullOrEmpty(_http) ? null : _http)); + Console.WriteLine("Starting FIX ORDERS Acceptor using " + _config + " Http server " + _http ?? "no"); + return FixInit.start_acceptor(_config, true, (string.IsNullOrEmpty(_http) ? null : _http)); + } + else if (_dropcopy) + { + Console.WriteLine("Starting FIX DROP Acceptor using " + _config + " Http server " + _http ?? "no"); + return FixInit.start_acceptor(_config, false, (string.IsNullOrEmpty(_http) ? null : _http)); } else if (_initiator) - { + { + Console.WriteLine("Initiator not supported yet"); } + Console.WriteLine("Must select either orders or dropcopy session"); return -1; } } diff --git a/src/client/sparkcmd/Cmd/ServiceTail.cs b/src/client/sparkcmd/Cmd/ServiceTail.cs index 316d52071..2ff2e3aac 100644 --- a/src/client/sparkcmd/Cmd/ServiceTail.cs +++ b/src/client/sparkcmd/Cmd/ServiceTail.cs @@ -1,6 +1,6 @@ using bts.api.core; using bts.test; -using ManyConsole; +using ManyConsole.CommandLineUtils; using System; using System.Collections.Generic; using System.Linq; diff --git a/src/lib/CMakeDeps.cmake b/src/lib/CMakeDeps.cmake index cd221187f..20657086a 100644 --- a/src/lib/CMakeDeps.cmake +++ b/src/lib/CMakeDeps.cmake @@ -1 +1 @@ -set(sources api/apicore.proto;api/apigateway.proto;api/apioptions.proto;api/core/ApiClientInterop.cpp;api/core/ApiServerInterop.cpp;api/public/ApiServer.cpp;api/public/ClientChannel.cpp;api/public/QuickbusClientChannel.cpp;api/public/ServerChannel.cpp;api/public/ServiceContext.cpp;api/service_helpers/AdminServiceUtils.cpp;api/services/AdminService.proto;api/services/ApiUnitTestService.proto;api/services/ErrorReportService.proto;api/services/HelloService.proto;api/services/MarketDataAuxiliaryService.proto;api/services/MarketDataRelay.proto;api/services/OrderService.proto;api/services/OutOfProcessURLListener.proto;api/services/PersistenceService.proto;api/services/PositionService.proto;api/services/ShellDiagnosticService.proto;api/services/ShellLatencyService.proto;api/services/SyntheticSecurityService.proto;api/services/UserService.proto;api/test/ApiTests.cpp;api/test/HelloServiceServer.cpp;config/ConfigCheck.cpp;config/ConfigDownloader.cpp;config/ConfigErrorCollector.cpp;config/ConfigLog.cpp;config/ConfigPropertyEvaluator.cpp;config/ConfigValueQueue.cpp;config/ConfigurationException.cpp;config/ConfigurationState.cpp;config/PreprocessInputStream.cpp;config/config.cpp;config/defaults/Executor.conf;config/defaults/MarketData.conf;config/defaults/Ports.conf;config/defaults/Symbols.conf;config/defaults/cme_reference_data.conf;config/defaults/edge.conf;config/defaults/jetfix.conf;config/defaults/logging.conf;config/defaults/orderman_cfg.conf;config/defaults/orders_fills_cleanup.conf;config/defaults/spreader.conf;config/defaults/testkeys.conf;config/defaults/threads.conf;config/defaults/toggles.conf;config/extensions/extensions.proto;config/invalid/invalid.proto;config/protos/ExchangeSimCfg.proto;config/protos/MarketData.proto;config/protos/Ports.proto;config/protos/Symbols.proto;config/protos/UI.proto;config/protos/cme_reference_data.proto;config/protos/jetfix.proto;config/protos/logging.proto;config/protos/mercury_cfg.proto;config/protos/orderman_cfg.proto;config/protos/orders_fills_cleanup.proto;config/protos/quickbus_cfg.proto;config/protos/spreader.proto;config/protos/system.proto;config/protos/testkeys.proto;config/protos/threads.proto;config/protos/toggles.proto;config/tests/HTTPServer.cpp;config/tests/config_ref_tests.cpp;config/tests/config_tests.cpp;config/text_format/text_format.cpp;domain_model/Security.cpp;domain_model/Security.proto;domain_model/SecurityTests.cpp;domain_model/tests/domain_tests.cpp;expression/BooleanGrammar.cpp;expression/ExpressionEvaluator.cpp;expression/ParserExceptions.cpp;expression/Value.cpp;expression/tests/expression_parser_tests.cpp;jetfix/codec/FIXArray.cpp;jetfix/common/OutFIX.cpp;jetfix/connection/AsyncReader.cpp;jetfix/connection/IConnection.cpp;jetfix/connection/SocketConnection.cpp;jetfix/gateway/CoreGateway.cpp;jetfix/gateway/JetFIXGateway.cpp;jetfix/gateway/Session.cpp;jetfix/store/FIXFileStore.cpp;jetfix/store/session_name.cpp;jetfix/tests/async_reader_tests.cpp;jetfix/tests/decoding_tests.cpp;jetfix/tests/fix_encoding_stream_tests.cpp;jetfix/tests/fix_fragment_tests.cpp;jetfix/tests/jetfix_performance_tests.cpp;jetfix/tests/sample_fix.cpp;jetfix/tests/store_tests.cpp;logging/LoggerHub.cpp;logging/Sink.cpp;logging/logging.cpp;logging/tests/logging_tests.cpp;md/Diag/MDPeriodicDumper.cpp;md/Diag/ShmDumper.cpp;md/MDConsumer.cpp;md/MDConsumerHandle.cpp;md/MDConsumerInterop.cpp;md/MDProducer.cpp;md/MDProducerHandle.cpp;md/MDRecoverableConsumer.cpp;md/MemorySegmentUtils.cpp;md/PlatformLoader.cpp;md/PriceSize.cpp;md/SecurityDB.cpp;md/SecurityIDRecorder.cpp;md/SettlementRecorder.cpp;md/Shm/FixedSecurity.cpp;md/SyntheticSecurityService.cpp;md/cme/MDP3Utils.cpp;md/common.cpp;md/protos/co2.proto;md/relay/QueryServer.cpp;md/relay/RelayClient.cpp;md/relay/RelayRecorder.cpp;md/test/Co2ManagedTestHelper.cpp;md/test/Co2TestInstrument.cpp;md/test/md2_tests.cpp;md/test/synthetic_book_merge_tests.cpp;mercury/actors/IPollableActor.cpp;mercury/broker/Broker.cpp;mercury/broker/BrokerProxy.cpp;mercury/broker/ILocalBroker.cpp;mercury/broker/IRemoteBroker.cpp;mercury/common/mercury_common.cpp;mercury/events/TimerEvent.cpp;mercury/executor/Executor.cpp;mercury/topics/Topic.cpp;metrics/metrics.cpp;metrics/system_metrics.cpp;orderman/actors/AsyncFactory.cpp;orderman/actors/ExecutionGateway.cpp;orderman/actors/FillStore.cpp;orderman/actors/MDSupplementarySource.cpp;orderman/actors/OrderStore.cpp;orderman/actors/SODPosition.cpp;orderman/actors/SecuritySrc.cpp;orderman/actors/ServiceBridge.cpp;orderman/actors/order_manager/OrderBuilder.cpp;orderman/actors/order_manager/OrderManager.cpp;orderman/actors/order_manager/OrderServicesData.cpp;orderman/events/CancelRejectEvent.cpp;orderman/events/NewExecutionReportEvent.cpp;orderman/limiter/LimitStore.cpp;orderman/limiter/Limiter.cpp;orderman/limiter/ProductLimitNode.cpp;orderman/limiter/ProductLimitTree.cpp;orderman/limiter/SecurityLimitNode.cpp;orderman/limiter/SecurityLimitTree.cpp;orderman/limiter/tests/limit_tests.cpp;orderman/order_factory/DynamicOrderRegistry.cpp;orderman/order_factory/OrderFactory.cpp;orderman/order_router/OrderRouter.cpp;orderman/orderman_utils/PerfTraceLog.cpp;orderman/orderman_utils/fix_order_codec.cpp;orderman/orders/DynamicOrder.cpp;orderman/orders/IcebergOrder.cpp;orderman/orders/NativeOrder.cpp;orderman/orders/Order.cpp;orderman/orders/TimeBoxOrder.cpp;orderman/orders/TriggerOrder.cpp;orderman/orders/book_algos/BookAlgo.cpp;orderman/orders/book_algos/CoverOrder.cpp;orderman/orders/book_algos/JoinOrder.cpp;orderman/orders/book_algos/LeanOrder.cpp;orderman/orders/book_algos/OffsetOrder.cpp;orderman/orders/book_algos/TickOrder.cpp;orderman/orders/book_algos/TopOrder.cpp;orderman/orders/spreader_orders/SpreaderOrder.cpp;orderman/orders/spreader_orders/spreader/LegPropertyData.cpp;orderman/orders/spreader_orders/spreader/QuoteLegPriceQuantityState.cpp;orderman/orders/spreader_orders/spreader/SingleFillHedger.cpp;orderman/orders/spreader_orders/spreader/SingleLegQuoter.cpp;orderman/orders/spreader_orders/spreader/SpreaderBookkeepingData.cpp;orderman/orders/spreader_orders/spreader/SpreaderChildOrderState.cpp;orderman/orders/spreader_orders/spreader/SpreaderLegData.cpp;orderman/orders/spreader_orders/spreader/SpreaderUtils.cpp;orderman/orders/spreader_orders/spreader/external_interfacing/SpreaderOrderBuilder.cpp;orderman/orders/spreader_orders/spreader/external_interfacing/SpreaderOrderServices.cpp;orderman/orders/spreader_orders/spreader/external_interfacing/SpreaderPreActivationOrderServices.cpp;orderman/orders/spreader_orders/spreader/hedger/UnhedgedDelta.cpp;orderman/orders/spreader_orders/spreader/hedger/hedger_states/HedgerEndStateWorker.cpp;orderman/orders/spreader_orders/spreader/hedger/hedger_states/HedgerStartStateWorker.cpp;orderman/orders/spreader_orders/spreader/hedger/hedger_states/HedgerWaitingForCancelAckStateWorker.cpp;orderman/orders/spreader_orders/spreader/hedger/hedger_states/HedgerWaitingForFirstAckCancelledStateWorker.cpp;orderman/orders/spreader_orders/spreader/hedger/hedger_states/HedgerWaitingForFirstAckStateWorker.cpp;orderman/orders/spreader_orders/spreader/hedger/hedger_states/HedgerWorkingStateWorker.cpp;orderman/orders/spreader_orders/spreader/quoter/QuoteDriverSet.cpp;orderman/orders/spreader_orders/spreader/quoter/QuoteDriverSetHistory.cpp;orderman/orders/spreader_orders/spreader/quoter/QuoteLegDriver.cpp;orderman/orders/spreader_orders/spreader/quoter/quoter_states/QuoterEndStateWorker.cpp;orderman/orders/spreader_orders/spreader/quoter/quoter_states/QuoterStartStateWorker.cpp;orderman/orders/spreader_orders/spreader/quoter/quoter_states/QuoterWaitingForCancelAckStateWorker.cpp;orderman/orders/spreader_orders/spreader/quoter/quoter_states/QuoterWaitingForFirstAckCancelledWorker.cpp;orderman/orders/spreader_orders/spreader/quoter/quoter_states/QuoterWaitingForFirstAckWorker.cpp;orderman/orders/spreader_orders/spreader/quoter/quoter_states/QuoterWaitingForIOCWorker.cpp;orderman/orders/spreader_orders/spreader/quoter/quoter_states/QuoterWaitingForSizeStateWorker.cpp;orderman/orders/spreader_orders/spreader/quoter/quoter_states/QuoterWorkingStateWorker.cpp;orderman/orders/spreader_orders/spreader_states/SpreaderEndStateWorker.cpp;orderman/orders/spreader_orders/spreader_states/SpreaderStartStateWorker.cpp;orderman/orders/spreader_orders/spreader_states/SpreaderWaitingForCancelAllStateWorker.cpp;orderman/orders/spreader_orders/spreader_states/SpreaderWaitingForInitialDataStateWorker.cpp;orderman/orders/spreader_orders/spreader_states/SpreaderWorkingStateWorker.cpp;orderman/orders/spreader_orders/tests/spreader_tests.cpp;orderman/server/OrderServiceServer.cpp;orderman/tests/fat_wrapper_tests.cpp;orderman2/OrderManager2.cpp;os/os.cpp;os/tests/os_tests.cpp;persistence/IStore.cpp;persistence/PersistenceServiceServer.cpp;persistence/SqliteStore.cpp;persistence/persistence_utils.cpp;persistence/tests/PersistenceServiceTests.cpp;plugin/SparkServices.cpp;plugin/plugin.cpp;quickbus/core/LocalNode.cpp;quickbus/core/Quickbus.cpp;quickbus/core/SubscriptionID.cpp;quickbus/core/TableID.cpp;quickbus/message_model/Update.cpp;quickbus/message_model/merge_updates.cpp;quickbus/network/QBConnection.cpp;quickbus/network/QBConnectionManager.cpp;quickbus/network/endpoint_description.cpp;quickbus/network/quickbus_msgs.proto;quickbus/pubsub/TablePublisher.cpp;quickbus/pubsub/TableSubscriber.cpp;quickbus/pubsub/tests/qb_pubsub_tests.cpp;quickbus/routing/INode.cpp;quickbus/routing/NodeID.cpp;quickbus/routing/Router.cpp;quickbus/rpc/RPCClient.cpp;quickbus/rpc/RPCServer.cpp;quickbus/rpc/RPCSessionID.cpp;quickbus/rpc/rpc_utils.cpp;quickbus/rpc/tests/qb_rpc_tests.cpp;quickbus/tests/quickbus_tests.cpp;sparkproto/SparkProtos.proto;testing/catch_test_runner.cpp;utils/AuthToken.cpp;utils/Dispatcher.cpp;utils/GrowableSPSCQueue.cpp;utils/HTTPStream.cpp;utils/PBUtils.cpp;utils/Puid.cpp;utils/SecureLogon.cpp;utils/SharedMemory.cpp;utils/Sqlite_utils.cpp;utils/Uuid.cpp;utils/datetime.cpp;utils/download.cpp;utils/file_utils.cpp;utils/init_spark_lib.cpp;utils/is_unittest_environment.cpp;utils/stats.cpp;utils/thread_manager.cpp) \ No newline at end of file +set(sources api/apicore.proto;api/apigateway.proto;api/apioptions.proto;api/core/ApiClientInterop.cpp;api/core/ApiServerInterop.cpp;api/public/ApiServer.cpp;api/public/ClientChannel.cpp;api/public/QuickbusClientChannel.cpp;api/public/ServerChannel.cpp;api/public/ServiceContext.cpp;api/service_helpers/AdminServiceUtils.cpp;api/services/AdminService.proto;api/services/ApiUnitTestService.proto;api/services/ErrorReportService.proto;api/services/HelloService.proto;api/services/MarketDataAuxiliaryService.proto;api/services/MarketDataRelay.proto;api/services/OrderService.proto;api/services/OutOfProcessURLListener.proto;api/services/PersistenceService.proto;api/services/PositionService.proto;api/services/ShellDiagnosticService.proto;api/services/ShellLatencyService.proto;api/services/SyntheticSecurityService.proto;api/services/UserService.proto;api/test/ApiTests.cpp;api/test/HelloServiceServer.cpp;config/ConfigCheck.cpp;config/ConfigDownloader.cpp;config/ConfigErrorCollector.cpp;config/ConfigLog.cpp;config/ConfigPropertyEvaluator.cpp;config/ConfigValueQueue.cpp;config/ConfigurationException.cpp;config/ConfigurationState.cpp;config/PreprocessInputStream.cpp;config/config.cpp;config/defaults/MarketData.conf;config/defaults/Ports.conf;config/defaults/Symbols.conf;config/defaults/cme_reference_data.conf;config/defaults/edge.conf;config/defaults/jetfix.conf;config/defaults/logging.conf;config/defaults/orderman_cfg.conf;config/defaults/orders_fills_cleanup.conf;config/defaults/spreader.conf;config/defaults/testkeys.conf;config/defaults/threads.conf;config/defaults/toggles.conf;config/extensions/extensions.proto;config/invalid/invalid.proto;config/protos/ExchangeSimCfg.proto;config/protos/MarketData.proto;config/protos/Ports.proto;config/protos/Symbols.proto;config/protos/UI.proto;config/protos/cme_reference_data.proto;config/protos/jetfix.proto;config/protos/logging.proto;config/protos/mercury_cfg.proto;config/protos/orderman_cfg.proto;config/protos/orders_fills_cleanup.proto;config/protos/quickbus_cfg.proto;config/protos/spreader.proto;config/protos/system.proto;config/protos/testkeys.proto;config/protos/threads.proto;config/protos/toggles.proto;config/tests/HTTPServer.cpp;config/tests/config_ref_tests.cpp;config/tests/config_tests.cpp;config/text_format/text_format.cpp;domain_model/Security.cpp;domain_model/Security.proto;domain_model/SecurityTests.cpp;domain_model/tests/domain_tests.cpp;expression/BooleanGrammar.cpp;expression/ExpressionEvaluator.cpp;expression/ParserExceptions.cpp;expression/Value.cpp;expression/tests/expression_parser_tests.cpp;logging/LoggerHub.cpp;logging/Sink.cpp;logging/logging.cpp;logging/tests/logging_tests.cpp;md/Diag/MDPeriodicDumper.cpp;md/Diag/ShmDumper.cpp;md/MDConsumer.cpp;md/MDConsumerHandle.cpp;md/MDConsumerInterop.cpp;md/MDProducer.cpp;md/MDProducerHandle.cpp;md/MDRecoverableConsumer.cpp;md/MemorySegmentUtils.cpp;md/PlatformLoader.cpp;md/PriceSize.cpp;md/SecurityDB.cpp;md/SecurityIDRecorder.cpp;md/SettlementRecorder.cpp;md/Shm/FixedSecurity.cpp;md/SyntheticSecurityService.cpp;md/cme/MDP3Utils.cpp;md/common.cpp;md/protos/co2.proto;md/relay/QueryServer.cpp;md/relay/RelayClient.cpp;md/relay/RelayRecorder.cpp;md/test/Co2ManagedTestHelper.cpp;md/test/Co2TestInstrument.cpp;md/test/md2_tests.cpp;md/test/synthetic_book_merge_tests.cpp;os/os.cpp;os/tests/os_tests.cpp;quickbus/core/LocalNode.cpp;quickbus/core/Quickbus.cpp;quickbus/core/SubscriptionID.cpp;quickbus/core/TableID.cpp;quickbus/message_model/Update.cpp;quickbus/message_model/merge_updates.cpp;quickbus/network/QBConnection.cpp;quickbus/network/QBConnectionManager.cpp;quickbus/network/endpoint_description.cpp;quickbus/network/quickbus_msgs.proto;quickbus/pubsub/TablePublisher.cpp;quickbus/pubsub/TableSubscriber.cpp;quickbus/pubsub/tests/qb_pubsub_tests.cpp;quickbus/routing/INode.cpp;quickbus/routing/NodeID.cpp;quickbus/routing/Router.cpp;quickbus/rpc/RPCClient.cpp;quickbus/rpc/RPCServer.cpp;quickbus/rpc/RPCSessionID.cpp;quickbus/rpc/rpc_utils.cpp;quickbus/rpc/tests/qb_rpc_tests.cpp;quickbus/tests/quickbus_tests.cpp;sparkproto/SparkProtos.proto;testing/catch_test_runner.cpp;utils/AuthToken.cpp;utils/Dispatcher.cpp;utils/GrowableSPSCQueue.cpp;utils/HTTPStream.cpp;utils/PBUtils.cpp;utils/Puid.cpp;utils/SecureLogon.cpp;utils/SharedMemory.cpp;utils/Sqlite_utils.cpp;utils/Uuid.cpp;utils/datetime.cpp;utils/download.cpp;utils/file_utils.cpp;utils/init_spark_lib.cpp;utils/is_unittest_environment.cpp;utils/stats.cpp;utils/thread_manager.cpp) \ No newline at end of file diff --git a/src/lib/api/service_helpers/AdminServiceUtils.cpp b/src/lib/api/service_helpers/AdminServiceUtils.cpp index ae6641719..ca30f9f61 100644 --- a/src/lib/api/service_helpers/AdminServiceUtils.cpp +++ b/src/lib/api/service_helpers/AdminServiceUtils.cpp @@ -1303,6 +1303,7 @@ void AdminServiceUtils::bootstrap_data (bts::api::admin::AdminData& data){ //associate users bts::api::admin::UserAccountPermissionUnit permission_unit; permission_unit.mutable_trading_permission()->set_submit_market_orders(true); + permission_unit.mutable_trading_permission()->set_has_permissions(true); permission_unit.mutable_admin_permission()->set_has_permissions(true); bts::api::admin::UserAccountPermissions account_permissions; account_permissions.mutable_account_permissions()->insert(google::protobuf::MapPair(parent_account->id(), permission_unit));