fix topic validation (#74)

* fix topic validation

* fix tests
This commit is contained in:
Dominic Wong
2021-03-19 13:29:53 +00:00
committed by GitHub
parent 8dfe49f813
commit a711e10961
5 changed files with 88 additions and 16 deletions

View File

@@ -32,7 +32,7 @@ func TestToken(t *testing.T) {
t.Run("WithBadTopic", func(t *testing.T) {
var rsp pb.TokenResponse
ctx := auth.ContextWithAccount(context.TODO(), &auth.Account{Issuer: "foo"})
err := h.Token(ctx, &pb.TokenRequest{Topic: "helloworld-1"}, &rsp)
err := h.Token(ctx, &pb.TokenRequest{Topic: "helloworld/1"}, &rsp)
assert.Equal(t, handler.ErrInvalidTopic, err)
})
}