Project

General

Profile

Expand WebService class » History » Version 5

Anonymous, 02/12/2016 02:41 PM

1 1 Anonymous
h1. Expand WebService class
2 1 Anonymous
3 1 Anonymous
4 3 Anonymous
h2. Aim: 
5 1 Anonymous
6 1 Anonymous
Add ways to add parameters to a WebService.
7 1 Anonymous
8 1 Anonymous
9 1 Anonymous
Web services always have lots of parameters. Some of them native, standard parameters, likeuser-agent or host, others URL parameters that can be set arbitrarily. These parameters could be given in the attribute arg from the WebService class. However, this field was a single string, whereas arbitrarily set parameters are key-value couples.
10 1 Anonymous
11 3 Anonymous
h2. Solution 1:
12 1 Anonymous
13 4 Anonymous
Add a WebServiceHeaderParams class to add HTTP parameters
14 4 Anonymous
Always write name_of_parameter:value in the attribute arg. For example : lang:fr.
15 1 Anonymous
16 3 Anonymous
|_.Impacted Class|_.Proposed Field|_.Type   |
17 3 Anonymous
|/2.[[IDMEF_Service_Zoom|WebService]]->WebServiceHeaderParams|parameter|host
18 3 Anonymous
referer
19 3 Anonymous
user-agent
20 3 Anonymous
server
21 3 Anonymous
cookie
22 3 Anonymous
http-method
23 3 Anonymous
other|
24 3 Anonymous
|value|String|
25 1 Anonymous
26 3 Anonymous
h3. Pros
27 3 Anonymous
28 3 Anonymous
h3. Cons
29 1 Anonymous
30 4 Anonymous
*  This is not really easy to read or process.
31 4 Anonymous
32 3 Anonymous
h2. Solution 2:
33 1 Anonymous
34 4 Anonymous
Add a WebServiceHeaderParams class to add HTTP parameters
35 3 Anonymous
Add a way to give the class "labels" containing the name of the parameter and its value.
36 3 Anonymous
37 3 Anonymous
|_.Impacted Class|_.Proposed Field|_.Type   |
38 3 Anonymous
|/2.[[IDMEF_Service_Zoom|WebService]]->WebServiceHeaderParams|parameter|host
39 3 Anonymous
referer
40 3 Anonymous
user-agent
41 3 Anonymous
server
42 3 Anonymous
cookie
43 3 Anonymous
http-method
44 3 Anonymous
other|
45 3 Anonymous
|value|String|
46 3 Anonymous
|/2.[[IDMEF_Service_Zoom|WebService]]->WebServiceParams
47 3 Anonymous
|parameter|String|
48 3 Anonymous
|value|String|
49 5 Anonymous
|{background:#e99b9b}.[[IDMEF_Service_Zoom|WebService]]|\2{background:#e99b9b}.arg|
50 3 Anonymous
51 3 Anonymous
h3. Pros
52 3 Anonymous
53 3 Anonymous
* The same method that is already used to add addresses to a node or userIds to a user : a new class that can be instanciated as many times as needed : one for each label necessary.
54 3 Anonymous
55 1 Anonymous
h3. Cons
56 4 Anonymous
57 4 Anonymous
* Attention of backwards compatibility
58 3 Anonymous
59 3 Anonymous
h2. Meetings : 
60 3 Anonymous
61 3 Anonymous
+30/10/2015 Meeting+: This is once again IDMEF's main problem : it's too precise and not offering enough information at the same time. these fields are going to be useful.
62 1 Anonymous
what for the potential consequences of the disappearance of arg on bakward compatibility ?
63 2 Anonymous
TODO : Ask sensor developpers if the suggested standard parameters suit them.
64 1 Anonymous
TODO : Explain more thoroughly the concept of "label" in the tutorials.