Skip to content

Commit

Permalink
Use cloud basePath for API clients from configuration passed in
Browse files Browse the repository at this point in the history
The configuration for API clients isn't using the cloud configuration value to derive basePath. However, the auth code uses the cloud value to derive base path.

This causes problems when the cloud configuration value isn't the same as the default used in the API configuration. This causes API failures since the access token is provisioned from a different endpoint.

This derives a basePath for API client configuration using the cloud configuration value passed in so they are in sync.
  • Loading branch information
nathancharles authored and jshcodes committed Jan 24, 2024
1 parent 1095edd commit 820a631
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Configuration, FetchAPI } from "./runtime";
import { EventStream } from "./event_stream";
import { FalconCloud } from "./FalconCloud";
import { FalconCloud, CloudBasePath } from "./FalconCloud";
import { OAuth2, UserAgent } from "./middleware";
import {
AlertsApi,
Expand Down Expand Up @@ -144,6 +144,7 @@ export class FalconClient {
fetchApi: options.fetchApi,
accessToken: oauth2.accessToken.bind(oauth2),
middleware: [new UserAgent()],
basePath: CloudBasePath(options.cloud),
});
this.alerts = new AlertsApi(this.config);
this.cloudConnectAws = new CloudConnectAwsApi(this.config);
Expand Down

0 comments on commit 820a631

Please sign in to comment.