Skip to content

feat(gRPC): Allow configuring an auth token#35

Merged
joschahenningsen merged 1 commit intomainfrom
feat/auth
Nov 22, 2025
Merged

feat(gRPC): Allow configuring an auth token#35
joschahenningsen merged 1 commit intomainfrom
feat/auth

Conversation

@joschahenningsen
Copy link
Member

@joschahenningsen joschahenningsen commented Nov 22, 2025

Tested locally like this:

go run cmd/voice-service/main.go -auth-token abc &

✗ grpcurl -plaintext \
  -d '{"language": "en", "stream_id":1, "source":"https://example.com"}' \
  -import-path ./protobufs -proto subtitles.proto \
  localhost:50051 live.voice.v1.SubtitleGenerator.Generate
ERROR:
  Code: Unauthenticated
  Message: auth token is not provided

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds authentication token support to the voice service gRPC server and client. The token is configured via a command-line flag and used to authenticate both incoming and outgoing gRPC requests.

  • Adds an authToken field to the App struct and updates the constructor to accept it
  • Implements a gRPC unary interceptor to validate incoming requests against the configured token
  • Appends the auth token to outgoing gRPC metadata when calling the subtitle receiver

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.

File Description
pkg/voiceservice/voiceservice.go Adds auth token field, implements authentication interceptor, and attaches token to outgoing requests
cmd/voice-service/main.go Adds auth-token command-line flag and passes it to the voiceservice constructor

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@joschahenningsen joschahenningsen merged commit 27f5fd1 into main Nov 22, 2025
2 checks passed
@joschahenningsen joschahenningsen deleted the feat/auth branch November 22, 2025 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants