PagerDuty / go-pagerduty

go client library for PagerDuty v2 API
https://v2.developer.pagerduty.com/docs/rest-api
Apache License 2.0
285 stars 241 forks source link

[CSGI-1873] Support Scoped OAuth App authentication #501

Closed imjaroiswebdev closed 7 months ago

imjaroiswebdev commented 10 months ago

This update is meant to bring support for Scoped OAuth App authentication capabilities to Go PagerDuty library.

Therefore, the new Client constructor method NewScopedOAuthAppClient was introduced to enable this authentication method.

On top of that, due to Access Token for Scoped OAuth should be re-used till its expiration, then persistency of obtained Access Token had to be included; Since the CLI client was already using the file ~/.pd.yml, this same file is the default location for persisting Access Token.

However, this location can be changed to any other valid location and file name at client configuration. Like is described in updated README regarding this same topic.

mishranant commented 2 months ago

Hi folks, when will this be released? I see latest release is v1.8.0 and there is no mention of OAuthScope in that. If there are no plans to release this, what is the best alternative -- using the existing OAuth?

ChuckCrawford commented 2 months ago

@mishranant : I can cut a release some time this week. In the meantime you should still be able to pull in the library from the main branch?