SonarQube Api Hostspot - sonarqube

I am trying to make a rest call to the Sonarqube API and can't seem to be able to grab the hotspots. Below is the url I am trying to call:
baseURL/measures/component?metricKeys=hotspot&component=projectKey
Documentation says you are required to only pass hotspot parameter.

Related

Unable to perform browser authentication in 3DSecure Flow

We are using Global Payments Java SDK to implement 3DSecure. Our web application first calls check-version API on the backend. And our backend use checkEnrollment function of Secure3dService class in Java SDK to check the status of the card. If the card is enrolled, our backend sends the server transaction id (received from Global Payments) back to our web client.
Now, in the second step, our web client gathers all the customer/browser information and calls authentication API on the backend. The backend passes all the mandatory information to initiateAuthentication method of Secure3dService in Java SDK. But the SDK throws 400 error.
We are not able to figure out why we are getting 400 error back.
#update
If we call the checkEnrollment method of Java SDK just before calling initiateAuthentication method of Java SDK, everything works and we get back a successful response with the same request. But we do not want to do that. Because we want to use the old server transaction id for all the subsequent calls instead of generating a new one.
What is the fix of this issue?

recaptcha v2 -> enterprise server side verification equivalent?

I'm trying to convert a v2 recaptcha flow to use the enterprise version. What is the equivalent to the server side call to https://www.google.com/recaptcha/api/siteverify?
If I try to send the same or similar POST request to https://recaptchaenterprise.googleapis.com or https://recaptchaenterprise.googleapis.com/<project path>, I get a 404 back.
There does not appear to be a matching v1 or v1beta1 endpoint for siteverify -- at least not that I've found in any of the docs or in the official recaptcha node.js library. What am I missing here?
There is no direct equivalent to the previously recommended verification call in the enterprise version (the call to https://www.google.com/recaptcha/api/siteverify).
If you want to mimic this server side verification flow, you must create a new assessment for the checkbox token and make a judgement based on that score yourself.
Probably you have found a solution by now. But for those still looking
if you configure your request like this you'll get what you want:
https://www.google.com/recaptcha/api/siteverify?secret=${recaptchaSecretKey}&response=${recaptchaToken};
where secret is 'The shared key between your site and reCAPTCHA.'
And response is 'The user response token provided by the reCAPTCHA client-side integration on your site.'.

Update domain url in laravel paginate api response

I am working in Microservices architecture.
I need your guidance in my implementation that I am working correctly or not.
I and internal service [Property] which calls from API Gateway.
In Property service I am sending responses using API resources with paginate, now the issue is my property service returns its internal URL within paginate. How can I change this custom domain URL from property to API gateway?
Or if I am doing something wrong please guide me about that. How can I use/implement paginate in internal services with next page click and search features?
I want to update the domain URL in the above image.
Thanks
Laravel has withPath method for pagination since version 5.4.
You can set relative path or absolute url with this method.
I suggest you can send request with pagination base path and dynamically set inside microservice.

How to include Marklogic rest-api in custom rewriter code in Xquery?

I'm new to url rewriting process in Marklogic and need help to resolve the below issue.
I have written Xquery implementation to redirect my API endpoints to the respective Xquery modules as /rewriter-ex/rewriter.xqy.
xquery version "1.0-ml";
let $url := xdmp:get-request-url()
return if(fn:matches($url,"/fetchRecord")) then
fn:replace($url,"/fetchRecord","/lib/fetch-record.xqy$1")
else if(fn:matches($url,"/saveRecord")) then
fn:replace($url,"/saveRecord$","/lib/save-record.xqy")
else (xdmp:set-response-code(404, "Not found"),"/no/such/resource")
And the url-rewriter path in the App server configuration is set to /rewriter-ex/rewriter.xqy and rewrite resolves globally parameter is set to true in App server.
I'm able to redirect my API urls to the respective endpoints.But I'm not able to use predefined ML Res-API endpoints like /v1/documents,it is showing 404 error as returned in the rewriter.xqy.
Is there a way I can implement rewriter to support both rest api endpoints as well as custom API endpoints?
If you'd like to create your own RESTful API on top of MarkLogic, with your own custom end-points. Please check out XQuery API for RESTful Services (XQRS).
declare
%rest:path("/fetchRecord/{$record-id}")
%rest:GET
function fetch-record($record-id as xs:string) {
fn:doc($record-id)
};
declare
%rest:path("/saveRecord/{$record-id}")
%rest:PUT("{$doc}")
%xdmp:update
function put-record($record-id as xs:string, $doc as document-node(element())) {
xdmp:document-insert($record-id, $doc)
};
Your RESTXQ Modules can sit on their own separate HTTP App Server (on their own port) and live side by side with another HTTP App Server which has the default MarkLogic REST API on it.
XQRS is totally compatible with the rest of MarkLogic's software, including Data Hub Framework, they can party together.
The REST API doesn't support customization or replacement of the default declarative rewriter configured during initialization of a REST API server. In addition, the REST API doesn't provide an XQuery API interface to the functionality of the REST API endpoints.
Instead, the recommended approach is to extend the REST API through one of the following alternatives:
Providing an endpoint module in the modules database and specifying the actual path of the module in the modules database on a request to the REST API server to invoke the endpoint without rewriting as in http://myhost:8010/the/directory/path/to/my/module.xqy
Such endpoints can be Data Service endpoints. See https://docs.marklogic.com/guide/java/DataServices
Using the /v1/invoke endpoint to invoke a main module. See https://docs.marklogic.com/guide/rest-dev/extensions#id_72813
Using a Resource Service Extension. See https://docs.marklogic.com/guide/rest-dev/extensions#id_41710
Hoping that helps,
Thanks for your answers.I'm planning to use two app servers one for rest calls and other for API calls.These two app servers will point to the same DB.Please let me know if this is a right approach.

Difference between parse.com cloud code and rest api

I am interested in using parse and am a little confused as to the difference between their products.
I am looking to run server code on the platform and I can see that there is a cloud code option as well as a REST api option.
What is the difference between the two? For me it it seems as though they are the same in the sense that they both run server code
Cloud Code allows you to define JavaScript functions that run server-side.
These methods are exposed to the REST interface, so your confusion is valid, but you only put/request information via REST, not perform logic.
So say you defined a Cloud Code method to run before you saved a Parse Object. When you make a PUT request through REST with your object body, that Cloud Code method will run.

Resources