Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(368)

Unified Diff: server/auth/delegation/checker.go

Issue 2951393002: [errors] de-specialize Transient in favor of Tags. (Closed)
Patch Set: more refactor Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: server/auth/delegation/checker.go
diff --git a/server/auth/delegation/checker.go b/server/auth/delegation/checker.go
index 4b3b89cefd8105282b57488ca2b192c8ca3b9e2f..6e45b3a25a8ebdcc1ec34e0493d728d421952d05 100644
--- a/server/auth/delegation/checker.go
+++ b/server/auth/delegation/checker.go
@@ -15,6 +15,7 @@ import (
"github.com/luci/luci-go/common/clock"
"github.com/luci/luci-go/common/errors"
"github.com/luci/luci-go/common/logging"
+ "github.com/luci/luci-go/common/retry/transient"
"github.com/luci/luci-go/server/auth/identity"
"github.com/luci/luci-go/server/auth/signing"
@@ -95,7 +96,7 @@ func CheckToken(c context.Context, params CheckTokenParams) (identity.Identity,
// Signed serialized subtoken -> Subtoken proto.
subtoken, err := unsealToken(c, tok, params.CertificatesProvider)
if err != nil {
- if errors.IsTransient(err) {
+ if transient.Tag.In(err) {
logging.Warningf(c, "auth: Transient error when checking delegation token signature - %s", err)
return "", err
}
@@ -178,7 +179,7 @@ func checkSubtoken(c context.Context, subtoken *messages.Subtoken, params *Check
// Do the audience check (may use group lookups).
if err := checkSubtokenAudience(c, subtoken, params.PeerID, params.GroupsChecker); err != nil {
- if errors.IsTransient(err) {
+ if transient.Tag.In(err) {
logging.Warningf(c, "auth: Transient error when checking delegation token audience - %s", err)
return "", err
}

Powered by Google App Engine
This is Rietveld 408576698