<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Rogerio Rodrigues</title>
    <description>The latest articles on DEV Community by Rogerio Rodrigues (@rbrodrigues1980).</description>
    <link>https://dev.to/rbrodrigues1980</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F417865%2F99f5d05c-d93b-4cee-aa9c-5943787a1e67.png</url>
      <title>DEV Community: Rogerio Rodrigues</title>
      <link>https://dev.to/rbrodrigues1980</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rbrodrigues1980"/>
    <language>en</language>
    <item>
      <title>Web Notepad evolved: now it has optional authentication, ownership, and access control</title>
      <dc:creator>Rogerio Rodrigues</dc:creator>
      <pubDate>Sat, 25 Apr 2026 22:57:02 +0000</pubDate>
      <link>https://dev.to/rbrodrigues1980/web-notepad-evolved-now-it-has-optional-authentication-ownership-and-access-control-5b</link>
      <guid>https://dev.to/rbrodrigues1980/web-notepad-evolved-now-it-has-optional-authentication-ownership-and-access-control-5b</guid>
      <description>&lt;p&gt;In my first post, I introduced &lt;strong&gt;Web Notepad&lt;/strong&gt; as a simple online notepad: open, write, and share by link, with no mandatory signup.&lt;/p&gt;

&lt;p&gt;That original idea is still the same: &lt;strong&gt;low friction&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;But the main feedback I kept getting was straightforward:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“I want to share by link, but I don’t always want anyone with the link to be able to change or delete my content.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That feedback shaped the next evolution of the product.&lt;/p&gt;

&lt;p&gt;The goal became:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;⚡ keep anonymous usage fast;&lt;/li&gt;
&lt;li&gt;🔐 add optional authentication;&lt;/li&gt;
&lt;li&gt;👤 allow a note to have an owner;&lt;/li&gt;
&lt;li&gt;🛡️ provide real control over reading and editing;&lt;/li&gt;
&lt;li&gt;🧭 keep the frontend experience simple and the API predictable.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Live product:&lt;/strong&gt; &lt;a href="https://webnotepad.com.br/" rel="noopener noreferrer"&gt;https://webnotepad.com.br/&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;First post:&lt;/strong&gt; &lt;a href="https://www.tabnews.com.br/rbrodrigues/criei-o-web-notepad-um-bloco-de-notas-online-publico-sem-login-e-ja-em-producao" rel="noopener noreferrer"&gt;https://www.tabnews.com.br/rbrodrigues/criei-o-web-notepad-um-bloco-de-notas-online-publico-sem-login-e-ja-em-producao&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Frbrodrigues1980%2Fimages%2Fmain%2Fimagem.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Frbrodrigues1980%2Fimages%2Fmain%2Fimagem.png" title="The original idea is still the same: open, write, and share with minimal friction." alt="Web Notepad home" width="800" height="531"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  ✨ What changed in practice
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1) 🔑 Optional Google sign-in
&lt;/h3&gt;

&lt;p&gt;The system now supports Google authentication without turning the product into a heavy suite or forcing registration for everything.&lt;/p&gt;

&lt;p&gt;That means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;users who just want to open a note and type can still do it quickly;&lt;/li&gt;
&lt;li&gt;users who want more control can sign in and gain access to ownership and governance features.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2) 👤 Note ownership
&lt;/h3&gt;

&lt;p&gt;A note can now be linked to a user.&lt;/p&gt;

&lt;p&gt;This moves the product away from the pure “whoever has the link can do everything” model toward a more controlled model, while preserving the original simplicity.&lt;/p&gt;

&lt;p&gt;In practice, this opened the door to clearer authorization rules and owner-specific actions.&lt;/p&gt;

&lt;h3&gt;
  
  
  3) 🧩 Four access modes
&lt;/h3&gt;

&lt;p&gt;The system now supports four access modes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;PUBLIC_EDIT&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;AUTHENTICATED_EDIT&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;PUBLIC_READ&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;PRIVATE_OWNER&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This was an important change because the previous behavior was too binary.&lt;/p&gt;

&lt;p&gt;Now I can represent real-world scenarios such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🌍 a public collaborative note;&lt;/li&gt;
&lt;li&gt;👀 a note visible to anyone with the link, but editable only by the owner;&lt;/li&gt;
&lt;li&gt;🔒 a note restricted to the owner;&lt;/li&gt;
&lt;li&gt;✅ a note accessible only to authenticated users who have the link.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I also kept compatibility with the previous model so that the evolution wouldn’t break the existing foundation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Frbrodrigues1980%2Fimages%2Fmain%2Fimagem%2520%281%29.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Frbrodrigues1980%2Fimages%2Fmain%2Fimagem%2520%281%29.png" title="Access mode is now explicit inside the editor." alt="Editor with access controls" width="800" height="529"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  4) 🔓 The “unclaim” flow
&lt;/h3&gt;

&lt;p&gt;One improvement I found especially useful was the ability to &lt;strong&gt;unlink ownership&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Now the owner can simply give up ownership of a note without deleting it.&lt;/p&gt;

&lt;p&gt;In practice, this means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the note no longer has an owner;&lt;/li&gt;
&lt;li&gt;it returns to public editable mode;&lt;/li&gt;
&lt;li&gt;it disappears from that user’s “My notes” list.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This solves a very real product case:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“I don’t want to manage this note anymore — I just want to make it public again.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Frbrodrigues1980%2Fimages%2Fmain%2Fimagem%2520%283%29.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Frbrodrigues1980%2Fimages%2Fmain%2Fimagem%2520%283%29.png" title="Ownership and note management became first-class parts of the product." alt="Dashboard / note management" width="800" height="532"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ What changed in the backend
&lt;/h2&gt;

&lt;p&gt;Most of the backend evolution focused on a few major points:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🟣 Google authentication behind a feature flag;&lt;/li&gt;
&lt;li&gt;🟣 ownership through &lt;code&gt;claim&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;🟣 the &lt;code&gt;unclaim&lt;/code&gt; flow;&lt;/li&gt;
&lt;li&gt;🟣 an authorization model with four access modes;&lt;/li&gt;
&lt;li&gt;🟣 clearer error semantics via &lt;code&gt;messageKey&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;🟣 stricter rules for sensitive actions, such as deletion being owner-only.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Some of the endpoints involved in this evolution:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;POST /api/auth/google&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;GET /api/auth/me&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;POST /api/auth/logout&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;PATCH /api/users/me&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;POST /api/pads/{slug}/claim&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;POST /api/pads/{slug}/unclaim&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The API errors also became more explicit, with semantic keys such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;auth.required&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;pad.owner.onlyEdit&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;pad.owner.onlyDelete&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;pad.owner.alreadyClaimed&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;pad.owner.notClaimed&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;pad.accessMode.invalid&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This made frontend integration easier because it reduced fragile text parsing and improved user-facing feedback.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎨 What changed in the frontend
&lt;/h2&gt;

&lt;p&gt;On the frontend, the goal was to make this new layer of control visible and understandable without cluttering the interface.&lt;/p&gt;

&lt;p&gt;The main improvements were:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🟢 Google login with a more stable session;&lt;/li&gt;
&lt;li&gt;🟢 a dashboard segmented by scope;&lt;/li&gt;
&lt;li&gt;🟢 ownership made visible inside the editor;&lt;/li&gt;
&lt;li&gt;🟢 per-card actions in the dashboard;&lt;/li&gt;
&lt;li&gt;🟢 a complete unlink/unclaim flow;&lt;/li&gt;
&lt;li&gt;🟢 a multilingual user manual inside the application.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In practice, the frontend gained much better note management without losing the fast editing experience.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Frbrodrigues1980%2Fimages%2Fmain%2Fimagem%2520%284%29.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Frbrodrigues1980%2Fimages%2Fmain%2Fimagem%2520%284%29.png" title="The product now explains itself better without making the main flow heavier." alt="User manual / product guidance" width="800" height="531"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 Technical decisions that helped the most
&lt;/h2&gt;

&lt;h3&gt;
  
  
  🚩 Feature flags first
&lt;/h3&gt;

&lt;p&gt;This allowed me to activate authentication and ownership more safely in production, without forcing a big-bang rollout.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔄 Backward compatibility
&lt;/h3&gt;

&lt;p&gt;Mapping the old behavior into the new model avoided unnecessary breakage.&lt;/p&gt;

&lt;h3&gt;
  
  
  🧾 Clear semantic errors
&lt;/h3&gt;

&lt;p&gt;Having a dedicated &lt;code&gt;messageKey&lt;/code&gt; for each scenario simplified the frontend and improved the user experience.&lt;/p&gt;

&lt;h3&gt;
  
  
  🛡️ Security in the backend, UX in the frontend
&lt;/h3&gt;

&lt;p&gt;Authorization lives in the backend.&lt;br&gt;
The frontend improves usability, visibility, and feedback — but it is not responsible for enforcing security rules.&lt;/p&gt;




&lt;h2&gt;
  
  
  ❤️ What I wanted to preserve
&lt;/h2&gt;

&lt;p&gt;Even with authentication, ownership, and access modes, I wanted to preserve the pillars of the first version:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;⚡ fast creation;&lt;/li&gt;
&lt;li&gt;🔗 link-based usage;&lt;/li&gt;
&lt;li&gt;💾 autosave;&lt;/li&gt;
&lt;li&gt;🔄 cross-client updates;&lt;/li&gt;
&lt;li&gt;🧼 a clean API;&lt;/li&gt;
&lt;li&gt;🪶 a product that stays easy to understand.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In other words:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;more governance without losing simplicity.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  🔭 What I’m evaluating next
&lt;/h2&gt;

&lt;p&gt;These are the areas I’m looking at now:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;explicit user invitations;&lt;/li&gt;
&lt;li&gt;richer auditing for sensitive actions;&lt;/li&gt;
&lt;li&gt;anti-abuse improvements without killing simplicity;&lt;/li&gt;
&lt;li&gt;deeper production observability.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  ✅ Closing thought
&lt;/h2&gt;

&lt;p&gt;The main lesson so far has been this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;It is possible to keep the experience simple while evolving the system for more realistic collaboration and access-control scenarios.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Web Notepad is still fast for people who just want to open a note and type.&lt;/p&gt;

&lt;p&gt;But now it also serves real use cases where people want to share without giving up governance.&lt;/p&gt;

&lt;p&gt;If there’s interest, I can make a follow-up post focused only on the implementation details: layers, contracts, feature-flag rollout, and the trade-offs I found along the way.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>security</category>
      <category>showdev</category>
      <category>sideprojects</category>
    </item>
  </channel>
</rss>
