Repository navigation
fix(oauth2lib): stop calling the deprecated net.Error.Temporary in tests - #219
Merged
agrawalradhika-cell merged 1 commit intoDec 2, 2026
Conversation
net.Error.Temporary has been deprecated since Go 1.18. The test now checks only Timeout(). timeoutError keeps Temporary so that it still implements net.Error.
agrawalradhika-cell
force-pushed
the
fix/oauth2lib-url-validation
branch
from
December 1, 2026 22:05
741a953 to
e260cc9
Compare
burkedavison
approved these changes
Dec 2, 2026
andyrzhao
approved these changes
Dec 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a finding from the google3 import review of
oauth2lib/v0.1.0-rc.1(cl/1033099457):net.Error.Temporaryhas been deprecated since Go 1.18.TestClassifyTransportErrorForeignContextErrorscallednetErr.Temporary(). It now checks onlyTimeout().timeoutErrorkeeps itsTemporarymethod, with a comment saying why:net.Errorstill requires it, so removing it would makeerrors.As(err, &netErr)stop matching client timeouts.There's no behavior change.
The same review also asked to restrict plain
httpto loopback hosts and to makevalidateTokenURLas strict asvalidateEndpoint. Those changes are not in this PR. They would make oauth2lib stricter than Python gcloud and google-auth:token_urias given.auth/token_hosthas no validator.EndpointOverrideValidatoraccepts anyhttp://orhttps://host forapi_endpoint_overrides/iamcredentials.Testing
Go 1.27.4:
go vet ./...andgo test -race -cover ./...(oauth2lib 97.3%, goldenvectors 95.9%).