feat(iios-kernel-client): RestClient custom headers passthrough → 0.1.3
Adds optional RestConfig.headers, merged into every request, so a server-side caller (be-crm's glue) can carry X-Context-Attestation (the July 12 proof #3) alongside the bearer token. Backward compatible. Published 0.1.3. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,8 @@ import type { Message, InboxItem, InboxState, Ticket, TicketState, CallbackReque
|
||||
export interface RestConfig {
|
||||
serviceUrl: string;
|
||||
token?: string;
|
||||
/** Extra headers sent on every request — e.g. `x-context-attestation` (the July 12 trust proof). */
|
||||
headers?: Record<string, string>;
|
||||
}
|
||||
|
||||
/** REST/polling client for kernel reads and the native-send fallback. */
|
||||
@@ -15,7 +17,7 @@ export class RestClient {
|
||||
}
|
||||
|
||||
private headers(extra: Record<string, string> = {}): Record<string, string> {
|
||||
const h: Record<string, string> = { 'content-type': 'application/json', ...extra };
|
||||
const h: Record<string, string> = { 'content-type': 'application/json', ...this.config.headers, ...extra };
|
||||
if (this.config.token) h.authorization = `Bearer ${this.config.token}`;
|
||||
return h;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user