![keybase api keybase api](https://jacobsalmela.com/content/images/2020/12/rfp.png)
![keybase api keybase api](https://www.paloaltonetworks.jp/content/dam/pan/ja_JP/Images/blog/KL13.png)
#KEYBASE API HOW TO#
Wrangler knows how to handle our code based on the wrangler.toml file in our project. Raw-loader is a webpack module that allows strings to be loaded from text files. The Keybase proof is fairly big, and I don't want to try and embed the contents of the textfiles within the code, I'd rather reference the text files. In short, our worker just needs to serve up some text files in response to specific requests. Whilst doing this I also wanted to setup a security.txt that provides anyone wanted to report a security vulnerability with clear instructions of how to contact the person responsible for security of the website. You can find your account_id and zone_id in the right sidebar of the zone overview tab at Ī Keybase proof is a textfile that's generated from Keybase and that you host as a specific URL such as /.well-known/keybase.txt.
#KEYBASE API UPDATE#
You will need to update the following fields in the created wrangler.toml file before continuing: Now we can create our new project: $ wrangler generate cloudflare-worker-securityĬreating project called `cloudflare-worker-security`.ĭone! New project created /home/james/projects/cloudflare-worker-security As this is my personal account I was comfortable creating an API token that has access to all Account Resources and all Zone Resources, so I set these both to include all accounts and include all zones under the respective Account Resources and Zone Resources sections.įrom your terminal window run wrangler config and provide your API token that you've just created. We need to configure Wrangler with an API token from the Cloudflare Dashboard:Ĭloudflare provides a number of templates for creating an API token with refined permissions: Cloudflare Worker's are entirely JavaScript so as you'd probably expect, Wrangler is also implemented in JavaScript and can be installed via npm: npm i -g Wrangler is a CLI tool for developing, testing and publishing code for a Cloudflare Worker. Let's take a look at how we can write some code for a Cloudflare Worker and version control it in git. The Keybase proof is a text file that sits in the.
![keybase api keybase api](https://s3.amazonaws.com/keybase_processed_uploads/67de224299e2c7f438d70c56b5bac905_360_360.jpg)
I can use a Cloudflare Worker to intercept the request made by Keybase for the proof file and respond with the proof instead of sending the request on to Ghost. A worker can be used to modify the request and/or response. A Cloudflare worker lets you run JavaScript on Cloudflare’s edge-nodes in response to a HTTP(S) request to your website.
![keybase api keybase api](https://miro.medium.com/max/1280/1*BXYIiQpH8TMFSwlijKfTgw.png)
This is where Cloudflare Workers come in. The challenge I faced is that Ghost is a blogging platform, and doesn’t have provisions for hosting text files or doing anything outside of being a great blogging platform. When I planned to migrate to Ghost(Pro) and Cloudflare, I’d completely forgotten about Keybase and the proof that the site was hosting. I had setup my website to host a Keybase proof (text file) that proved as a cryptographic link between my website and my encryption key. Keybase is a key directory that offers end-to-end chat encryption as well as identity proofs that allow you to prove a link between your online identities (Websites, Twitter, GitHub, etc) and your encryption key. Switching over to Ghost(Pro) was a fairly slick process until I got an email from Keybase informing me that I’d broken my websites Proof: I recently blogged about how I moved my website from being a custom Ruby on Rails blog hosted in AWS to Ghost(Pro) fronted by Cloudflare.