<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Daniel Castillo on Medium]]></title>
        <description><![CDATA[Stories by Daniel Castillo on Medium]]></description>
        <link>https://medium.com/@mrpato?source=rss-ab0601f38335------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*thfqy6Z8KRr-E56ACSUKsA.jpeg</url>
            <title>Stories by Daniel Castillo on Medium</title>
            <link>https://medium.com/@mrpato?source=rss-ab0601f38335------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 10:47:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mrpato/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Micronaut + security: How?]]></title>
            <link>https://medium.com/@mrpato/micronaut-security-how-bc214932fe60?source=rss-ab0601f38335------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc214932fe60</guid>
            <category><![CDATA[micronaut]]></category>
            <category><![CDATA[jwt-token]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Daniel Castillo]]></dc:creator>
            <pubDate>Mon, 18 Feb 2019 00:09:42 GMT</pubDate>
            <atom:updated>2020-04-20T18:59:38.377Z</atom:updated>
            <content:encoded><![CDATA[<p>Currently I’m working a lot with <a href="https://micronaut.io/">Micronaut</a>, making some freelance projects and some personal apps. All that work got me into questioning <em>What do I need to secure an api with Micronaut?</em></p><h4>But first, <em>What is Micronaut?</em></h4><p>Micronaut is a JVM based polyglot framework created by the good guys and creators of the magnificent <a href="https://grails.org/">Grails Framework</a> designed to build light applications, also focused on modularity and minimal memory footprint apps with non-blocking requests built over Netty and some cool other things like service discovery, reactive streams and circuit breaker pattern.</p><p>If you want to go deep into knowing what is and how Micronaut works I recommend this <a href="https://hackernoon.com/what-is-micronaut-37a6565f217d">post</a>.</p><h4>What do I need to secure an application built with Micronaut?</h4><p>Let’s think first which are the steps to follow in securing an application:</p><ol><li>Choose which authentication process I want to use</li><li>Decide how my application will handle authorization</li><li>Select the more suitable library</li></ol><p>For this example we are going to use <a href="https://jwt.io/">JWT</a>. First we have to create our project, for that we can use the cli tool that Micronaut provides or use gradle:</p><pre># mn create-app com.mrpato.examples.micronaut-jwt</pre><p>This will create all the necessary files and directories for our application:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1KgBqij4ZoCNVe9KvT1BZw.png" /></figure><p>Next, add the necessary dependencies in the <em>build.gradle </em>created<em>:</em></p><pre>compile &quot;io.micronaut:micronaut-security-jwt&quot;</pre><p>To compile the application will need to execute the following command:</p><pre># gradle compileJava</pre><p>This will download the dependencies and add it into the gradle repository.</p><h4>Authentication Provider</h4><p>After the creation of our project is necessary to configure the Authentication provider that will handle all the permitted operations.</p><p>Accordingly to the KISS principle, we’re going to create a simple <em>user -password </em>authentication with a naive <em>AuthenticationProvider </em>that retrieves the information of the user to be authenticated from a db.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7faff5db0ab6ce874265b045457bb6b6/href">https://medium.com/media/7faff5db0ab6ce874265b045457bb6b6/href</a></iframe><p>As can be seen the authentication process is really simple just takes the authentication request that contains the identity and the password to be used as credentials to authenticate a user and performs a simple search and comparison with the data saved in a db.</p><p>To test all this is needed to make a POST request to <em>login</em> endpoint.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OQAj4aQNvH8C4Zd6687L2A.png" /></figure><p>This will return an object with the information to handle the authorization, I mean the response includes that access key to let the user perform any action has permission on.</p><p>And with that access token can be performed any request is needed and the library added going to handle the check and authorize the execution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*80Z04nFSdQTgnaC3jyhW1Q.png" /></figure><p>The access token should be sent as a header.</p><p>And that’s it, as simple as this how to add security with micronaut. Hope this is worthy.</p><p>The code is hosted in <a href="https://github.com/mrduckieduck/micronaut-jwt">https://github.com/mrduckieduck/micronaut-jwt</a></p><p>Happy Coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc214932fe60" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Two months at Globant: I love the fruit bowls and the hammocks]]></title>
            <link>https://medium.com/@mrpato/two-months-at-globant-i-love-the-fruit-bowls-and-the-hammocks-7865d36b19e5?source=rss-ab0601f38335------2</link>
            <guid isPermaLink="false">https://medium.com/p/7865d36b19e5</guid>
            <category><![CDATA[work-smarter]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[globant]]></category>
            <category><![CDATA[work]]></category>
            <category><![CDATA[workplace]]></category>
            <dc:creator><![CDATA[Daniel Castillo]]></dc:creator>
            <pubDate>Fri, 24 Nov 2017 21:29:16 GMT</pubDate>
            <atom:updated>2018-02-27T05:43:07.046Z</atom:updated>
            <content:encoded><![CDATA[<p>Today (November, 24th) I am a little bored, that’s why I decided to write something about me and my experience in my new work in a company with a different overview than the other companies I used to worked for.</p><p>Be a <em>glober</em> it has been a nice experience… I’m currently a Java developer (my official position in the company is Software Designer, something like an architect) for Disney’s account.</p><p>But, what do i like about being a <em>glober</em>? Well that’s an easy question: I love the work philosophy, yes the way the company treats his workers, obviously there are many companies with the same or a better work environment, but I believe Globant is making the things the right way.</p><p>What I meant by saying “the right way”? There’s 4 simple things I need to have in a company to feel myself free and be the most productive dev I can be:</p><h3><strong>Total ownership of my time: “I’ll start at dawn”</strong></h3><p>Feel free to plan my day, my lunch time, etc … In my last job, we had a blood sign work schedule, you know 9am to 6pm with an hour for lunch. There was no time to do other stuff to improve my knowledge or just to read. At the new company I’m the owner of my time.</p><p>I can’t spent all my time to be in a office, everybody needs balance … the right balance between social life, family and work, Globant gives mes the possibility to control my time.</p><h3><strong>No restricted network: “Vive la revolution!”</strong></h3><p>Yes, I know there’s a lot of problems with filtering classified information, but come on we’re developers we need to be able to open StackOverFlow, Medium, some Wordpress blogs, github, gitlab, techranch, etc… any kind of source that can help us to solve the problems we’re working on, to look for new technologies and ideas. I really believe we need to TRUST in the person, in any individual human being … A restricted environment leads to anarchy, a “restrictions controlled” environment leads to loyalty.</p><blockquote>A person with something to lose never will try to go against the system, someone without something to lose can create a revolution</blockquote><p>The network in the office has a few restrictions, like github (when I realized was restricted I laugh … but with the clients vpn I have full access) but is nice to have freedom.</p><h3><strong>The workspace: “Nap time in the hammocks”</strong></h3><p>I’m a person with OCD and some times is really hard to work inside an office, for example I hate to work in totally closed rooms, the classic office without windows and the air conditioning switch on all day. I need to feel comfortable in my workplace, have places to chill, to reboot, to clean my brain when I’m stuck in a problem… A workspace with color is nicer then the classic blue and gray.</p><p>Hammocks, a pretty green and gray combination, a lot of windows and an INCREDIBLE VIEW!</p><h3><strong>The challenge: “Bring it on!”</strong></h3><p>If the project isn’t challenging, I get bored… If I get bored I’ll leave the company, easy as that!</p><p>Somebody could say my reasons aren’t enough … for me they are. There are some other (not so childish) reasons, for example:</p><ul><li>A good salary</li><li>The company hears their workers</li><li>Social conscience</li><li>Good challenges in projects for big companies like Disney, Swiss Bank, Google, EA Sports, etc.</li><li>Tech events</li><li>The possibility to change your residence.</li></ul><p>And some others and those are the main reasons why I accept a job at Globant, I’m happy and I think I can stay here for a long time.</p><p>Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7865d36b19e5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React-Native: A hell for mobile apps !!!! (or not)]]></title>
            <link>https://medium.com/@mrpato/react-native-a-hell-for-mobile-apps-or-not-443ca6502b47?source=rss-ab0601f38335------2</link>
            <guid isPermaLink="false">https://medium.com/p/443ca6502b47</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[Daniel Castillo]]></dc:creator>
            <pubDate>Fri, 17 Mar 2017 21:31:24 GMT</pubDate>
            <atom:updated>2017-11-24T23:10:45.659Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f2_jkNeRE0YBJ2v9L8HLCw.jpeg" /></figure><p>Seven months ago I adopted a dog, I named her “Caramelo”, last week she was sick and finding a doctor at 2:00 am it was heroic! that’s why I decided to develop a doctor’s catalog</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D97baa8AvPkDzm9yyVqPDA.jpeg" /><figcaption>Caramelo a.k.a. “La gorda”</figcaption></figure><p>So, as an Angular lover, I decided to go crazy and start my app in ReactNative, I thought: “Is JS, Can’t be that hard, yeah?” BUT I WAS SO WRONG !!! React is not easy, it’s not difficult to understand and write but, If you aren’t familiarised with ES5/6, unidirectional data flow and Components, well you’ll have a bad time.</p><p>As a front-end developer, I’m familiar with those concepts, in fact for me it was easier to move from AngularJS to Angular 2 (why google ? WHY CALL ANGULAR SOMETHING THAT ISN’T THE F****G SAME AS THE PREVIOUS FRAMEWORK?), but working in React is making me crazy !</p><p>So I decided to start this post to explain the architecture.</p><p>First of all you have to understand what is React and what is ReactNative, well React is a library that Facebook’s nerds develop to make their front-end job easier. They have to struggle with millions of requests and those requests has to be responded, so they created React to increase the performance, to made a easier way to develop their components.</p><p>React Native was born as set of libraries <em>ready to use</em>, to make easier the mobile struggle, if you had experienced the native development problem, you would love (or hate) ReactNative. As a mobile developer you have to struggle with 2 different teams, 2 different technologies and If you develop for android thousands of different hardwares.</p><p>So, ReactNative is thought to increase productivity and homogenise technologies, you’ll need just learn React to develop the same app for IOS and Android, but also you have all the benefits to develop in native with Swift or the android development kit.</p><p>I always say that the best way to start with a framework, language or a library is:</p><ol><li>Learning from the source and the architecture</li><li>Create a simple but saleable idea</li></ol><p>Following those ideas, I present to you the React Native architecture:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f2_jkNeRE0YBJ2v9L8HLCw.jpeg" /><figcaption>React native app architecture (sorry for the ugly draw)</figcaption></figure><p>One particularity of ReactNative is the use of the Javascript core, as we know some frameworks as PhoneGap and Cordova maps the components written in Javascript and HTML to web views and display all the functionality as a simple (or complex) web application. But ReactNative doesn’t do that, it make the things a little bit different. Explaining this point a little, ReactNative take all the JSX components and execute it in the Javascript engine of the mobile, for example in IOS uses the JavaScriptCore, the engine of Safari Browser, but the enhancement is the threads, React executes all the components in a single and separate thread to make it faster and smoother (check out also NativeScript and Appcelerator Titanium)</p><p>At this point the only benefit of using React Native is in fact React (you can implement the Redux approach) and how he executes the code to make our app smoother and faster. But, that’s all? the answer is: NO !</p><p>React Native also has an incredible advantage, a bridge to the native library, and you can ask, What is this tinny thing called “React native bridge”? Well, the ReactNative Bridge (is not the official name, but for me is easier to explain it as it) is the connection between the ReactNative library and JSX Components (the components you write) and the native libraries, is the thing that’s make ReactNative a powerful set of tools. And how this will help me ? It’s so helpful, because if you need to control an event and the only way to control it is trough the native libraries, for example you need to display some messages to the user, you can use the bridge to communicate with your React.Component. Check out the docs example:</p><p><a href="http://facebook.github.io/react-native/releases/0.18/docs/native-modules-android.html">Native Modules - React Native | A framework for building native apps using React</a></p><p>So, explaining the process we can say that:</p><ol><li>React Native takes all your JSX components and compiles it.</li><li>Compile all the native modules (Swift or Java) and …</li><li>With the JSX components and the compiled native code, create the ready to install package (apk or ipa)</li></ol><p>At the end we obtain a native apk or ipa and not only a transformed package like when we work with PhoneGap!</p><p>Please visit my github repo to view an example and HAPPY CODING !!!</p><p>Ps. I love React Native !!! Comment and help to improve my writing ! :D</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=443ca6502b47" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Who am i?]]></title>
            <link>https://medium.com/@mrpato/who-am-i-d6d5fba0a888?source=rss-ab0601f38335------2</link>
            <guid isPermaLink="false">https://medium.com/p/d6d5fba0a888</guid>
            <category><![CDATA[dogs]]></category>
            <category><![CDATA[love]]></category>
            <dc:creator><![CDATA[Daniel Castillo]]></dc:creator>
            <pubDate>Fri, 17 Mar 2017 18:53:43 GMT</pubDate>
            <atom:updated>2017-03-17T21:38:36.447Z</atom:updated>
            <content:encoded><![CDATA[<p>Who am I? Well, I’d love to introduce myself to this new community.</p><p>I’m Daniel, a Mexican engineer, java developer, go lover and Angular psycho … I really enjoy reading novels, biking and cooking. I’m a dog lover.</p><p>I have a beautiful dog named “Caramelo”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IS3W8_tvBxsfuQIZKD-DVA.jpeg" /><figcaption>Caramelo a.k.a. “La Gorda”</figcaption></figure><p>I use to have a blog about life, cooking, book’s recommendations, but I never wrote about technology, so I decided to start here.</p><p>PEACE !!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d6d5fba0a888" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>