<?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 Tomas Sykora on Medium]]></title>
        <description><![CDATA[Stories by Tomas Sykora on Medium]]></description>
        <link>https://medium.com/@Syky27?source=rss-820ad1d08a7d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*bvx_1mm8UQDrSZ8Y.jpeg</url>
            <title>Stories by Tomas Sykora on Medium</title>
            <link>https://medium.com/@Syky27?source=rss-820ad1d08a7d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 09:27:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Syky27/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[Export Keycloak Configuration from Kubernetes pod]]></title>
            <link>https://medium.com/@Syky27/export-keycloak-configuration-from-kubernetes-pod-842cf44b9a76?source=rss-820ad1d08a7d------2</link>
            <guid isPermaLink="false">https://medium.com/p/842cf44b9a76</guid>
            <category><![CDATA[config]]></category>
            <category><![CDATA[export]]></category>
            <category><![CDATA[keycloak]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Tomas Sykora]]></dc:creator>
            <pubDate>Fri, 17 Nov 2023 14:05:40 GMT</pubDate>
            <atom:updated>2023-11-17T14:06:39.575Z</atom:updated>
            <content:encoded><![CDATA[<p>I recently came across problem with exporting config from keycloak that runs in kubernetes, the keycloak cannot run for the export, so you need to work around it to get your config, this is the solution:</p><pre>REALM_NAME=my-realm-name<br>NAMESPACE=my-namespace-where-keycloak-pod-located<br>KEYCLOAK_POD_NAME_KEYWORD=keycloak<br><br># Gets full name of keycloak pod<br>POD_NAME=`kubectl get pods --no-headers -o custom-columns=&quot;:metadata.name&quot; --namespace $NAMESPACE | grep $KEYCLOAK_POD_NAME_KEYWORD`<br><br># Exports config<br>kubectl exec -it $POD_NAME --namespace $NAMESPACE -- /bin/bash -c &quot;/opt/keycloak/bin/kc.sh export --realm $REALM_NAME --dir=/opt/keycloak/Backups&quot;<br><br># `tar` has been removed from keycloak image due security vulnerabilities<br># so there commented lines won&#39;t work<br><br><br>#kubectl exec -it $POD_NAME --namespace $NAMESPACE -- /bin/bash -c &quot;cd /opt/keycloak/Backups &amp;&amp; tar -cf backup.tar *&quot;<br>#kubectl cp $POD_NAME:/opt/keycloak/Backups/* . --namespace $NAMESPACE<br><br># However you can still cat those files to your local filesystem<br>kubectl exec -i $POD_NAME -n $NAMESPACE -- cat /opt/keycloak/Backups/$REALM_NAME-realm.json &gt; $REALM_NAME-realm.json<br><br># Depending on how many users you have keycloak will create multiple export jsons for them<br>FILE_COUNT=$(kubectl exec -i $POD_NAME -n $NAMESPACE -- ls -l /opt/keycloak/Backups/ | grep ${REALM_NAME} | wc -l)<br>for ((i=0; i&lt;$FILE_COUNT-1; i++))<br>do <br>   kubectl exec -i $POD_NAME -n $NAMESPACE -- cat /opt/keycloak/Backups/$REALM_NAME-users-$i.json &gt; $REALM_NAME-users-$i.json -e<br>done</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=842cf44b9a76" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vapor Controller Endpoints (Swift Web Framework)]]></title>
            <link>https://medium.com/@Syky27/vapor-tips-swift-web-framework-f83f406c6114?source=rss-820ad1d08a7d------2</link>
            <guid isPermaLink="false">https://medium.com/p/f83f406c6114</guid>
            <category><![CDATA[vapor]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[swift-3]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[endpoints]]></category>
            <dc:creator><![CDATA[Tomas Sykora]]></dc:creator>
            <pubDate>Sat, 15 Oct 2016 00:19:20 GMT</pubDate>
            <atom:updated>2016-10-15T00:52:19.894Z</atom:updated>
            <cc:license>http://creativecommons.org/publicdomain/zero/1.0/</cc:license>
            <content:encoded><![CDATA[<p>Thanks to John Bona from Vapor slack I got to know how the endpoint actually look like</p><p>Here is how my simplified Socks controller looks, this controller takes care of Sock model.</p><p>First line is the endpoint, the second is method notation.</p><pre>//  SockController.swift</pre><pre>GET [/socks]<br>func index(request: Request) ...</pre><pre>POST [/socks]<br>func create(request: Request) ...</pre><pre>GET [/socks/1]<br>func show(request: Request, sock: Sock) ...</pre><pre>DELETE [/socks/1]<br>func delete(request: Request, sock: Sock) ...</pre><pre>DELETE [/socks]<br>func clear(request: Request) ...</pre><pre>PATCH [/socks/1]<br>func update(request: Request, sock: Sock) ...</pre><pre>PUT [/socks/1]<br>func replace(request: Request, sock: Sock) ...</pre><pre>func makeResource() -&gt; Resource&lt;Sock&gt; {<br>  return Resource(<br>    index: index,<br>    store: create,<br>    show: show,<br>    replace: replace,<br>    modify: update,<br>    destroy: delete,<br>    clear: clear<br>  )<br>}</pre><p>This is a piece of middleware from which “…/socks…” in URL came from</p><pre>let url = baseUrl + &quot;socks/\(id)&quot;</pre><p>You can find Postman Collection over here: <a href="https://www.getpostman.com/collections/a60d3204f05470b97dd5">https://www.getpostman.com/collections/a60d3204f05470b97dd5</a></p><p>Reference in Vapor source codes is here: <br>vapor/routing/resource.swift #91</p><p>You can checkout my whole source code on Github:<br><a href="https://github.com/syky27/LostSocks-api">https://github.com/syky27/LostSocks-api</a></p><p>Happy Coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f83f406c6114" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>