Skip to content

Commit

Permalink
Merge pull request CrowdStrike#135 from davidc6/feature/openapi-spec-…
Browse files Browse the repository at this point in the history
…update-23Aug2024

[FEATURE] Update to the latest OpenAPI spec (09 Aug 2024 / 080924)
  • Loading branch information
davidc6 authored Aug 29, 2024
2 parents caf0478 + 70a7449 commit a7921b3
Show file tree
Hide file tree
Showing 1,577 changed files with 54,430 additions and 6,924 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.4.0] - 2024-08-27

### Changed

- Update Rusty Falcon to use the latest OpenAPI spec
- Update example code to follow the latest OpenAPI spec changes
- Fix links in the README

## [0.3.3] - 2023-09-04

### Added
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rusty_falcon"
version = "0.3.3"
version = "0.4.0"
authors = ["CrowdStrike Inc"]
description = "Rust bindings for CrowdStrike Falcon API"
homepage = "https://github.com/CrowdStrike/rusty-falcon"
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ To get you started quickly, the easiest and highest-level way to establish API c
`easy::client::FalconHandle`. The most convenient way is to use `easy::client::FalconHandle::from_env`
function that will read the following environment variables to authenticate with falcon cloud:
`FALCON_CLIENT_ID`, `FALCON_CLIENT_SECRET`, and `FALCON_CLOUD`. Unless you already have a CrowdStrike key
pair you can establish a new one in [Falcon Portal](https://falcon.crowdstrike.com/support/api-clients-and-keys).
pair you can establish a new one in [Falcon Portal](https://falcon.crowdstrike.com/api-clients-and-keys).

```rust
use rusty_falcon::apis::sensor_download_api;
Expand Down Expand Up @@ -56,7 +56,7 @@ Ready-made examples can be found in [git repo](https://github.com/CrowdStrike/ru

# Generating models from OpenApi Specification

This api model is generated from OpenApi specification using OpenApi Generator for Rust language.
This api model is generated from OpenApi specification using [OpenApi Generator](https://openapi-generator.tech/docs/installation/) for Rust language.
> Note: In the OpenApi specification please update version to `rolling``, if required and update version on the list below.
> This will prevent crazy long PRs with updates.
Expand All @@ -68,7 +68,7 @@ openapi-generator generate -g rust -i swagger.json -o ./new

## OpenApi Specification Version

`2023-08-23T23:00:01Z`
`2024-05-29T00:00:02Z`

# Getting Help

Expand Down
2 changes: 1 addition & 1 deletion examples/falcon_discover_hosts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ async fn main() {
break;
}

offset = offset + response.resources.len();
offset += response.resources.len();

let batch_details = get_hosts(&falcon.cfg, response.resources)
.await
Expand Down
5 changes: 2 additions & 3 deletions examples/falcon_supported_kernels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async fn main() {

let mut arch_set = HashSet::new();
let mut distro_set = HashSet::new();
for kernel in kernels.resources.unwrap() {
for kernel in kernels.resources {
arch_set.insert(kernel.architecture);
distro_set.insert(kernel.distro);
}
Expand Down Expand Up @@ -102,14 +102,13 @@ async fn main() {
);
}

if response.resources.is_none() {
if response.resources.is_empty() {
eprintln!("No CCID returned");
return;
}

let releases = response
.resources
.expect("Could not find the releases.")
.into_iter()
.map(|obj| obj.release)
.collect::<Vec<String>>();
Expand Down
Loading

0 comments on commit a7921b3

Please sign in to comment.