Skip to content

Some service account params no required since 7.21Β #1016

@pyrech

Description

@pyrech

Describe the bug

Hello. First, thanks for this much useful library ✨

However, I'm facing an issue regarding how service account is now handled in 7.21 (since #1009). Previously, I only passed the following config entries to the Factory:

    client_email: <redacted>
    client_id: <redacted>
    project_id: <redacted>
    type: service_account
    private_key: <redacted>

When updating to v7.21, it now complains about missing params:

Could not map type `Kreait\Firebase\ServiceAccount`:
- `privateKeyId`: Cannot be empty and must be filled with a value matching type `non-empty-string`.
- `authUri`: Cannot be empty and must be filled with a value matching type `non-empty-string`.
- `tokenUri`: Cannot be empty and must be filled with a value matching type `non-empty-string`.
- `authProviderX509CertUrl`: Cannot be empty and must be filled with a value matching type `non-empty-string`.
- `clientX509CertUrl`: Cannot be empty and must be filled with a value matching type `non-empty-string`.

Did I miss something or is it a BC-break in the 7.21 minor release?

Thanks :)

Installed packages

kreait/firebase-php                      7.21.1            Firebase Admin SDK
kreait/firebase-tokens                   5.2.1             A library to work with Firebase tokens

PHP version and extensions

8.3.24

Steps to reproduce the issue.

use Kreait\Firebase\Contract\Messaging;
use Kreait\Firebase\Factory;

    function create(array $accountData): Messaging
    {
        return (new Factory())
            ->withServiceAccount([
                'client_email' => '<redacted>',
                'client_id' =>  '<redacted>',
                'project_id' => '<redacted>',
                'type' => 'service_account',
                'private_key' => '<redacted>',
            ])
            ->createMessaging()
        ;
    }

Error message/Stack trace

The controller for URI "/mon-espace-client" is not callable: Could not map type `Kreait\Firebase\ServiceAccount`:
- `privateKeyId`: Cannot be empty and must be filled with a value matching type `non-empty-string`.
- `authUri`: Cannot be empty and must be filled with a value matching type `non-empty-string`.
- `tokenUri`: Cannot be empty and must be filled with a value matching type `non-empty-string`.
- `authProviderX509CertUrl`: Cannot be empty and must be filled with a value matching type `non-empty-string`.
- `clientX509CertUrl`: Cannot be empty and must be filled with a value matching type `non-empty-string`.

Additional information

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions