Comments (5)
Hello, thanks for taking the time to respond!
I was just putting together a code example. In doing so, I discovered that the minimal example worked just fine in my script, but not in my PHP app. On further investigation I realised that this is because in my app the global error handler rethrows errors as exceptions.
The suggestion to use user_info.account_id
is not possible - that logic is happening within the Google Cloud PHP code. Surely the Google Cloud PHP codebase should be updated so that this error is not raised in the first place?
Here's a minimal example (credentials and tokens omitted for obvious reasons):
declare(strict_types=1);
error_reporting(E_ALL);
require '../vendor/autoload.php';
use Google\Cloud\RecaptchaEnterprise\V1\RecaptchaEnterpriseServiceClient;
use Google\Cloud\RecaptchaEnterprise\V1\Event;
use Google\Cloud\RecaptchaEnterprise\V1\Assessment;
use Google\Cloud\RecaptchaEnterprise\V1\TokenProperties\InvalidReason;
define('GOOGLE_APPLICATION_CREDENTIALS', 'PATH_HERE');
define('GOOGLE_CLOUD_PROJECT_ID', 'ID_HERE');
define('RECAPTCHA_SITE_KEY', KEY_HERE');
$token = 'TOKEN_HERE';
set_error_handler(function ($level, $message, $file = '', $line = 0) {
throw new ErrorException($message, 0, $level, $file, $line);
});
recaptchaCreateAssessment($token);
function recaptchaCreateAssessment($token) {
putenv('GOOGLE_APPLICATION_CREDENTIALS=' . GOOGLE_APPLICATION_CREDENTIALS);
$client = new RecaptchaEnterpriseServiceClient();
$projectName = $client->projectName(GOOGLE_CLOUD_PROJECT_ID);
$event = (new Event())->setSiteKey(RECAPTCHA_SITE_KEY)->setToken($token);
$assessment = (new Assessment())->setEvent($event);
$response = $client->createAssessment($projectName,$assessment);
// This gives the 'hashed_account_id is deprecated' error.
}
from google-cloud-php.
I believe this is the same issue as we've documented in protocolbuffers/protobuf#13428
I will try to fix this shortly
from google-cloud-php.
Hello @ntward! Thanks for the comment.
Do you have a link to the specific docs you are referring to? As well as a code example to help you debug?
It does seem like the field you're trying to use is in fact deprecated. The link you shared to Stack Overflow links to the proto file:
https://github.com/googleapis/googleapis/blob/9c2348d2aa60700c15899c93e3b9615ab6ce1fcf/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto#L698C16-L698C63
It gives the recommendation to use user_info.account_id
instead.
from google-cloud-php.
Thanks for the update @bshaffer !
from google-cloud-php.
This has been fixed in the main
branch of protobuf, and will be fixed in the next protobuf release (protocolbuffers/protobuf@6d84da5)
from google-cloud-php.
Related Issues (20)
- Doesn't return all rows, only the first "package" HOT 6
- Uploading a stream resource's contents to a bucket results in the resource being closed HOT 2
- API key HOT 1
- Storage: Add HNS folders samples
- feat(dev): add filter and sort to component-info command HOT 1
- storage: Samples for Managed Folders
- docs: investigate failing references
- Dev unittests are failing HOT 1
- add rowFilter => filter to bigtable MIGRATING.md for v2 HOT 1
- Add bigtable-attempt to request metadata when the RPC is a retry attempt HOT 2
- docs: Add a DEBUG.md
- PHP - Retry conformance in Google\Cloud\Storage\StorageClient breaks streaming large files using registerStreamWrapper HOT 5
- Hi. How do I use gemini in this package? HOT 1
- There seems some problems setting values for the Part when call PredictionServiceClient->generateContent HOT 1
- DEPRECATED warnings when calling getName() on a Secret or SecretVersion HOT 2
- `google/common-protos` split based on older version HOT 1
- [BigQuery] Implement Short query optimized mode
- Support google/protobuf 4 in googleapis/common-protos-php HOT 3
- Problem with createDataset
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from google-cloud-php.