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

Unified Diff: server/auth/authtest/state.go

Issue 2830443003: auth: Refactor how authentication methods are passed to server/auth library. (Closed)
Patch Set: fix test Created 3 years, 8 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
« no previous file with comments | « server/auth/authtest/method.go ('k') | server/auth/context.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: server/auth/authtest/state.go
diff --git a/server/auth/authtest/state.go b/server/auth/authtest/state.go
index 41650624b6ccc0fb24d37cbdb718e5922b5da7c1..33615c70c0582da03dbd29d23c144cec606ed0c3 100644
--- a/server/auth/authtest/state.go
+++ b/server/auth/authtest/state.go
@@ -52,6 +52,15 @@ type FakeState struct {
var _ auth.State = (*FakeState)(nil)
+// Authenticator is part of State interface.
+func (s *FakeState) Authenticator() *auth.Authenticator {
+ return &auth.Authenticator{
+ Methods: []auth.Method{
+ &FakeAuth{User: s.User()},
+ },
+ }
+}
+
// DB is part of State interface.
func (s *FakeState) DB() authdb.DB {
if s.FakeDB != nil {
@@ -65,9 +74,7 @@ func (s *FakeState) DB() authdb.DB {
// Method is part of State interface.
func (s *FakeState) Method() auth.Method {
- return &FakeAuth{
- User: s.User(),
- }
+ return s.Authenticator().Methods[0]
}
// User is part of State interface.
« no previous file with comments | « server/auth/authtest/method.go ('k') | server/auth/context.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698