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

Use context in new requests #362

Closed
argenta-quanto opened this issue Jan 13, 2023 · 3 comments
Closed

Use context in new requests #362

argenta-quanto opened this issue Jan 13, 2023 · 3 comments

Comments

@argenta-quanto
Copy link

argenta-quanto commented Jan 13, 2023

In some methods the code below do not use the context passed thought the method:
ex:

func (p *Provider) UserInfo(ctx context.Context, tokenSource oauth2.TokenSource) (*UserInfo, error) {
	...
	if p.userInfoURL == "" {
		return nil, errors.New("oidc: user info endpoint is not supported by this provider")
	}

	req, err := http.NewRequest("GET", p.userInfoURL, nil)
	...

There is something that create some kind of risk in using :
req, err := http.NewRequestWithContext(ctx, "GET", p.userInfoURL, nil)

?

Thanks.

argenta-quanto added a commit to argenta-quanto/go-oidc that referenced this issue Jan 13, 2023
this use the context sent to methods in requests

Fixes coreos#362
argenta-quanto added a commit to argenta-quanto/go-oidc that referenced this issue Jan 13, 2023
this use the context sent to methods in requests

Fixes coreos#362
argenta-quanto added a commit to argenta-quanto/go-oidc that referenced this issue Jan 13, 2023
this use the context sent to methods in requests

Fixes coreos#362
@argenta-quanto
Copy link
Author

Made a PR:

#363

@ericchiang
Copy link
Collaborator

Can you take a look at #364?

@argenta-quanto
Copy link
Author

Can you take a look at #364?

Yes, this is what I need.
Thanks.

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 a pull request may close this issue.

2 participants