Skip to content

feat: add currentIp option atlas-create-access-list tool #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 10, 2025

Conversation

fmenezes
Copy link
Collaborator

@fmenezes fmenezes commented Apr 10, 2025

fixes #36

@fmenezes fmenezes marked this pull request as ready for review April 10, 2025 16:20
@@ -252,6 +252,30 @@ export class ApiClient {
}
}

async getIpInfo() {
await this.validateToken();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we check the return of this call?

method: "GET",
headers: {
Accept: "application/json",
Authorization: `Bearer ${this.token?.access_token}`,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] Assuming this.token is never null if this.validateToken returned successfully.

Suggested change
Authorization: `Bearer ${this.token?.access_token}`,
Authorization: `Bearer ${this.token!.access_token}`,

@@ -36,6 +38,16 @@ export class CreateAccessListTool extends AtlasToolBase {
comment: comment || DEFAULT_COMMENT,
}));

if (currentIpAddress) {
const currentIp = await this.apiClient!.getIpInfo();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const currentIp = await this.apiClient!.getIpInfo();
const currentIp = await this.apiClient.getIpInfo();

@fmenezes fmenezes requested a review from nirinchev April 10, 2025 17:04
@fmenezes fmenezes merged commit f278e4f into main Apr 10, 2025
2 checks passed
@fmenezes fmenezes deleted the fmenezes/add_current_ip branch April 10, 2025 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Atlas] Add currentIp to access lists
2 participants