Skip to content
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

Single WavefrontClient.Builder constructor to specify any auth type #301

Merged
merged 6 commits into from
Sep 28, 2023

Conversation

oppegard
Copy link
Contributor

@oppegard oppegard commented Sep 27, 2023

A new constructor for clearly choosing the type of authentication desired when creating a WavefrontClient:

public Builder(String server, TokenService.Type tokenType, String multiPartToken)

Examples of the four supported authentication types:

Proxy

WavefrontClient.Builder("http://wf-proxy.local:2878",
    TokenService.Type.NO_TOKEN,
    null)

Wavefront API Token

WavefrontClient.Builder("https://surf.wavefront.com",
    TokenService.Type.WAVEFRONT_API_TOKEN,
    "<wf-api-token-guid>")

CSP Client Credentials

WavefrontClient.Builder("https://surf.wavefront.com",
    TokenService.Type.CSP_CLIENT_CREDENTIALS,
    "clientId=<client-id>,clientSecret=<secret>,orgId=<optional-org-id>")

CSP User API Token

WavefrontClient.Builder("https://surf.wavefront.com",
    TokenService.Type.CSP_API_TOKEN,
    "<csp-user-api-token>")

This feature is to unblock micrometer-metrics/micrometer#4054 and spring-projects/spring-boot#37165.

Other Notes

  • Fixed a bug where maxQueueSize was incorrectly defaulted to 500,000. It is now 50,000 and matches our README as well as the same default used in wavefront-sdk-go and wavefront-sdk-python.
  • Removed cspBaseUrl parameter from constructors of WavefrontClienter.Builder. Overridding the Production CSP URL can be done with the existing the cspBaseUrl(String url) method.

Copy link
Contributor

@ginwoopak ginwoopak left a comment

Choose a reason for hiding this comment

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

Looks good! Left one comment on the TODO.

@oppegard oppegard merged commit 0fd2df8 into master Sep 28, 2023
5 checks passed
@oppegard oppegard deleted the token-svc-builder branch September 28, 2023 15:22
shakuzen pushed a commit to micrometer-metrics/micrometer that referenced this pull request Oct 5, 2023
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.

2 participants