1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
///
///
/// TODO: Need to decide how to add API key to requests:
///
/// Option 1: We create a request object:
/// Request { ApiKey: xxx, Request: yyy, RequestObjectClass: zzz }, where yyy could be a oneof(each request type), or simply a bytes version of the underlying request; and zzz would be explicit on the request object
///
/// Option 2: Each service request requires an API key explicitly:
/// QueryPositionRequest { ApiKey: xxx, <the rest of the request as is> }
/// CreateTransactionRequest { ApiKey: xxx, <the rest of the request as is> }
///
/// Option 3: ?
///
/// Pros/Cons
///
/// Option 1:
/// PRO: Each indvidual request object doesn't require any change
/// PRO: Each underlying service could be sent the request and not even be aware of the security layer
/// CON: ? Adds a layer of indirection?
///
/// Option 2:
/// PRO: Very explicit approach
/// CON: Any changes in ApiKey model would need to be propagated to all the new objects
/// CON: Requires developers to understand they need to add this to new requests they define
///
///
/// I'm favoring option 1, but will think on it.
///