Skip to content

[management] REST client impersonation #3879

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 5 commits into from
Jun 2, 2025
Merged

[management] REST client impersonation #3879

merged 5 commits into from
Jun 2, 2025

Conversation

pnmcosta
Copy link
Contributor

Describe your changes

Ability to return a REST Client impersonated for a specific account

Issue ticket number and link

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds support for creating a REST client that impersonates a specific account by inserting an account query parameter into every request.

  • Introduces an Impersonate method and corresponding HTTP client wrapper
  • Defines a new HttpClient interface and related With... options for flexible client setup
  • Adds NewWithOptions and NewRequest helpers plus an integration test for impersonation

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
management/server/types/settings.go Fixed typo in settings comment
management/client/rest/options.go Added HttpClient interface and option functions
management/client/rest/impersonation.go Implemented Impersonate method and HTTP client wrapper
management/client/rest/impersonation_test.go Added integration test for impersonation
management/client/rest/client.go Added NewWithOptions and NewRequest helpers
Comments suppressed due to low confidence (1)

management/client/rest/options.go:9

  • The interface name 'HttpClient' and function 'WithHttpClient' use inconsistent casing for the 'HTTP' acronym; Go convention is to use 'HTTPClient' and 'WithHTTPClient'.
type HttpClient interface {

Copy link

@mlsmaycon mlsmaycon merged commit 07b220d into main Jun 2, 2025
35 checks passed
@mlsmaycon mlsmaycon deleted the feature/net-181 branch June 2, 2025 20:11
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.

3 participants