Skip to content

Commit 0293528

Browse files
authored
fix: unmarshalling SelectorResponse now includes Text data (#567)
1 parent f46b53f commit 0293528

File tree

31 files changed

+285
-229
lines changed

31 files changed

+285
-229
lines changed

pkg/wsman/amt/auditlog/message.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ func (service Service) ReadRecords(startIndex int) (response Response, err error
4545

4646
err = service.Base.Execute(response.Message)
4747
if err != nil {
48-
return
48+
return response, err
4949
}
5050

5151
err = xml.Unmarshal([]byte(response.XMLOutput), &response)
5252
if err != nil {
53-
return
53+
return response, err
5454
}
5555

5656
response.Body.DecodedRecordsResponse = convertToAuditLogResult(response.Body.ReadRecordsResponse.EventRecords)
5757

58-
return
58+
return response, err
5959
}

pkg/wsman/amt/authorization/service.go

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,16 @@ func (as Service) EnumerateUserACLEntries(startIndex int) (response Response, er
5151

5252
err = as.Base.Execute(response.Message)
5353
if err != nil {
54-
return
54+
return response, err
5555
}
5656

5757
// put the xml response into the go struct
5858
err = xml.Unmarshal([]byte(response.XMLOutput), &response)
5959
if err != nil {
60-
return
60+
return response, err
6161
}
6262

63-
return
63+
return response, err
6464
}
6565

6666
// Gets the state of a user ACL entry (enabled/disabled).
@@ -76,16 +76,16 @@ func (as Service) GetACLEnabledState(handle int) (response Response, err error)
7676

7777
err = as.Base.Execute(response.Message)
7878
if err != nil {
79-
return
79+
return response, err
8080
}
8181

8282
// put the xml response into the go struct
8383
err = xml.Unmarshal([]byte(response.XMLOutput), &response)
8484
if err != nil {
85-
return
85+
return response, err
8686
}
8787

88-
return
88+
return response, err
8989
}
9090

9191
// Returns the username attribute of the Admin ACL.
@@ -101,16 +101,16 @@ func (as Service) GetAdminACLEntry() (response Response, err error) {
101101

102102
err = as.Base.Execute(response.Message)
103103
if err != nil {
104-
return
104+
return response, err
105105
}
106106

107107
// put the xml response into the go struct
108108
err = xml.Unmarshal([]byte(response.XMLOutput), &response)
109109
if err != nil {
110-
return
110+
return response, err
111111
}
112112

113-
return
113+
return response, err
114114
}
115115

116116
// Reads the Admin ACL Entry status from Intel® AMT. The return state changes as a function of the admin password.
@@ -126,16 +126,16 @@ func (as Service) GetAdminACLEntryStatus() (response Response, err error) {
126126

127127
err = as.Base.Execute(response.Message)
128128
if err != nil {
129-
return
129+
return response, err
130130
}
131131

132132
// put the xml response into the go struct
133133
err = xml.Unmarshal([]byte(response.XMLOutput), &response)
134134
if err != nil {
135-
return
135+
return response, err
136136
}
137137

138-
return
138+
return response, err
139139
}
140140

141141
// Reads the remote Admin ACL Entry status from Intel® AMT. The return state changes as a function of the remote admin password.
@@ -151,16 +151,16 @@ func (as Service) GetAdminNetACLEntryStatus() (response Response, err error) {
151151

152152
err = as.Base.Execute(response.Message)
153153
if err != nil {
154-
return
154+
return response, err
155155
}
156156

157157
// put the xml response into the go struct
158158
err = xml.Unmarshal([]byte(response.XMLOutput), &response)
159159
if err != nil {
160-
return
160+
return response, err
161161
}
162162

163-
return
163+
return response, err
164164
}
165165

166166
// Reads a user entry from the Intel® AMT device. Note: confidential information, such as password (hash) is omitted or zeroed in the response.
@@ -176,16 +176,16 @@ func (as Service) GetUserACLEntryEx(handle int) (response Response, err error) {
176176

177177
err = as.Base.Execute(response.Message)
178178
if err != nil {
179-
return
179+
return response, err
180180
}
181181

182182
// put the xml response into the go struct
183183
err = xml.Unmarshal([]byte(response.XMLOutput), &response)
184184
if err != nil {
185-
return
185+
return response, err
186186
}
187187

188-
return
188+
return response, err
189189
}
190190

191191
// Removes an entry from the User Access Control List (ACL), given a handle.
@@ -201,16 +201,16 @@ func (as Service) RemoveUserACLEntry(handle int) (response Response, err error)
201201

202202
err = as.Base.Execute(response.Message)
203203
if err != nil {
204-
return
204+
return response, err
205205
}
206206

207207
// put the xml response into the go struct
208208
err = xml.Unmarshal([]byte(response.XMLOutput), &response)
209209
if err != nil {
210-
return
210+
return response, err
211211
}
212212

213-
return
213+
return response, err
214214
}
215215

216216
// Enables or disables a user ACL entry. Disabling ACL entries is useful when accounts that cannot be removed (system accounts - starting with $$) are required to be disabled.
@@ -226,16 +226,16 @@ func (as Service) SetACLEnabledState(handle int, enabled bool) (response Respons
226226

227227
err = as.Base.Execute(response.Message)
228228
if err != nil {
229-
return
229+
return response, err
230230
}
231231

232232
// put the xml response into the go struct
233233
err = xml.Unmarshal([]byte(response.XMLOutput), &response)
234234
if err != nil {
235-
return
235+
return response, err
236236
}
237237

238-
return
238+
return response, err
239239
}
240240

241241
// Updates an Admin entry in the Intel® AMT device.
@@ -251,14 +251,14 @@ func (as Service) SetAdminAclEntryEx(username, digestPassword string) (response
251251

252252
err = as.Base.Execute(response.Message)
253253
if err != nil {
254-
return
254+
return response, err
255255
}
256256

257257
// put the xml response into the go struct
258258
err = xml.Unmarshal([]byte(response.XMLOutput), &response)
259259
if err != nil {
260-
return
260+
return response, err
261261
}
262262

263-
return
263+
return response, err
264264
}

pkg/wsman/amt/boot/settingdata.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@ func (settingData SettingData) Get() (response Response, err error) {
3131
// send the message to AMT
3232
err = settingData.base.Execute(response.Message)
3333
if err != nil {
34-
return
34+
return response, err
3535
}
3636

3737
// put the xml response into the go struct
3838
err = xml.Unmarshal([]byte(response.XMLOutput), &response)
3939
if err != nil {
40-
return
40+
return response, err
4141
}
4242

43-
return
43+
return response, err
4444
}
4545

4646
// Enumerate returns an enumeration context which is used in a subsequent Pull call.
@@ -54,16 +54,16 @@ func (settingData SettingData) Enumerate() (response Response, err error) {
5454
// send the message to AMT
5555
err = settingData.base.Execute(response.Message)
5656
if err != nil {
57-
return
57+
return response, err
5858
}
5959

6060
// put the xml response into the go struct
6161
err = xml.Unmarshal([]byte(response.XMLOutput), &response)
6262
if err != nil {
63-
return
63+
return response, err
6464
}
6565

66-
return
66+
return response, err
6767
}
6868

6969
// Pull returns the instances of this class. An enumeration context provided by the Enumerate call is used as input.
@@ -77,16 +77,16 @@ func (settingData SettingData) Pull(enumerationContext string) (response Respons
7777
// send the message to AMT
7878
err = settingData.base.Execute(response.Message)
7979
if err != nil {
80-
return
80+
return response, err
8181
}
8282

8383
// put the xml response into the go struct
8484
err = xml.Unmarshal([]byte(response.XMLOutput), &response)
8585
if err != nil {
86-
return
86+
return response, err
8787
}
8888

89-
return
89+
return response, err
9090
}
9191

9292
func (settingData SettingData) Put(bootSettingData BootSettingDataRequest) (response Response, err error) {

pkg/wsman/amt/environmentdetection/settingdata.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ func (sd SettingData) Get() (response Response, err error) {
3131
// send the message to AMT
3232
err = sd.base.Execute(response.Message)
3333
if err != nil {
34-
return
34+
return response, err
3535
}
3636
// put the xml response into the go struct
3737
err = xml.Unmarshal([]byte(response.XMLOutput), &response)
3838
if err != nil {
39-
return
39+
return response, err
4040
}
4141

42-
return
42+
return response, err
4343
}
4444

4545
// Enumerate returns an enumeration context which is used in a subsequent Pull call.
@@ -52,15 +52,15 @@ func (sd SettingData) Enumerate() (response Response, err error) {
5252
// send the message to AMT
5353
err = sd.base.Execute(response.Message)
5454
if err != nil {
55-
return
55+
return response, err
5656
}
5757
// put the xml response into the go struct
5858
err = xml.Unmarshal([]byte(response.XMLOutput), &response)
5959
if err != nil {
60-
return
60+
return response, err
6161
}
6262

63-
return
63+
return response, err
6464
}
6565

6666
// Pull returns the instances of this class. An enumeration context provided by the Enumerate call is used as input.
@@ -73,15 +73,15 @@ func (sd SettingData) Pull(enumerationContext string) (response Response, err er
7373
// send the message to AMT
7474
err = sd.base.Execute(response.Message)
7575
if err != nil {
76-
return
76+
return response, err
7777
}
7878
// put the xml response into the go struct
7979
err = xml.Unmarshal([]byte(response.XMLOutput), &response)
8080
if err != nil {
81-
return
81+
return response, err
8282
}
8383

84-
return
84+
return response, err
8585
}
8686

8787
// Put will change properties of the selected instance.
@@ -99,13 +99,13 @@ func (sd SettingData) Put(environmentDetectionSettingData EnvironmentDetectionSe
9999
// send the message to AMT
100100
err = sd.base.Execute(response.Message)
101101
if err != nil {
102-
return
102+
return response, err
103103
}
104104
// put the xml response into the go struct
105105
err = xml.Unmarshal([]byte(response.XMLOutput), &response)
106106
if err != nil {
107-
return
107+
return response, err
108108
}
109109

110-
return
110+
return response, err
111111
}

0 commit comments

Comments
 (0)