(t *testing.T)
| 159 | } |
| 160 | |
| 161 | func TestRegisterMachine(t *testing.T) { |
| 162 | key, err := kon.registerUser("foo", testkeys.Public, testkeys.Private) |
| 163 | if err != nil { |
| 164 | t.Errorf(err.Error()) |
| 165 | return |
| 166 | } |
| 167 | |
| 168 | claims := &kitekey.KiteClaims{} |
| 169 | |
| 170 | _, err = jwt.ParseWithClaims(key, claims, kitekey.GetKontrolKey) |
| 171 | if err != nil { |
| 172 | t.Fatalf(err.Error()) |
| 173 | } |
| 174 | |
| 175 | if claims.Subject != "foo" { |
| 176 | t.Fatalf("invalid username: %s", claims.Subject) |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | func TestRegisterDenyEvil(t *testing.T) { |
| 181 | // TODO(rjeczalik): use sentinel error value instead |
nothing calls this directly
no test coverage detected