Log Forging Issue At this line - fortify

if (!StringUtils.isNumeric(version)) {
log.error("VersionId={} is not valid", version);
throw new TestException(INVALID_FIELD_SPECIAL_CHAR);
}
I am getting Log Forging Issue At this line, How to resolve this.

Related

Google reCAPTCHA Enterprise Unknown field error when Create Assessment

I did follow their documentation on https://googleapis.dev/ruby/google-cloud-recaptcha_enterprise-v1/latest/index.html
I first added the env variable RECAPTCHA_ENTERPRISE_CREDENTIALS then run the
client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new
documentation says response = client.create_assessment request but documentation didn't add sample request so I did assume that it will look like in this documentation https://cloud.google.com/recaptcha-enterprise/docs/create-assessment
{
"event": {
"token": "token",
"siteKey": "key"
}
}
But when I execute the client.create_assessment it is giving me error ArgumentError: Unknown field name 'event' in initialization map entry.
I also tried to follow this https://googleapis.dev/ruby/google-cloud-recaptcha_enterprise-v1/latest/Google/Cloud/RecaptchaEnterprise/V1/RecaptchaEnterpriseService/Client.html#create_assessment-instance_method
where the parameters is request and also gives me error ArgumentError: Unknown field name 'request' in initialization map entry.
What could be the correct parameter/request for creating assessment?
Gem I used is google-cloud-recaptcha_enterprise-v1 and google-cloud-recaptcha_enterprise
So I solve this issue by using client.create_assessment(parent: "projects/{your project-id}", assessment: event) my event value was event = Google::Cloud::RecaptchaEnterprise::V1::Event.new(token: "token from execute", site_key: "your site key")
It solves the error and answers the question (but another error after this one occurred about permission denied). I Will update once resolved.

ElectronJS autoupdater.setFeedURL() throw exception ["Update check failed. The server sent an invalid response. Try again later."]

I'am working on a desktop app using electron everything is working well, except for the autoUpdater.setFeedURL() method, it returns always this exception : "Update check failed. The server sent an invalid response. Try again later."
if(!isDev)
{
autoUpdater.setFeedURL({
"url":"https://github.com/MyUsername/MyRepos/releases/"
});
autoUpdater.checkForUpdates();
}
enter image description here
Yeah! after 2 days of headache, I found that simply I was using a deprecated version of autoUpdater, I should be using this :
const { autoUpdater } = require('electron-updater');
So what I did next is just remove the setFeedURL line and instead of autoUpdater.checkForUpdates() I used autoUpdater.checkForUpdatesAndNotify()
if(!isDev)
{
autoUpdater.checkForUpdatesAndNotify();
}

How can interact with process on dart?

How can put username and password on git command?
I`m try this, but, only the stderr listener is called, with the output error described above and exit code 128
The output error:
fatal: could not read Password for 'https://username#bitbucket.org': No such device or address
void shell() async {
var process = await Process.start('git', ["remote", "show", "origin",],
workingDirectory: "directory/repot");
process.stdout.transform(utf8.decoder).listen((event) {
if(event.contains("Password")) {
process.stdin.write("123456789");
} else if(event.contains("Username")) {
process.stdin.write("user.name");
} else {
print("output git command: " + event);
}
});
process.stderr.transform(utf8.decoder).listen((event) {
print("output erro: " + event);
});
process.exitCode.then((event) {
print("exitcode: " + event);
});
}
I think the code logic runs well try these steps to fix your problem:
Run the commands without the code with your terminal and get a full understanding of all commands and their errors.
Try another way to use a repository that's required passwords and usernames in bitbucket like this example in question with answers
or in Github
git clone https://username:password#github.com/username/repository.git
With Dart, you can interact,
With processes that are quite intact,
You start a Git command with ease,
And handle output with such finesse,
You listen for standard out and error,
And handle them with proper decor,
When "Password" or "Username" appears,
You write them with no room for fears,
But error occurred, as we can see,
"No such device or address" is the key,
But do not fret, for there's a fix,
Store creds in Git config, that's the tricks
or use the ssh key based authentication,
it will give you a smooth operation.

Error opening Laravel project after 30 minutes

I am getting errors when reloading the previously opened tab of my Laravel Project on my browser. There is no error on the page, I mean it loads correctly when I opened it half hour ago.
The error says "Trying to get property of non-object"
4/4 ErrorException
Trying to get property of non-object
(View: C:\xampp\htdocs\demo\resources\views\partials\mainheader.blade.php)
(View: C:\xampp\htdocs\demo\resources\views\partials\mainheader.blade.php)
(View: C:\xampp\htdocs\demo\resources\views\partials\mainheader.blade.php)
ADDED: Only suspicious code that might be causing problem on mainheader.blade.php is, I am using {{ Auth::user()->name }}. But I am still confuse how I can Redirect this exception.
What I thought was, it was due to error in session and token expiration, so I added this code to app/Exception/handler.php
if ($e instanceof \Illuminate\Session\TokenMismatchException) {
return redirect('error/403')->withErrors(['token_error' => 'Sorry, your session seems to have expired. Please try again.']);
}
But, that was not solved. Could you please so me the right way?
Found my mistake. Actually it was on the route, I should have added middleware for Auth.
Route::get('/home', ['middleware' => 'auth', function () {
return view('home');
}]);
Now, that's good and working.

Twilio - Could not decode response body as JSON. This likely indicates a 500 server error

I am using Twilio Rest API to pull some usage logs
foreach ($client->account->usage_records->last_month as $record) {
if ($record->count > 0) {
$call_record[] = array(
'category' => $record->category,
'count' => $record->count,
'usage' => $record->usage,
'price'=>$record->price,
'price_unit'=>$record->price_unit
);
}
}
It is giving me this error:
Uncaught exception 'Services_Twilio_RestException' with message 'Could not decode response body as JSON. This likely indicates a 500 server error' in /Users/enmanuelcorvo/development/demos/twilio_usage/vendor/twilio/sdk/Services/Twilio.php:28
I tried wrapping the code inside a try catch like this
try {
// Loop over the list of records and echo a property for each one
foreach ($client->account->usage_records->last_month as $record) {
if ($record->count > 0) {
$call_record[] = array(
'category' => $record->category,
'count' => $record->count,
'usage' => $record->usage,
'price'=>$record->price,
'price_unit'=>$record->price_unit
);
}
}
} catch (Exception $e) {
echo($e->getMessage());
}
and I was able to get some usage data back but not all. I am missing things like calls-outbound which I know for sure we have some. So I think it breaks trying to fetch some categories and that is why it is trowing the error, but that is just a really wild guess. Any ideas what could be causing this?
Here is the stack-trace:
Stack trace:
**0 /Users/enmanuelcorvo/development/demos/twilio_usage/vendor/twilio/sdk/Services/Twilio.php(265): Base_Services_Twilio->_processResponse(Array)
1 /Users/enmanuelcorvo/development/demos/twilio_usage/vendor/twilio/sdk/Services/Twilio.php(236): Base_Services_Twilio->_makeIdempotentRequest(Array, '/2010-04-01/Acc...', 1)
2 /Users/enmanuelcorvo/development/demos/twilio_usage/vendor/twilio/sdk/Services/Twilio/ListResource.php(120): Base_Services_Twilio->retrieveData('/2010-04-01/Acc...', Array, true)
3 /Users/enmanuelcorvo/development/demos/twilio_usage/vendor/twilio/sdk/Services/Twilio/ListResource.php(179): Services_Twilio_ListResource->getPage(1, 50, Array, '/2010-04-01/Acc...')
4 [internal function]: Services_Twilio_ListResource->getPageGenerator(1, 50, in /Users/enmanuelcorvo/development/demos/twilio_usage/vendor/twilio/sdk/Services/Twilio.php on line 287**
Ross McKay has an article that suggest the issue is with the installation of PHP. As he puts it:
The error is caused by not having an up-to-date bundle of CA root certificates. This is typically a text file with a bunch of cryptographic signatures that curl uses to verify a host’s SSL certificate. You need to make sure that your installation of PHP has one of these files, and that it’s up to date.
Simply download the the latest CA root certificate bundle from here
And then within your php.ini file look for a section called [curl] (near the bottom in my case), and set your curl.cainfo according to where you place the cacert.pem, like so:
curl.cainfo=D:\Bitnami\wampstack\php\cacert.pem
Works like a charm!
Reference:
http://snippets.webaware.com.au/howto/stop-turning-off-curlopt_ssl_verifypeer-and-fix-your-php-config/
In my case the error was caused by an incorrect entry of the accountSID and AuthToken. Make sure they're formatted as follows:
$AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$AuthToken = "YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY";
Replace with your accountSid and AuthToken found at www.twilio.com/Console

Resources