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

"unauthorized: master key is required" error on aggregate ParseQuery despite the master key is set

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

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
php
Lĩnh vực
api, databases

Hướng nghiên cứu

Start at the ParseQuery::aggregate entry point and trace how the configured master key is passed for aggregate requests. Compare that path with the other ParseQuery methods and reproduce the report using the supplied PHP 7.2, SDK 1.5.1, and pipeline example. Done means the aggregate request's authorization behavior is understood and covered by a regression test.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Issue Description

I get "unauthorized: master key is required" error when I try to do aggregate ParseQuery as below.

ParseClient::initialize('appId', null, 'masterKey');
ParseClient::setServerURL('https://example.com', 'mountPath');

$pipeline = [
    'group' => [
        'userAttached' => $userId,
        'total' => [ '$sum' => 1]
    ]
];

$query = new ParseQuery("Financials");
$query->equalTo("company_id", $companyId);
$query->equalTo("type", "income");

try {
    $resultSum = $query->aggregate($pipeline);
    print_r($resultSum);
} catch (ParseException $ex) {
    echo $ex->getMessage();
}

As you can see master key is already set, can't find what may be the issue.

Environment Details
  • Your PHP Version: 7.2.24-0ubuntu0.18.04.6
  • Your Parse PHP SDK Version: 1.5.1
  • Your Operating System: Ubuntu 18.04.2 LTS
Ngôn ngữ chính
PHP
Star
808
Fork
341
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

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 parse-community/parse-php-sdk

Tất cả issue của parse-community/parse-php-sdk

Issue tương tự

Thêm issue về PHP

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.