Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

HttpAgent can not work when serviceAccountPathOrObject parameter is a object in admin.credential.cert()

Đang mở
#2,960 2 bình luận 1 reaction 1 người được giao Xem trên GitHub

@lahirumaramba đang làm issue này rồi.

Từ ngày 4/11/2025.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

api: core
Problem

When calling admin.credential.cert(), and the serviceAccountPathOrObject parameter is a object, not a file path, the http proxy agent can not work.

Environment
  • Operating System version: Red Hat Enterprice Linux 8.10
  • Firebase SDK version: 13.4.0
  • Firebase Product: message
  • Node.js version: 22.11.0
  • NPM version: 10.9.0
Steps to reproduce:
#### Relevant Code:

import * as admin from "firebase-admin";
import {readFilesync }from "fs";
import * as https from "https",

const serviceAccount = JSON.parse(readFilesync("./serviceAccount.json", "utf8"))
const proxyAgent = new https.Agent({
  host:"xxx",
  port: 8080,
  keepAlive: true,
  rejectUnauthorized: false,
});
const client= admin.initializeApp({
  credential:admin.credential.cert(
    {
      clientEmail: serviceAccount.client_email,
      privatekey: serviceAccount.private_key,
      projectId: serviceAccount.project_id,
    },// when serviceAccount is a object, it will raise the "app/invalid-credential" error
    // "./serviceAccount.json", when serviceAccount is a file path, can work
    proxyAgent
  ),
  httpAgent: proxyAgent, 
});
Ngôn ngữ chính
TypeScript
Star
1.7k
Fork
419
Merge trung bình
4 ngày 20 giờ
Pull request đã merge (30 ngày)
16

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của firebase/firebase-admin-node

Tất cả issue của firebase/firebase-admin-node

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.