Skip to content

Commit 47694e3

Browse files
Add missing download auth definition to kibana client
1 parent 544a800 commit 47694e3

2 files changed

Lines changed: 20 additions & 9 deletions

File tree

kibana/fleet.go

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -147,20 +147,29 @@ func (client *Client) CreatePolicy(ctx context.Context, request AgentPolicy) (r
147147
return polResp.Item, err
148148
}
149149

150+
type DownloadSourceAuth struct {
151+
APIKey string `json:"api_key,omitempty"`
152+
Headers interface{} `json:"headers,omitempty"`
153+
Username string `json:"username,omitempty"`
154+
Password string `json:"password,omitempty"`
155+
}
156+
150157
type DownloadSource struct {
151-
Name string `json:"name"`
152-
Host string `json:"host"`
153-
IsDefault bool `json:"is_default"`
154-
ProxyID interface{} `json:"proxy_id"`
158+
Name string `json:"name"`
159+
Host string `json:"host"`
160+
IsDefault bool `json:"is_default"`
161+
ProxyID interface{} `json:"proxy_id"`
162+
Auth *DownloadSourceAuth `json:"auth,omitempty"`
155163
}
156164

157165
type DownloadSourceResponse struct {
158166
Item struct {
159-
ID string `json:"id"`
160-
Name string `json:"name"`
161-
Host string `json:"host"`
162-
IsDefault bool `json:"is_default"`
163-
ProxyID string `json:"proxy_id"`
167+
ID string `json:"id"`
168+
Name string `json:"name"`
169+
Host string `json:"host"`
170+
IsDefault bool `json:"is_default"`
171+
ProxyID string `json:"proxy_id"`
172+
Auth *DownloadSourceAuth `json:"auth,omitempty"`
164173
} `json:"item"`
165174
}
166175

kibana/fleet_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@ func TestFleetDownloadSource(t *testing.T) {
439439
require.Equal(t, id, resp.Item.ID)
440440
require.Equal(t, name, resp.Item.Name)
441441
require.NotEmpty(t, "http://test.local", resp.Item.Host)
442+
require.Nil(t, resp.Item.Auth)
442443
})
443444
t.Run("update", func(t *testing.T) {
444445
resp, err := client.UpdateDownloadSource(t.Context(), id, DownloadSource{
@@ -449,6 +450,7 @@ func TestFleetDownloadSource(t *testing.T) {
449450
require.Equal(t, id, resp.Item.ID)
450451
require.Equal(t, name, resp.Item.Name)
451452
require.NotEmpty(t, "http://newtest.local", resp.Item.Host)
453+
require.Nil(t, resp.Item.Auth)
452454
})
453455
}
454456

0 commit comments

Comments
 (0)