Skip to content

Commit

Permalink
Add new API endpoints for AIX, EOL Microsoft, and Virtuozzo security …
Browse files Browse the repository at this point in the history
…advisories
  • Loading branch information
tcampbPPU committed Nov 19, 2024
1 parent cfed117 commit c739b5b
Show file tree
Hide file tree
Showing 2 changed files with 1,956 additions and 923 deletions.
117 changes: 117 additions & 0 deletions index_funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,45 @@ func (c *Client) GetIndexAdobe(queryParameters ...IndexQueryParameters) (respons
return responseJSON, nil
}

type IndexAixResponse struct {
Benchmark float64 `json:"_benchmark"`
Meta IndexMeta `json:"_meta"`
Data []client.AdvisoryAIX `json:"data"`
}

// GetIndexAix - AIX security advisories are official notifications released by IBM to address security vulnerabilities and updates in the AIX operating system. These advisories provide important information about the vulnerabilities, their potential impact, and recommendations for users to apply necessary patches or updates to ensure the security of their systems.
func (c *Client) GetIndexAix(queryParameters ...IndexQueryParameters) (responseJSON *IndexAixResponse, err error) {

httpClient := &http.Client{}
req, err := http.NewRequest("GET", c.GetUrl()+"/v3/index/"+url.QueryEscape("aix"), nil)
if err != nil {
panic(err)
}

c.SetAuthHeader(req)

query := req.URL.Query()
setIndexQueryParameters(query, queryParameters...)
req.URL.RawQuery = query.Encode()

resp, err := httpClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()

if resp.StatusCode != 200 {
var metaError MetaError
_ = json.NewDecoder(resp.Body).Decode(&metaError)

return nil, fmt.Errorf("error: %v", metaError.Errors)
}

_ = json.NewDecoder(resp.Body).Decode(&responseJSON)

return responseJSON, nil
}

type IndexAlephResearchResponse struct {
Benchmark float64 `json:"_benchmark"`
Meta IndexMeta `json:"_meta"`
Expand Down Expand Up @@ -5130,6 +5169,45 @@ func (c *Client) GetIndexEol(queryParameters ...IndexQueryParameters) (responseJ
return responseJSON, nil
}

type IndexEolMicrosoftResponse struct {
Benchmark float64 `json:"_benchmark"`
Meta IndexMeta `json:"_meta"`
Data []client.AdvisoryEOLMicrosoft `json:"data"`
}

// GetIndexEolMicrosoft - The Microsoft EOL data feed contains Microsoft product lifecycle data including release, retirement dates and support policies.
func (c *Client) GetIndexEolMicrosoft(queryParameters ...IndexQueryParameters) (responseJSON *IndexEolMicrosoftResponse, err error) {

httpClient := &http.Client{}
req, err := http.NewRequest("GET", c.GetUrl()+"/v3/index/"+url.QueryEscape("eol-microsoft"), nil)
if err != nil {
panic(err)
}

c.SetAuthHeader(req)

query := req.URL.Query()
setIndexQueryParameters(query, queryParameters...)
req.URL.RawQuery = query.Encode()

resp, err := httpClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()

if resp.StatusCode != 200 {
var metaError MetaError
_ = json.NewDecoder(resp.Body).Decode(&metaError)

return nil, fmt.Errorf("error: %v", metaError.Errors)
}

_ = json.NewDecoder(resp.Body).Decode(&responseJSON)

return responseJSON, nil
}

type IndexEpssResponse struct {
Benchmark float64 `json:"_benchmark"`
Meta IndexMeta `json:"_meta"`
Expand Down Expand Up @@ -14558,6 +14636,45 @@ func (c *Client) GetIndexVeritas(queryParameters ...IndexQueryParameters) (respo
return responseJSON, nil
}

type IndexVirtuozzoResponse struct {
Benchmark float64 `json:"_benchmark"`
Meta IndexMeta `json:"_meta"`
Data []client.AdvisoryVirtuozzo `json:"data"`
}

// GetIndexVirtuozzo - Virtuozzo security advisories are official notifications released by Virtuozzo to address security vulnerabilities and updates for the Virtuozzo ReadyKernel patch service. These advisories provide important information about the vulnerabilities, their potential impact, and recommendations for users to apply necessary patches or updates to ensure the security of their systems.
func (c *Client) GetIndexVirtuozzo(queryParameters ...IndexQueryParameters) (responseJSON *IndexVirtuozzoResponse, err error) {

httpClient := &http.Client{}
req, err := http.NewRequest("GET", c.GetUrl()+"/v3/index/"+url.QueryEscape("virtuozzo"), nil)
if err != nil {
panic(err)
}

c.SetAuthHeader(req)

query := req.URL.Query()
setIndexQueryParameters(query, queryParameters...)
req.URL.RawQuery = query.Encode()

resp, err := httpClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()

if resp.StatusCode != 200 {
var metaError MetaError
_ = json.NewDecoder(resp.Body).Decode(&metaError)

return nil, fmt.Errorf("error: %v", metaError.Errors)
}

_ = json.NewDecoder(resp.Body).Decode(&responseJSON)

return responseJSON, nil
}

type IndexVmwareResponse struct {
Benchmark float64 `json:"_benchmark"`
Meta IndexMeta `json:"_meta"`
Expand Down
Loading

0 comments on commit c739b5b

Please sign in to comment.