func intercept()

in Sources/SparkConnect/BearerTokenInterceptor.swift [30:43]


  func intercept<Input: Sendable, Output: Sendable>(
    request: StreamingClientRequest<Input>,
    context: ClientContext,
    next: (
      _ request: StreamingClientRequest<Input>,
      _ context: ClientContext
    ) async throws -> StreamingClientResponse<Output>
  ) async throws -> StreamingClientResponse<Output> {
    var request = request
    request.metadata.addString("Bearer \(self.token)", forKey: "Authorization")

    // Forward the request to the next interceptor.
    return try await next(request, context)
  }