(t *testing.T)
| 48 | } |
| 49 | |
| 50 | func TestTokenAuthInterceptor_MissingAuthHeader(t *testing.T) { |
| 51 | logger := zap.NewNop() |
| 52 | auth := NewTokenAuthInterceptor("secret123", logger) |
| 53 | |
| 54 | md := metadata.New(map[string]string{"other-key": "value"}) |
| 55 | ctx := metadata.NewIncomingContext(context.Background(), md) |
| 56 | _, err := auth.authorize(ctx, "/chatcli.v1.ChatCLIService/SendPrompt") |
| 57 | |
| 58 | assert.Error(t, err) |
| 59 | s, ok := status.FromError(err) |
| 60 | assert.True(t, ok) |
| 61 | assert.Equal(t, codes.Unauthenticated, s.Code()) |
| 62 | } |
| 63 | |
| 64 | func TestTokenAuthInterceptor_InvalidFormat(t *testing.T) { |
| 65 | logger := zap.NewNop() |
nothing calls this directly
no test coverage detected