Skip to content

Add Token expiry buffer for oauth2clientauthextension #35148

Closed
@pureklkl

Description

@pureklkl

Component(s)

extension/oauth2clientauth

Is your feature request related to a problem? Please describe.

There is a risk that the oauth token expired right after the request being sent and causing a data loss.

Describe the solution you'd like

Add a config for expiry buffer. The change would be like replace the ReuseTokenSource with ReuseTokenSourceWithExpiry and add a config for the expiry. Optional to provide a default expiry buffer
ref:
https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/extension/oauth2clientauthextension/clientcredentialsconfig.go#L93
https://pkg.go.dev/golang.org/x/oauth2#ReuseTokenSourceWithExpiry

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions