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

feat: added oauth support: resolves #13 #14

Merged
merged 2 commits into from
Jul 27, 2023

Conversation

sdewitt-newrelic
Copy link
Contributor

Description

Adds support for authenticating ReST API calls via OAuth.

  • Supports password and client_credentials grant types
  • By default will use the ${apiUrl}/oauth_token.do URL but the oauthTokenUrl parameter is supported to allow obtaining tokens from other services
  • Uses golang.org/x/oauth2 for performing OAuth 2.0 2-legged flow

Note that we are now using gofmt for formatting code automatically. Therefore, this change includes whitespace changes that are not related to this PR but also don't affect the code.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing
    functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@sdewitt-newrelic sdewitt-newrelic self-assigned this Jul 26, 2023
@sdewitt-newrelic sdewitt-newrelic added the enhancement Feature Improvements label Jul 26, 2023
jbeveland27
jbeveland27 previously approved these changes Jul 26, 2023
Copy link
Contributor

@jbeveland27 jbeveland27 left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@jbeveland27 jbeveland27 linked an issue Jul 26, 2023 that may be closed by this pull request
Copy link
Contributor

@jbeveland27 jbeveland27 left a comment

Choose a reason for hiding this comment

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

🚢

@sdewitt-newrelic sdewitt-newrelic merged commit 0ce3983 into main Jul 27, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature Improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FR] OAuth2 Support
2 participants