<?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 Mehmet Serefoglu on Medium]]></title>
        <description><![CDATA[Stories by Mehmet Serefoglu on Medium]]></description>
        <link>https://medium.com/@mehmetserefoglu?source=rss-923edc5136af------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*cMuij6zqHtae4bgq</url>
            <title>Stories by Mehmet Serefoglu on Medium</title>
            <link>https://medium.com/@mehmetserefoglu?source=rss-923edc5136af------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 21:04:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mehmetserefoglu/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[Superwiki: An LLM Wiki and Task Tracker for Claude Code, Codex and Copilot CLI]]></title>
            <link>https://mehmetserefoglu.medium.com/superwiki-an-llm-wiki-and-task-tracker-for-claude-code-codex-and-copilot-cli-967d2681ad98?source=rss-923edc5136af------2</link>
            <guid isPermaLink="false">https://medium.com/p/967d2681ad98</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[knowledge-management]]></category>
            <category><![CDATA[obsidian]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[llm-wiki]]></category>
            <dc:creator><![CDATA[Mehmet Serefoglu]]></dc:creator>
            <pubDate>Wed, 07 Oct 2026 20:34:25 GMT</pubDate>
            <atom:updated>2026-10-16T19:16:28.346Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Open-source agent skills that turn your docs/ folder into a second brain for your coding agent: a wiki and task tracker it writes, in plain markdown you can open in Obsidian.</em></p><figure><img alt="Superwiki: your coding agent keeps docs/ as a wiki and task tracker, for Claude Code, Codex and Copilot." src="https://cdn-images-1.medium.com/max/1024/1*DjYfwGkMcYCPYwwPGhrbHg.png" /><figcaption>Superwiki keeps docs/ as a wiki and task tracker that your coding agent writes.</figcaption></figure><p>Every coding agent session starts from what it is given and what it reads. The reasons behind a library choice, the fix for last month’s bug, the order in which tasks have to happen: unless that knowledge is written down somewhere the agent reads, the next session does not have it.</p><p><a href="https://github.com/mhmtsrfglu/superwiki">Superwiki</a> is an open-source set of agent skills that gives that knowledge a place in your repository. It turns the docs/ folder into a wiki and a task tracker that the coding agent writes and keeps current, guided by a short rules block that /sw-init adds to AGENTS.md. It is built for Claude Code, Codex CLI and GitHub Copilot CLI, and everything it writes is plain markdown you can open in Obsidian.</p><h3>The idea: an LLM wiki for your codebase</h3><p>In April 2026, Andrej Karpathy published <a href="https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f">LLM Wiki</a>, a pattern for knowledge bases that an LLM builds and maintains. Raw sources stay untouched in raw/. The LLM writes and maintains the wiki pages, an index.md catalog and an append-only log.md, and a schema file such as AGENTS.md tells it how. In his words, &quot;the wiki is a persistent, compounding artifact.&quot;</p><p>Superwiki applies that pattern to a software project and adds the part a codebase needs: tasks. The vault that holds sources, decisions and lessons also holds the work, so a task can link to the decision it follows and the source it rests on.</p><h3>What lives in docs/</h3><pre>AGENTS.md        a short block of always-on rules<br>docs/<br>  index.md       the open tasks, then the wiki catalog, one line per page<br>  log.md         append-only history<br>  raw/           your sources, never modified<br>  wiki/          pages the agent writes<br>  tasks/         one file per task (optional)<br>  plans/         one plan per task<br>  viewer.html    the task board and the wiki in a browser</pre><p>Three rules keep the vault small and consistent:</p><ul><li><strong>One mandatory read.</strong> The rules have the agent read index.md first and open only the pages it needs. log.md is read with tail, never whole.</li><li><strong>One home per fact.</strong> A task’s status lives only in its frontmatter. The task list at the top of index.md is generated from the task files.</li><li><strong>Scripts for mechanical questions.</strong> “What is ready?” and “what blocks this?” are answered by a small script, node docs/.sw/sw.mjs, instead of the agent reading files.</li></ul><p>Pages link with [[wikilinks]], so the vault opens in Obsidian as it is.</p><h3>Seeing the work: sw-view</h3><p>sw-view opens the vault in the browser. It starts a small server on your machine that reads the files as they are, so after the vault changes, Refresh shows the new state. The page has three views, Tasks, Waves and Wiki, with task counts per area, filters by state, area and milestone, and a search over ids, titles and text.</p><p>Dependencies get a view of their own, the Waves board. A wave is the longest chain of hard dependencies below a task, so the columns run left to right from tasks with no hard dependencies to the ones at the end of the longest chains. Hover a card and everything it depends on and everything it blocks lights up; click it to open the task and pin the highlight. The highlight can follow the whole chain or only direct links, and soft dependencies are drawn dashed. In index.md a blocked task carries a &quot;waits on&quot; note; on the board the whole chain is in view.</p><figure><img alt="The Superwiki viewer: task counts per area, filters, and the Waves dependency board with one task’s chain highlighted." src="https://cdn-images-1.medium.com/max/1024/1*VVeMvGkyh4z20SjbvO89MA.png" /><figcaption>The Waves board in sw-view, with one task’s dependency chain highlighted.</figcaption></figure><h3>From idea to verified task</h3><p>The task workflow is a chain of skills. They are named sw-&lt;name&gt; in every agent: /sw-plan in Claude Code and Copilot CLI, $sw-plan in Codex. Plain requests work as well, because the rules block maps common requests to the skill that handles them.</p><ol><li><strong>sw-brainstorm</strong> turns an idea into tasks. It starts by listing what the vault already records on the subject, asks its questions in rounds with a recommended answer for each, and writes task files only after you confirm its summary.</li><li><strong>sw-plan</strong> has a planner write a plan of at most 1,000 words for you to approve.</li><li><strong>sw-implement</strong> has an implementer build the task and, when the task asks for it, a reviewer check the change. In Claude Code, the reviewer has no editing tools.</li><li><strong>sw-verify</strong> closes the task. Each &quot;Done when&quot; item is checked with a command that could have failed, and the command, how it would have failed and the result are written into the task file.</li><li><strong>sw-plan-implement</strong> runs this chain for one task and picks the route from the task file: a small task goes straight to the implementer, a medium one gets a short approach note, a large one gets a plan you approve first.</li><li><strong>sw-autopilot</strong> works through several tasks in a row. Before the first one it reads the task files and the vault, and asks once, in one message, only what they do not answer. From then on it decides from them and writes each decision with its source, has every task reviewed and commits each finished task. It stops at a question nothing answers; a push, a check that changes data or a deletion is always yours. The run’s state lives in docs/.sw/run.md, so when the session grows past its size limit, which sw-config sets, it stops between two tasks and a new session continues the run.</li></ol><p>sw-plan-implement runs this chain for one task and picks the route from the task file: a small task goes straight to the implementer, a medium one gets a short approach note, a large one gets a plan you approve first.</p><p>sw-autopilot works through several tasks in a row. Before the first one it reads the task files and the vault, and asks once, in one message, only what they do not answer. From then on it decides from them and writes each decision with its source, has every task reviewed and commits each finished task. It stops at a question nothing answers; a push, a check that changes data or a deletion is always yours. The run’s state lives in docs/.sw/run.md, so when the session grows past its size limit, which sw-config sets, it stops between two tasks and a new session continues the run.</p><p>The planner, implementer and reviewer each run in their own subagent, on the model you choose with sw-config. The main session dispatches them, reads their reports and records the status. Where an agent cannot run subagents, the skills do the work in the main session and say so.</p><h3>The wiki side: ingest, search, triage</h3><p>The same vault serves the knowledge work:</p><ul><li><strong>sw-ingest</strong> files a source in raw/, writes a summary page and adds it to the index and the log.</li><li><strong>sw-search</strong> answers a question from the vault with a reference for each claim, and says plainly when something is not recorded.</li><li><strong>sw-triage</strong> looks for earlier occurrences and lessons before anyone starts debugging. Once the bug is fixed, it offers to save a lesson page with the symptom, the cause, the fix and how to notice it earlier, which is the page the next triage finds.</li><li><strong>sw-lint</strong> checks links, frontmatter and task dependencies.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3N2SlKq-_mGpK2tZ9p4iNw.jpeg" /></figure><h3>What Superwiki does differently</h3><p>Most agent workflow tools organize the work around a document for the feature at hand: a spec, a plan or a PRD. Superwiki organizes it around a vault that stays with the project.</p><ul><li><strong>A second brain for the project, not for you.</strong> It lives in the repository and travels with git, so every session, and every teammate’s agent, reads the same one.</li><li><strong>Knowledge and tasks in one place.</strong> Sources, decisions, lessons, tasks and plans are linked pages, listed in one index.</li><li><strong>Evidence instead of a checkbox.</strong> The proof for each “Done when” item stays in the task file, where anyone can read how it was checked.</li><li><strong>Cost you can see.</strong> sw-usage reports what each agent in a session used; sw-doctor shows what every session carries before any work starts.</li><li><strong>No lock-in.</strong> Everything is plain markdown. Uninstall Superwiki and docs/ stays, readable in Obsidian or any editor.</li></ul><h3>Getting started</h3><p>Superwiki is published on <a href="https://www.npmjs.com/package/superwiki">npm</a> and needs Node 18 or newer.</p><pre>npx superwiki install claude   # or: codex, copilot, all</pre><p>Start a new agent session in your project and run /sw-init ($sw-init in Codex). It sets up docs/, adds the rules block to AGENTS.md and asks whether you want the task tracker. From then on, plain requests are enough:</p><pre>What should I work on next?<br>Implement P-15.<br>Why does M-06 exist, and what is it blocked by?<br>Users get the magic-link email twice. Have we seen this before?</pre><p>Tasks already kept in a markdown table can be converted with sw-migrate, on a branch of its own. Superwiki can also run next to another skill set: under docs/ it reads and writes only index.md, log.md, raw/, wiki/, tasks/ and plans/, plus its own .sw/ folder and viewer.html.</p><h3>Status and contributing</h3><p>Superwiki is early. Its <a href="https://github.com/mhmtsrfglu/superwiki/blob/main/DESIGN.md#status">design notes</a> list what has been tested in each agent and what has not, which also shows where help is needed: running the task workflow in Codex and Copilot CLI, trying the skills in other agents that read SKILL.md folders, and using sw-brainstorm and sw-autopilot on real work. The project is MIT-licensed, has no dependencies to install, and runs its tests with npm test.</p><p><a href="https://github.com/mhmtsrfglu/superwiki">Repository</a> · <a href="https://www.npmjs.com/package/superwiki">npm</a> · <a href="https://mhmtsrfglu.github.io/superwiki/">Live demo</a> · <a href="https://github.com/mhmtsrfglu/superwiki/issues">Issues</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=967d2681ad98" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OAUTH2 ve Grant Types]]></title>
            <link>https://mehmetserefoglu.medium.com/oauth2-ve-grant-types-b8c170322b87?source=rss-923edc5136af------2</link>
            <guid isPermaLink="false">https://medium.com/p/b8c170322b87</guid>
            <category><![CDATA[oauth]]></category>
            <category><![CDATA[oauth2]]></category>
            <category><![CDATA[oidc]]></category>
            <category><![CDATA[grant-types]]></category>
            <dc:creator><![CDATA[Mehmet Serefoglu]]></dc:creator>
            <pubDate>Thu, 10 Jun 2021 10:24:03 GMT</pubDate>
            <atom:updated>2021-06-10T10:24:03.950Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*6D65mmrvEo7INz0B.PNG" /></figure><p>OAuth = Open + Authorization yani açık yetkilendirme anlamına gelir. 2 ise version anlamına gelir. OAuth framework sektörün standart bir yetkilendirme kütüphanesidir ve belirli yetkilendirmeler sunar. AOuth, taleplerin kullanıcı verilerine erişmesini veya kullanıcı davranışları üzerinde bazı işlemler gerçekleştirmesini sağlayan geçiş katmanıdır.</p><p>Bir senaryo düşünelim, biz bir kullanıcıyız ve bir mobil uygulama üzerinden instagramdaki resimlerimize ulaşmak istiyoruz. Uygulamamız Instagram tarafından yetkilendirilmedikçe Instagram bu fotoğraflara ulaşmamıza izin vermeyecektir. Burda devreye Authorization kütüphaneleri girmektedir. Authorization kütüphaneleri, kullanıcının bu mobil uygulama üzerinden üçüncü taraf bilgilerine, örneğin bir web sitesine veya Facebook’taki kullanıcı verilerine veya kendi kullanıcı verilerine erişmek için izin vermesine yardımcı olur.</p><p>Bununla birlikte OAuth bir <strong>delegated </strong>yani <strong>yetkilendirilmiş </strong>bir OAuth kütüphanesidir. Bunun anlamı kullanıcıların kendi verileriyle ilgili işlemlerde kullanıcı adlarını ve şifrelerini vermeden belirli işlemleri gerçekleştirmesi için uygulamaya yetki vermesidir. Burdaki iyi haber uygulama bu kimlik doğrulaması ile sadece belirli işlemleri yapabilir, örneğin sadece fotoğraflara erişebilir fakat değiştirme işlemi yapamaz.</p><h3><strong>OAuth 2.0 Roles</strong></h3><ul><li><strong>Resource Owner (Kaynak Sahibi)</strong>: Bilgiye sahip olan ve bu bilgilere erişim izni verebilen bir kullanıcıdır.</li><li><strong>Client (İstemci):</strong> Kullanıcının adına bilgilere erişen bir uygulamadır. Bu bir web uygulaması olabilir, bir mobil uygulama olabilir</li><li><strong>Resource Server (Kaynak Sunucusu)</strong>: Kullanıcının bilgilerinin saklanlandığı ve sunulduğu kaynaktır.</li><li><strong>Authorization Server (Yetkilendirme Sunucusu):</strong> Kaynak sahibinin kimliğini başarıyla doğruladıktan ve yetkilendirme aldıktan sonra istemci uygulamasına erişim bilgilerini(access token) veren sunucudur.</li></ul><h3><strong>OAuth 2.0 Client Types</strong></h3><ul><li><strong>Confidential Client: </strong>Confidential uygulamalar client secret key’i güvenli bir şekilde tutabilirler. Bu anahtarı güvenli olarak tuttukları için onlara secret key verilir. O yüzden bu uygulamalar ClientID ve client secret key ile kolayca ve güvenli bir şekilde kimlik doğrulama(authenticate) yapabilirler. Örnek olarak, sunucu üzerinde çalışan güvenli bir uygulama olabilir.</li><li><strong>Public Client: </strong>Bu uygulamalar client ID ve client secret key’i güvenli bir şekilde tutup saklayacaklarını garanti edemeyen uygulamalardır. Örnek olarak bir mobil uygulama yada javascript ile yazılmış single page bir web uygulama olabilir. Bu client tipinde eğer uygulama çözülürse yada decompile edilirse kayıtlı olan client secret key ve client id çalınabilir.</li></ul><h3><strong>OAuth 2.0 Access Token</strong></h3><p>Kaynak sahibi (resource owner) 3. Taraf bir uygulama ile kendi bilgilerine erişmek istediğinde kaynak sunucusuna(resource server) yetkilendirme sunucusu(authorization server) tarafından doğrulanmış ve atanmış olan access token’i kullanır. Kaynak sunucusuna(resource server) bu access token verildiğinde kaynak sunucusu bu access token’i yetkilendirme sunucusunda(authorization server) doğrular ve geçerli bir token ise bilgilere istemci uygulamanın ulaşmasına izin verir.</p><p>Access token içerisinde yetkilendirme bilgilerini(<strong>identifier type</strong>) veya kendi içerdiği yetkilendirme bilgilerini(<strong>self-contain the authorization information</strong>) tutabilir.</p><ul><li><strong>Identifier Type:</strong> Bu tanımlayıcı türü genellikle belirli uzunluklara sahip alfasayısal bir karakter dizisidir. Örneğin vCwWSQiaYhMHN2IbnEijtDWJ. Bu tür tanımlayıcılar genellikle veritabanında tutulur ve yine veritabanında tutulan belirli yetkilendirme bilgileriyle ilişkilendirilirler. Bu yetkilendirme bilgileri bu stringi referans alırlar.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/1*h-UyBZE2TBIWnAPBQAq6DA.png" /></figure><ul><li><strong>Self-contain the authorization information:</strong> Bu tanımlayıcı türü rastgele(random) oluşturulan uzun bir karakter dizisidir. Bu tür içerisinde token type dışında bir çok bilgiyi tutabilir.</li></ul><p><em>Örneğin</em>, eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c</p><p>Bu tür kendi içerisinde base64 halde encode edilmiş bir json objesi tutar. Bu tipte genelde kullanıcı şifresi gibi hassas bilgiler tutulmaz. Genelde bu tokenler 3 ayrı kısıma ayrılırlar. Bunlar<strong> header, payload</strong> ve <strong>signature </strong>kısımlarıdır.</p><ul><li><strong>Header:</strong> bu token bilgisinin nasıl doğrulanacağı hakkında bilgiler içerir. İçerisinde bu token bilgisinin türünü ve nasıl imzalandığını saklar.</li><li><strong>Payload:</strong> token içerisinde tutulan bilgiyi saklar.</li><li><strong>Signature</strong>: Bu tokeni doğrulamak için gereken metaryalleri saklar.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/573/1*0gYx3VIM7k-2JZmxKvs04g.png" /></figure><h3><strong>OAuth2 and OpenID Connect (OIDC)</strong></h3><p>OpenID connect, OAuth2 üzerinde gelen ek bir katmandır. Bu katmanda doğrulanmış kullanıcı ile alakalı bilgiler sağlanır. OpenId Connect (OIDC) önceki versiyonlarına göre API dostu bir yapı sağlar.OIDC, OAuth2 Authorization Code Grant yapısını genişleten bir eklentidir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/192/1*wYWKSVVgKB2mLw8KqdlQUw.png" /></figure><h3><strong>Grant Types</strong></h3><p>Uygulamanın bir access token alma şeklidir. Farklı türde uygulama olabilir, uygulamanın türüne ve kullanım durumuna bağlı olarak farklı kimlik doğrulama türü kullanılabilir.</p><p>Bu java veya php ile oluşturulan bir server side uygulama olabilir. Kullanıcı arayüzü olmayan sunucu scriptleri olabilir. Bir single page uygulama olabilir. Bir mobil uygulama olabilir. Bir tarayıcı penceresi olmayan veya script çalıştıramayan televizyon veya oyun konsolu olabilir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*iD9iuVk-TlOZHK6A5UxJgw.png" /></figure><p>Doğrulama(authenticate) işlemi yapılırken farklı uygulama türleri olabileceğinden ve bazı uygulamalar diğerlerinden daha az güvenli olabileceğinden, tasarlanmış farklı grant types vardır ve her grant types, access token bilgisini almak ve bunlara erişmek için kullanılır.</p><ul><li><strong>Authorization Code:</strong> Bu grant type genellikle server side web uygulamalarında veya mobil uygulamalarda kullanılır.</li><li><strong>Client Credentials:</strong> Bu grant type genellikte UI olmayan veya direk kullanıcı ile etkileşimi olmayan server side uygulamalarda kullanılır.</li><li><strong>PKCE Enhanced Authroization Code:</strong> Client credential bilgilerini güvenli bir şekilde saklayacağını garanti edemeyen uygulamalar tarafından kullanılır.</li><li><strong>Device Code:</strong> Bir tarayıcı penceresi açamayan veya kod çalıştıramayan uygulamalar tarafından kullanılır.</li><li><strong>Refresh Token Grant Type:</strong> Access token genelde bir geçerlilik süresine sahiptir. Bu geçerlilik süresi dolduğunda, access token bilgisini yenilemek için refresh token kullanırız.</li></ul><p>Uygulamanın ihtiyaçlarına ve yeteneklerine göre bilgileri güvenli bir şekilde saklayabilecekleri birbirinden farklı grant types bulunmaktadır.</p><h3><strong>Authorization Code</strong></h3><p>Bu grant type ile kullandığımız bir mobil uygulama yada web sayfası üzerinden google, facebook veya Instagram gibi uygulamalardaki bilgilerimize erişme yetkisi verirken kullanırız. Bu akış genelde redirect yani yönlendirme tabanlı kullandığımız bir akıştır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/1*dG0TeKDvEbhjzA7oVhRGUQ.png" /></figure><ul><li><strong>response_type:</strong> Bu <strong>code</strong> olarak yazılmalır. Buradaki code bir karakter dizisini ifade etmemektedir. Olduğu gibi yazılmalıdır. Bu nedenle bu türe authorization code grant type denir. Burada client yetkilendirme sunucusundan(Authorization Server) code bekleyecektir.</li><li><strong>State:</strong> Bu kod durumu ve değeri, uygulamanızın oluşturacağı rasgele bir karakter dizisidir ve bunu isteğe dahil eder. Yetkilendirme sunucusu(Authorization Server) bize bu state parametresini geri gönderir. Gelen state parametresi gönderdiğimiz state parametresi aynı olmalıdır. Eğer farklı gelirse, bu isteği bir başkası başlatmış demektir.</li><li><strong>redirect_uri:</strong> Burada isteğimiz bir kez başarılı olursa yönlendirilecek url parametresidir. Client burada bu isteği karşılamakla yükümlüdür.</li><li><strong>scope: </strong>uygulamanın hangi scope’lara erişmek istediğini belirttiği kısımdır. Örneğin, fotoğrafların görüntülenmesi, kullanıcı bilgilerini görüntüleme vb.</li><li><strong>client_id: </strong>Bu istemciyi tanımlayan kısımdır. Burada belirtilen id ile bir kullanıcı ifade edilmez. Bu uygulamanın kendisini tanıttığı bir id dir.</li></ul><h3><strong>PKCE-enhanced Authorization Code</strong></h3><p>PKCE, proof key code exchange yani kod değişimi için anahtar doğrulaması anlamına gelir. Authorization flow genellikle mobil uygulamalar ve web uygulamalarında kullanılır. Bu uygulamalar client_secret anahtarını güvenli bir şekilde saklayabileceklerinin garantisini vermezler. Authorization Code flow’a çok benzeyen bir grant type’dir. Sadece istek atarken ek bir kaç bilgi daha göndermeniz gerekmektedir. Bunlar <strong>code_challenge</strong> ve <strong>code_challenge</strong>_<strong>method</strong> parametreleridir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*MxHoHfYtSSBdOXifdXq7-Q.png" /></figure><ul><li><strong>Code_challenge</strong>: Bu parametresi genellikle base_64 ile şifrelenmiştir. Istemci uygulaması bu değeri üretilmek için code_verifier değerine ihtiyaç duyar</li><li><strong>Code_challenge_method</strong>: Bu değerin güvenlik sebebiyle genelde S256 olması önerilir. Bu değer code_verifier değerinin nasıl şifreleneceğini belirtir.</li></ul><p>Yukarıda belirtilen GET request sonunda bir code değeri elde edilir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/1*_s8S6rDC4YAwJ4hcgoFqdQ.png" /></figure><p>Bu kod değeri ile yukardaki gibi post isteği atılarak bir access token elde edilir.</p><h3><strong>Client Credentials(Machine to Machine Request)</strong></h3><p>Bu akış, bir uygulama diğer bir uygulamaya istek atarken kullanılır. Bu akışta bir kullanıcı yoktur yada bir giriş sayfası bulunmamaktadır. Bu uygulamalar client_secret anahtarını güvenli bir şekilde saklayacaklarını taahhüt ederler. O yüzden client_secret kullanularak yeni bir access_token elde edilir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*XLZW0OWT_64BR2BuuyZ9NQ.png" /></figure><h3><strong>Password Grant</strong></h3><p>Bu akış uygulamanız redirect desteklemediği zamanlarda kullanılır. Bunu dışında eğer uygulamanız web veya mobil uygulama ise <strong>Authorization Code </strong>veya<strong> PKCE-enhanced Authorization Code </strong>kullanmanız önerilir.</p><p>Ancak uygulamanız güvenli bir uygulamaysa ve bir kullanıcının uygulamanıza mutlak bir güveni varsa ve kullanıcı uygulamanıza kullanıcı adı ve şifresini vermeye hazırsa, o zaman password grant kullanılabilir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*Ngwh_4G6UnHivCIFKh4zSQ.png" /></figure><h3><strong>Refresh Token</strong></h3><p>Uygulamalarımızda kullandığımız access_token değerlerinin bir geçerlilik süresi vardır. Bu geçerlilik süresi dolduğunda bu tokenları kullanamayız. O zaman refresh token ile yeni bir token isteriz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*1q-Vq9XqMomtsVlG8YmU6w.png" /></figure><p>Aşağıda örnek bir refresh token isteği görmektesiniz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*R5INqIu-pgejbHS_EofJcg.png" /></figure><p>Bu refresh token’larında geçerlilik süreleri vardır ve her token yenilememizde refresh token değerimizde yenilenir. Geçerlilik süresi olmayan refresh_token için <strong>offline_access </strong>scope eklememiz gerekir.</p><p>Okuduğunuz için teşekkür ederim.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b8c170322b87" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Javascript’te Closure meselesini anlamak..]]></title>
            <link>https://mehmetserefoglu.medium.com/javascriptte-closure-meselesini-anlamak-5161cf367b81?source=rss-923edc5136af------2</link>
            <guid isPermaLink="false">https://medium.com/p/5161cf367b81</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[javascript-development]]></category>
            <category><![CDATA[functional-programming]]></category>
            <category><![CDATA[closures-functions]]></category>
            <category><![CDATA[closure]]></category>
            <dc:creator><![CDATA[Mehmet Serefoglu]]></dc:creator>
            <pubDate>Fri, 14 Feb 2020 22:07:49 GMT</pubDate>
            <atom:updated>2020-02-14T22:07:49.351Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*GkDraI6yfbhQbOEr6o0vew.png" /></figure><p>Merhaba, bugün javascript’te closure konusuna değineceğim. Anlatımımda süslü cümleler kurmak yerine nokta atışı örneklerle herkesin anlayabileceği bir şekilde basit ve sade bir dil kullanmaya çalışacağım. Örnekleri kendiniz tekrardan yazıp meseleyi daha iyi anlamanız için resim olarak koyacağım. Bu işleri anlamak için okumak yetmez, yazarak sonuçları kendinizde görmeniz gerek.</p><ol><li>Bir fonksiyonun içerisinde oluşturulan değişkenler dışarıya açık değildir, ama fonksiyonun dışında oluşan bir değişken fonksiyonun içinde kullanabilir. Bu durumda dışardaki değişkenin referansının fonksiyon tarafından tutulmasına closure denir.</li><li>Başka bir değişle, bir fonksiyon içerisinde farklı bir fonksiyon tanımladığınızda, içteki fonksiyonun kendisini closure eden yani kapatan dış fonksiyonun değişkenlerine ulaşabilmesine closure denir.</li></ol><p><strong>Closure içinde bulundurduğu değişkenlerin referanslarını tutar, daha sık söylenilen bir tabirler değişkenlerin referanslarını kapatırlar. Lütfen bu cümleyi aklınızın bir köşesinde makale boyunca tutun.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EIHSzASpZgxawR0IdszOEw.png" /></figure><p>1.madde üzerinde ne söylemeye çalıştığımı anlatırsam, yukarıdaki resimde bir closure örneği verdim. Global scope üzerinde oluşturduğumuz <strong>parametre </strong>değişkenine <strong>topla fonksiyonu</strong> ile eriştik. Topla fonksiyonumuz böylece <strong>parametre </strong>değişkenimizi kapattı. Eğer örneği kendiniz tekrardan yazıp çalıştırırsanız konsolda aşağıdaki resimdeki bilgileri göreceksiniz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZLP6JvalBiwVeAifoW9Tqw.png" /></figure><p>Resimdende anlayacağınız gibi topla fonksiyonumuz parametre değerimizi closure etti. <strong>Eğer bir fonksiyonun scope alanı dışında bir değişkeni fonksiyon içinde kullanıyorsanız bu closure’dur. Closure üzerine bastırarak içinde kapattığı değişkenin referansını tutar demiştik.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ia5Xx3IQJtjfSvT6rFuAfg.png" /></figure><p>Eğer parametre üzerinde bir değişiklik yaparsak topla fonksiyonumuz parametre değişkeninin referansını tuttuğu için closure ettiği değerde değişecektir. Örneği çalıştırdığımızda topla fonksiyonunun closure ettiği parametre değerinin değiştiğini görebilirsiniz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6SA3JFUeFeN5SD_m1H-UlQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7OA-J6VniSEeBvGJdwCPnQ.png" /></figure><p>2.maddede anlatmaya çalıştığım ise, yukarıdaki resimde IkiIleTopla fonksiyonu içinde bir topla fonksiyonu barındırıyor ve return ediyor. Ne demiştik, içteki fonksiyon dıştaki fonksiyonun değerine ulaşıp onu kullanıyorsa bu bir closure’dur.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EnrTHghe-v2sLe7zZ6sA9Q.png" /></figure><p>Kodu yazıp çalıştırdıysanız konsol üzerinden baktığınızda <strong>topla</strong> fonksiyonunun <strong>deger</strong> degişkenini closure ettiğini görebilirsiniz.</p><p>İkinci maddede bir tuhaflık sezebilirsiniz çünkü bir çok programlama dilinde bir fonksiyon stack üzerinde çalıştıp bittiğinde içindeki değişkenlerin kaybolması gerekirdi nitekim <strong>IkiIleTopla </strong>fonksiyonunu çalıştırdığımızda fonksiyon bitiminde <strong>deger</strong> değişkeninin silinmesi gerekirdi. <strong>IkiIleTopla </strong>fonksiyonu bize <strong>topla </strong>fonksiyonunu return ettiği içinde ve <strong>topla</strong> fonksiyonu <strong>deger</strong> değişkeninin <strong>referansını kapattığı</strong> için biz <strong>IkiIleTopla </strong>fonksiyonu bitse dahi closure sayesinde <strong>deger</strong> değişkenine ulaşabiliyoruz.</p><p>Closure’lar bizim static değişken ihtiyacımızıda çözmektedir. Java, C# gibi dillerden geliyorsanız ve static değişken nasıl oluşturabilirim diye düşünüyorsanız closure’lar tam olarak aradığınız şey olabilir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4183RmUaVuriqXpD0eVznQ.png" /></figure><p>Ne demiştik closure içinde bulunduğu değişkenin referansını tutar. <strong>tiklanmaSayisi </strong>değişkeni <strong>tiklandi </strong>fonksiyonu tarafından closure edildi, bu fonksiyon <strong>tiklanmaSayisi </strong>değişkeninin referansını tuttuğu için <strong>tiklandi </strong>fonksiyonu her çağırıldığında bir önceki değerinin üzerine eklenerek artacaktır.</p><p>Closure felsefesini anladığınızı umuyorum, çünkü bir fonksiyonun dış scope üzerinde yer alan bir değişkene erişip onu kullanmasına ve o değişkenin referansını kapatmasına closure dedik. <strong>Peki bu closure döngü içlerinde karşımıza çıkarsa ? Alın size güzel bir mülakat sorusu.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*dgBg7bLDHBFeNHrkV2cUqQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rj17aCQbNNWfck9U1BQlMw.png" /></figure><p>Bu şekilde bir for döngümüz var ve içinde setTimeout koyduk. setTimeout her 1 saniyede içindeki fonksiyonu çalıştıyor. İçerdeki fonksiyon i değerini closure ediyor. i = 3 olduğunda for döngümüz duracak <strong>setTimeout içerisindeki fonksiyon i değerinin referansını tuttuğu</strong> için ekrane 1 saniye sonra 3 tane 3 yazdıracaktır. Peki bu sorunu nasıl çözeriz. İçinizden her loopta yeni bir referans değeri oluştururuz dediğinizi duyar gibiyim.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GDxjtwr-VtqwZUDnK5nbrA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f8JoU-K4LzmHFqUBEBe_4g.png" /></figure><p>Ya da Immediately Invoked Function Expression(IIFE) yani anında çalıştırılan fonksiyonlarla özel bir scope yaratarak çözebiliriz. Burada IIFE ile özel bir block oluşturduk ve her bir i değerini j değerine referans ettik. Her loopta j’nin referansı değişeceği için setTimeout içindeki fonksiyonumuz farklı değerleri closure edecek ve sorun çözülmüş olacak.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fjkQqOo8GWh46FwXsf2uxw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a4aj7aYWXo8RrSjfb0dKyA.png" /></figure><p>İşin özü bu kadar. Umarım faydalı bir yazı olmuştur. Okuyan herkese teşekkür ederim.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5161cf367b81" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>