Skip to content

Instantly share code, notes, and snippets.

View jeanouii's full-sized avatar

Jean-Louis Monteiro jeanouii

  • Tomitribe
  • France
View GitHub Profile
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<items>
<paging>
<limit>3</limit>
<offset>0</offset>
<returned>3</returned>
<total>100</total>
</paging>
<item>
<deliveredFrozen>false</deliveredFrozen>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<items>
<paging>
<limit>3</limit>
<offset>0</offset>
<returned>3</returned>
<total>100</total>
</paging>
<items xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="availability-item">
<deliveredFrozen>false</deliveredFrozen>
{
"itemNumber": 11026777,
"uoms": [
{
"itemNumber": 11026777,
"isOrderable": false,
"pluralName": "Eaches",
"code": "EA",
"quantity": "1.0000",
"upc": 762111963239,
@Override
public ItemCollection findAll(ItemCriteriaImpl criteria) {
final ItemCollection collection = new ItemCollection();
final Query query = entityManager.createNativeQuery("CALL api_get_location_item_availability_v1_0(?, ?, ?, ?, ?, ?, ?)", ItemDto.class)
.setParameter(1, criteria.getLocationNumber())
.setParameter(2, criteria.getBusinessDate())
.setParameter(3, criteria.getDepartmentNumber())
.setParameter(4, "ENG")
@GET
@Path("/users/{username}")
@Description("Return the user with the specified user name, if any;" +
" otherwise return <code>null</code>.")
public UserInfo findUser(
@PathParam("username") @Required
@Description("Name of the user to return")
final String username) {
...
10.6.36.181 - s-rwad [12/Mar/2015:08:56:27 0700] "POST /products/availability/stores/441/update" 412 1104 4ms http-nio-8443-exec-25 dc= sip=- aud=- env=pd rid=test-req-20150310-1 ver=1
enter secret key for s-rwad:gred-api-20150123:
* Adding handle: conn: 0x7faba1804000
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x7faba1804000) send_pipe: 1, recv_pipe: 0
* About to connect() to lx01004 port 8443 (#0)
* Trying 10.12.4.40...
* Connected to lx01004 (10.12.4.40) port 8443 (#0)
  1. Calculate the signature using the provided service for the current date
curl -i -X POST -H "Content-Type: application/json" http://ec2-54-165-89-69.compute-1.amazonaws.com:8080/tribestream-signatures-0.52-SNAPSHOT/api/signatures/  \
-d '{
  "algorithm":"hmac-sha256",
  "headers":{
    "date":"Sat, 14 Feb 2015 13:30:13 CET",
    "digest":"md5=XUFAKrxLKna5cZ2REBfFkg=="
  },
I've been working with Java EE for more than 10 years.
I have a long experience in security due to my background. Indeed, I worked 10 years in a big company, working on online transaction processing (banque, insurance, etc).
I've a pretty good knowledge on things like PKI, PCI (paiement), security API and framework (Spring security, Apache Shiro) as well as other specifications like OpenID, OAuth, to name a few.
Apache committer on the application server Apache TomEE, I've been involved in implementing security support (REST, SOAP).
public class DummyTest {
@Test
public void calcDigest() throws Exception {
final Signature signature = new Signature("kids", "hmac-sha256", null, "(request-target)", "date");
final SecretKey key = new SecretKeySpec("PennyLunaLuka".getBytes(), "HmacSHA256");
final Signer signer = new Signer(key, signature);
final String method = "GET";
final String uri = "/signature-prototype-1.0-SNAPSHOT/api/colors/preferred";
final Map<String, String> headers = new HashMap<>();
2014-12-18 - 17:51:43 - jlmonteiro@poulains-mac - (JAVA 1.7.0) / (MVN 3.2.1) [ ~/devs/tomitribe/tribestream/ ] $ while (true); do curl -i -u movie:admin -X GET http://ec2-54-174-171-171.compute-1.amazonaws.com/moviefun-rest/rest/movies
> done
HTTP/1.1 200 OK
Date: Thu, 18 Dec 2014 16:51:48 GMT
Server: Apache-Coyote/1.1
Content-Type: application/json
Content-Length: 12
Connection: close
{"movie":[]}HTTP/1.1 200 OK