Clients and accounts
Client tokens
Section titled “Client tokens”Bridge uses authorization: Bearer TOKEN metadata. Manage service clients from
the Bridge container, where the database configuration and encryption key exist:
python -m omsbridge.clients create nonamepython -m omsbridge.clients show nonamepython -m omsbridge.clients listpython -m omsbridge.clients rotate nonamepython -m omsbridge.clients revoke nonameWith local Compose, prefix these commands with docker compose exec bridge.
Create, show and rotate print the token. The CLI defaults to
/etc/omsbridge/config.toml; a host process can supply --config config.toml before
the subcommand. Tokens are stored encrypted in MongoDB.
Rotation and revocation apply to new RPCs immediately. Existing streams retain their authentication until they disconnect. Rotation preserves the service-client identity used for order IDs and order visibility.
Connect in Python
Section titled “Connect in Python”from omsbridge.v1.client import channelfrom omsbridge.v1.proto import bridge_pb2 as pbfrom omsbridge.v1.proto import bridge_pb2_grpc as stubs
async def list_accounts(token): async with channel("grpcs://omsbridge.example.com:443", token) as connection: return await stubs.AccountsStub(connection).ListAccounts( pb.ListAccountsRequest(), timeout=10, )Use grpcs:// through the TLS proxy. Bare host:port targets also use TLS.
For a trusted backend connection, grpc://bridge:8080 uses cleartext HTTP/2.
For a private certificate authority, pass its PEM bytes as root_certificates.
The client helper attaches authentication and disables transport retries.
Broker support
Section titled “Broker support”| OMS | Broker codes | Managed trading |
|---|---|---|
| Ephoenix | Bourse Bimeh 1, Ganjineh Sepehr 2, Karamad 4 |
Ordinary orders |
| OMEX | Khobregan Saham 3 |
UNIMPLEMENTED |
| Exphoenix Future | Bourse Bimeh 1 |
Ordinary futures orders |
Call Accounts.CreateAccount with the broker code, OMS enum, username, password
and identity_user_id. The service client supplies the Identity OIDC sub claim
as identity_user_id. Keep the returned Bridge account_id.
ListAccounts can filter by identity_user_id. This links accounts to an Identity
subject; it does not restrict other configured Bridge clients from administering
the account. UpdateAccount supports credentials, enabled state and subject changes.
Market calls that omit an account ID allow Bridge to select an account. Managed order submission always requires an explicit account ID.
Generate clients in another language
Section titled “Generate clients in another language”Download the files linked from the API reference, retaining the
omsbridge/v1/proto/ directory structure. Use the directory containing omsbridge/
as the protobuf include root. Generate message bindings for every imported schema
and gRPC service bindings for bridge.proto with your language’s tools.
Dates and datetimes use ISO 8601 strings unless a field declares a protobuf Timestamp. Broker numeric enums preserve adapter values. Opaque broker query filter and aggregate fields contain UTF-8 JSON bytes.