Skip to content

Commit

Permalink
users: RequestVerify
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriel committed Sep 17, 2020
1 parent 68c62e6 commit 7a0a1f0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion users/echo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func TestRequestVerifyEcho(t *testing.T) {
URL: norm,
}

result := usrs.Verify(context.TODO(), usr)
result := usrs.RequestVerify(context.TODO(), usr)
t.Logf("result: %+v", result)
require.Equal(t, user.StatusOK, result.Status)
}
4 changes: 2 additions & 2 deletions users/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ func (u *Users) CheckSigchain(ctx context.Context, sc *keys.Sigchain) (*user.Res
return result, nil
}

// Verify a user. Doesn't index result.
func (u *Users) Verify(ctx context.Context, usr *user.User) *user.Result {
// RequestVerify requests and verifies a user. Doesn't index result.
func (u *Users) RequestVerify(ctx context.Context, usr *user.User) *user.Result {
return usr.RequestVerify(ctx, user.Requestor(u.req), user.Clock(u.clock))
}

Expand Down
2 changes: 1 addition & 1 deletion users/users_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func TestCheckFailure(t *testing.T) {
Service: "twitter",
URL: "https://twitter.com/boboloblaw/status/1259188857846632448",
}
result := usrs.Verify(context.TODO(), usr)
result := usrs.RequestVerify(context.TODO(), usr)
require.Equal(t, usr.Name, result.User.Name)
require.Equal(t, result.Status, user.StatusFailure)
require.Equal(t, result.Err, "path invalid (name mismatch) for url https://twitter.com/boboloblaw/status/1259188857846632448")
Expand Down

0 comments on commit 7a0a1f0

Please sign in to comment.