<?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 Mustafa Utku on Medium]]></title>
        <description><![CDATA[Stories by Mustafa Utku on Medium]]></description>
        <link>https://medium.com/@mustafautku_79071?source=rss-c95f9e4372f6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*3naoXrGAZ-o-_KvCgt0EyQ.png</url>
            <title>Stories by Mustafa Utku on Medium</title>
            <link>https://medium.com/@mustafautku_79071?source=rss-c95f9e4372f6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 02:34:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mustafautku_79071/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[How to Add a Google Sign-Up Button to Your Android React Native App]]></title>
            <link>https://medium.com/@mustafautku_79071/how-to-add-a-google-sign-up-button-to-your-android-react-native-app-c04b6bfe99d5?source=rss-c95f9e4372f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/c04b6bfe99d5</guid>
            <category><![CDATA[google-auth]]></category>
            <category><![CDATA[app-auth-google]]></category>
            <category><![CDATA[client-id-google]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Mustafa Utku]]></dc:creator>
            <pubDate>Sun, 23 Mar 2025 21:22:05 GMT</pubDate>
            <atom:updated>2025-03-24T02:07:25.874Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Three Google Button options recommended by Google" src="https://cdn-images-1.medium.com/max/960/1*c9hDwufKw6TQoGtly94KPQ.png" /><figcaption>Google Sign in Button options recommended by <a href="https://developers.google.com/identity/branding-guidelines">Google</a></figcaption></figure><p>This article is to help you configure Google Cloud Platform to enable authentication into your mobile app via the Google Sign in button.</p><h3>Prerequisites</h3><ul><li>React Application up and running</li><li><a href="https://cloud.google.com/">GCP Account</a> — and created project</li></ul><h3>Google Cloud Setup</h3><ul><li><strong>Select your project</strong></li><li><strong>Go to ‘APIs &amp; Services’</strong></li><li><strong>Click on Credentials</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zbtai3yUVC-TEEiFlYSs5Q.png" /><figcaption>View of the Credentials Page — The yellow banner is asking to Configure the consent screen</figcaption></figure><ul><li><strong>Configure consent screen</strong></li><li><strong>Click on ‘Clients’ <br></strong>- Create Client<br>- Select Web Application as your type</li><li><strong>Click create and copy the generated clientID</strong></li></ul><h3><strong>React Native</strong></h3><ul><li>Install the <a href="https://www.npmjs.com/package/@react-native-google-signin/google-signin">google sign in package</a></li></ul><pre>npm i @react-native-google-signin/google-signin</pre><ul><li>Add a button (use the<a href="https://developers.google.com/identity/branding-guidelines"> google developer guide</a> and use suggested visuals, below is just an example)</li></ul><pre>const image = require(&#39;../../assets/android_neutral_rd.png&#39;); // Path to Google Images<br>function GoogleButton(): React.JSX.Element {<br>    return (<br>        &lt;TouchableOpacity style={styles.container} onPress={() =&gt; googleSignIn()}&gt;<br>            &lt;Image source={image} style={styles.image}/&gt;<br>        &lt;/TouchableOpacity&gt;<br>    );<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/713/1*pEycYnShlHjDtOj6-XPsOQ.png" /><figcaption>Visual representation of the code on a Simulated Android Device</figcaption></figure><ul><li>Create the <em>onPress </em>function and configure GoogleSignin</li></ul><pre>let CLIENT_ID =<br>    &#39;&lt;CLIENT_ID_COPIED_FROM_GCP_SETUP&gt;&#39;;<br>GoogleSignin.configure({<br>    offlineAccess: true,<br><br>    webClientId: CLIENT_ID,<br><br>});<br>const googleSignIn = async () =&gt; {<br>    try {<br>        await GoogleSignin.hasPlayServices();<br>        const response = await GoogleSignin.signIn();<br>        if (isSuccessResponse(response)) {<br>            console.log(response)<br>            // get tokenId from response <br>            // and send a http request to your server to authenticate<br>        } else {<br>        }<br>    } catch (error) {<br>        if (isErrorWithCode(error)) {<br>            console.log(error)<br>            switch (error.code) {<br>                case statusCodes.IN_PROGRESS:<br>                    // operation (eg. sign in) already in progress<br>                    break;<br>                case statusCodes.PLAY_SERVICES_NOT_AVAILABLE:<br>                    // Android only, play services not available or outdated<br>                    break;<br>                default:<br>                // some other error happened<br>            }<br>        } else {<br>            // an error that&#39;s not related to google sign in occurred<br>        }<br>}</pre><ul><li>If successful you will see a console output similar to the example below</li></ul><pre>{<br>  &quot;type&quot;: &quot;success&quot;,<br>  &quot;data&quot;: {<br>    &quot;scopes&quot;: [<br>      &quot;https://www.googleapis.com/auth/userinfo.profile&quot;,<br>      &quot;https://www.googleapis.com/auth/userinfo.email&quot;,<br>      &quot;openid&quot;,<br>      &quot;profile&quot;,<br>      &quot;email&quot;<br>    ],<br>    &quot;serverAuthCode&quot;: &quot;123456&quot;,<br>    &quot;idToken&quot;: &quot;sendThisToServer&quot;,<br>    &quot;user&quot;: {<br>      &quot;photo&quot;: &quot;https://lh3.googleusercontent.com/pathToPhoto,<br>      &quot;givenName&quot;: &quot;A&quot;,<br>      &quot;familyName&quot;: &quot;B&quot;,<br>      &quot;email&quot;: &quot;emailOfUser@gmail.com&quot;,<br>      &quot;name&quot;: &quot;A name&quot;,<br>      &quot;id&quot;: &quot;1234&quot;<br>    }<br>  }<br>}</pre><p>Github Repo to configure your app and creating the Google Sign in Button:</p><p><a href="https://github.com/musutk/ReactNativeAndroidGoogleButton">GitHub - musutk/ReactNativeAndroidGoogleButton: React Native Google Button and Request for Android &amp; Java Backend to Verify token</a></p><h3><strong>Backend</strong></h3><p>Most likely you will have a backend service to handle state and store user information. The ‘<em>idToken’ </em>can be sent to your server to authenticate/login for your app and retrieve user information e.g. if the email associated with the google account is a free or subscribed user.</p><p>For the Backend Google has created a client API for all of the common backend languages <a href="https://developers.google.com/api-client-library">https://developers.google.com/api-client-library</a>.</p><p>Java Spring Controller example can be found here - A HTTP request will be made from the App to validate the user token:</p><p><a href="https://github.com/musutk/ReactNativeAndroidGoogleButton/blob/main/JavaGoogleSpringAuth/src/main/java/com/musutk/api/AuthController.java">https://medium.com/r/?url=https%3A%2F%2Fgithub.com%2Fmusutk%2FReactNativeAndroidGoogleButton%2Fblob%2Fmain%2FJavaGoogleSpringAuth%2Fsrc%2Fmain%2Fjava%2Fcom%2Fmusutk%2Fapi%2FAuthController.java</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c04b6bfe99d5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ToxiProxy — Testing automated chaos scenarios]]></title>
            <link>https://medium.com/@mustafautku_79071/toxiproxy-testing-automated-chaos-scenarios-d5d9a3f3083c?source=rss-c95f9e4372f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/d5d9a3f3083c</guid>
            <category><![CDATA[toxiproxy-java]]></category>
            <category><![CDATA[chaos-testing]]></category>
            <category><![CDATA[toxiproxy]]></category>
            <category><![CDATA[toxiproxy-metrics]]></category>
            <category><![CDATA[toxiproxy-docker]]></category>
            <dc:creator><![CDATA[Mustafa Utku]]></dc:creator>
            <pubDate>Sat, 05 Nov 2022 19:40:26 GMT</pubDate>
            <atom:updated>2023-10-04T20:13:36.076Z</atom:updated>
            <content:encoded><![CDATA[<h3>ToxiProxy — Testing automated chaos scenarios</h3><p>Have you ever wondered how your application reacts when there is a network failure? You may be thinking your application is safe and fault-tolerant, and so did Facebook before it infamously fell victim to that illusion affecting <a href="https://news.sky.com/story/whatsapp-facebook-and-instagram-down-for-tens-of-thousands-of-users-12426076">all <strong>3.5 billion </strong>users</a>.</p><p>So how can you ensure your application can handle such disruptions with grace? To minimize undesirable outcomes in adverse network conditions resiliency tests must be crafted to simulate such scenarios. To engineer such conditions in your dev and test environments, <strong>ToxiProxy</strong> is a market-leading tool, in the following sections, we will explore how this can be implemented.</p><p>Toxiproxy is a network simulation tool that allows the manipulation of a connection between two services. This enables testing the behavior of systems under chaotic situations such as network connection lag or outage.</p><p>For example, if a dependent microservice is down or slow, you might want to see how your application retries to connect or how timeouts are handled. Usually testing these scenarios require a lot of manual intervention and is done ad-hoc which is inconsistent with today’s CI/CD methodology. ToxiProxy allows testers to automate these scenarios on reducing risk with every build rather than sporadically.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/381/1*FH0--IEX2FS8PL69xSsVRg.jpeg" /><figcaption>Figure 1: Architecture of system with three dependent services</figcaption></figure><p>In the above image, the application under test has 3 services that it will depend upon. It could be other internal microservices, external services, or database connections. From a functional testing point the questions that should be asked are, “<strong><em>What happens if one or many of these systems are down? How does my application respond? How Resilient is my service</em></strong>”. To answer these questions toxiproxy is the perfect answer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/381/1*TbB1lzW77vvPjaxRfUE0Fw.jpeg" /><figcaption>Figure 2: Architecture of figure 1 with Toxiproxy server in between connections</figcaption></figure><p>In the development/testing environments, the URL’s of the connection will be changed to route through the toxiproxy server rather than the actual URL of the dependent service. Once the connection is flowing through the toxiproxy server, communication with the proxy server can be established via HTTP to exhibit certain behaviour on behalf of the actual services, so the actual service doesn&#39;t need to be taken down or manipulated in any way. If there is no command to manipulate the connection then the actual request will be proxied across to the desired dependency.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/1*yTMMEWaYKW3e4Yt3Yonlrg.jpeg" /><figcaption>Flows that can be implemented with Toxiproxy</figcaption></figure><p>The above image shows 3 ways to use Toxiproxy:</p><ol><li>This is the usual flow for happy path tests there are no toxics presents so everything will flow as expected.</li><li>The request has a toxic applied to it, it could be a timeout it could be a really slow connection, based on what kind of scenario is being tested the server could eventually receive the request and send back a response. This will show how your application handles error responses or timeouts.</li><li>The response has been poisoned on the way back from the server, the connection may be severed or the connection is being really slow. This will show any issues your application may have when waiting for the response.</li></ol><p>Now that we have covered some theory it&#39;s time to get technical, below you will find examples of how to set up toxiProxy locally using docker-compose.</p><pre>version: &#39;3&#39;<br>services:<br>  <strong>toxiproxy</strong>:<br>    image: &quot;ghcr.io/shopify/toxiproxy&quot;<br>    command:<br>      - -host=0.0.0.0<br>      - -proxy-metrics<br>    ports:<br>      - &quot;8474:8474&quot;<br>      - <strong>&quot;3306:3306&quot;</strong><br>  <strong>mysql</strong>:<br>    image: mysql:5.6<br>    ports:<br>      - <strong>&quot;3307:3306&quot;</strong><br>    environment:<br>      MYSQL_ROOT_PASSWORD: &#39;password&#39;<br>      MYSQL_DATABASE: &#39;crud-application&#39;<br>    volumes:<br>      - ./dump.sql:/docker-entrypoint-initdb.d/dump.sql</pre><p>The above shows the setup of toxiproxy and mysql, the ‘mysql’ image is on port localhost:3307, which will point to port 3306 inside the container.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*0VpbXlSFjTAtR67ngtThbQ.jpeg" /><figcaption>Image showing the difference in the connections between ToxiProxy and normal setup</figcaption></figure><p>Once you have run the above command the server will be running on localhost:8474, sending a GET request to ‘<strong>localhost:8474/proxies</strong>’ should result in an empty object as there are no proxies configured yet. To add a proxy to the mySql image send the <strong>POST </strong>request to:</p><blockquote><strong>localhost:8474/proxies</strong></blockquote><blockquote>{<br> &quot;name&quot;: &quot;mysql&quot;,<br> &quot;listen&quot;: &quot;[::]:3306&quot;,<br> &quot;upstream&quot;: &quot;mysql:3306&quot;,<br> &quot;enabled&quot;: <strong>true</strong>,<br> &quot;toxics&quot;: []<br>}</blockquote><p>At this stage you want to make sure that the toxiProxy container is running and you can send requests to add proxies.</p><p>The above request has 5 fields as defined <a href="https://github.com/Shopify/toxiproxy#proxy-fields">here</a>, but below is a quick summary.</p><ul><li><strong>Name </strong>is what you choose to give the proxy in this case I have chosen it as “mysql”.</li><li>The port that the toxiproxy will <strong>listen</strong> on is port 3306 (which is already defined as a port for the toxiproxy containers) — this is what your local application should point to when attempting to make database calls.</li><li>The <strong>upstream </strong>URL is the actual service where the original request will be forwarded to depending on how severe the toxics are. “mysql:3306” translates to port 3306 in the mysql container, which is the actual database URL.</li><li>The<strong> enabled</strong> flag is a switch to turn the proxy on/off — if “<strong><em>true</em></strong>”, the request will be proxied via toxiProxy, if “<strong><em>false</em></strong><em>” </em>the proxy connection will be severed resulting in a connection error (which can be used to mimic the service being down).</li><li>The <strong>toxics </strong>array will hold the list of toxics on the dependency, it&#39;s best to keep this empty so it can be manipulated dynamically. The available toxics are; <a href="https://github.com/Shopify/toxiproxy#toxics"><em>latency, down, bandwidth, slow_close, timeout, reset_peer, slicer, and limit_data</em></a><em>. </em>The toxics can be both upstream or downstream so the connection could be manipulated for the request going to the server or coming out of it.</li></ul><p>There are <a href="https://github.com/Shopify/toxiproxy#clients">several clients</a> for many programming languages that can be used in the integration testing of your application.</p><p>Before running the application under test, the dependencies might be required to be up and running, to achieve this the <strong>-config</strong> option can be used alongside a volume mount to add a predefined array of proxies.</p><p>Example of a config file:</p><pre>[<br>  {<br>    &quot;name&quot;: &quot;mysql&quot;,<br>    &quot;listen&quot;: &quot;[::]:3306&quot;,<br>    &quot;upstream&quot;: &quot;mysql:3306&quot;,<br>    &quot;enabled&quot;: true,<br>    &quot;toxics&quot;: []<br>  }<br>]</pre><p>Click <a href="https://github.com/QaBound/ToxiProxyDemo">here</a> for a github repo that has an example of how to set up the docker-compose configuration and test using cucumber in a JAVA spring-boot project.</p><p>In the repo, you will find real working examples of:</p><ul><li>Example of docker-compose setup including <strong>Config mount </strong>and new <strong>Metrics</strong> endpoint.</li><li>Dynamic ToxiProxySetup in the test directory.</li><li>Feature file and steps for ToxiProxy in the test directory.</li><li>MySQL configuration with ToxiProxy using docker-compose.</li><li>Incorporation of the new ToxiProxy version 2.5.0, utilizing the new ToxiProxyMetrics feature.</li><li>A readMe file that will help in setting up.</li></ul><p>If your QA team is struggling to keep up with modern testing tools that would help with your shift-left approach to identify issues early on in the SDLC lifecycle and you have to rely on external resources to train your team and implement a high standard of automated processes, reach out to the highly experienced talent pool at <a href="http://qabound.com/">QA Bound</a> to help solve your problems around automating quality.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d5d9a3f3083c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>