<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Plugin on Wenhan blog</title>
    <link>https://wenhan.blog/en/tags/plugin/</link>
    <description>Recent content in Plugin on Wenhan blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-US</language>
    <lastBuildDate>Tue, 23 Jan 2024 22:55:37 +0900</lastBuildDate><atom:link href="https://wenhan.blog/en/tags/plugin/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Other Use Cases for the Kong OpenID Connect Plugin</title>
      <link>https://wenhan.blog/en/posts/20240123_kong-oidc-plugin-extra-use-cases/</link>
      <pubDate>Tue, 23 Jan 2024 22:55:37 +0900</pubDate>
      
      <guid>https://wenhan.blog/en/posts/20240123_kong-oidc-plugin-extra-use-cases/</guid>
      <description>(Translated from https://tech.aufomm.com/kong-oidc-plugin-extra-use-cases/)
The Kong OIDC plugin is very powerful and complex (it has nearly 200 parameters&amp;hellip;), so if you know what combination of settings you need, you can do a lot more. In today&amp;rsquo;s post, I&amp;rsquo;ll introduce some use cases to help you make better use of this plugin.
Note: I&amp;rsquo;m using Kong Gateway (Enterprise) version 2.4.1.1.
Prerequisites
Kong Gateway (Enterprise) An OIDC server is running (Keycloak in my example).</description>
    </item>
    
    <item>
      <title>Using the JWT Plugin in Kong Gateway</title>
      <link>https://wenhan.blog/en/posts/20230522_kong_jwt_plugin/</link>
      <pubDate>Mon, 22 May 2023 00:33:31 +0900</pubDate>
      
      <guid>https://wenhan.blog/en/posts/20230522_kong_jwt_plugin/</guid>
      <description>(Translated from https://tech.aufomm.com/how-to-use-jwt-plugin/)
Kong has many authentication plugins. This time, I would like to talk about how to use the JWT Plugin.
Usage Example Create a Service 1 2 3 4 curl -X POST http://localhost:8001/services \ -H &amp;#34;Content-Type: application/json&amp;#34; \ -H &amp;#34;Accept: application/json, */*&amp;#34; \ -d &amp;#39;{&amp;#34;name&amp;#34;:&amp;#34;jwt-service&amp;#34;,&amp;#34;url&amp;#34;:&amp;#34;https://httpbin.org/anything&amp;#34;}&amp;#39; Create a Route 1 2 3 4 curl -X POST http://localhost:8001/services/jwt-service/routes \ -H &amp;#34;Content-Type: application/json&amp;#34; \ -H &amp;#34;Accept: application/json, */*&amp;#34; \ -d &amp;#39;{&amp;#34;name&amp;#34;:&amp;#34;jwt-route&amp;#34;,&amp;#34;paths&amp;#34;:[&amp;#34;/jwt&amp;#34;]}&amp;#39; If you access the route with curl &#39;http://localhost:8000/jwt&#39; -i, you should get HTTP/1.</description>
    </item>
    
    <item>
      <title>Implemented with Kong Gateway! Notify via Slack Webhook on Request Failure</title>
      <link>https://wenhan.blog/en/posts/20230220_exit_slack/</link>
      <pubDate>Mon, 20 Feb 2023 14:21:23 +0900</pubDate>
      
      <guid>https://wenhan.blog/en/posts/20230220_exit_slack/</guid>
      <description>Background When accessing APIs via Kong Gateway, you may want to be notified if a request fails. The usual approach is to save logs with a logging plugin and then set up alerts and notifications using a third-party product (like ELK). However, using other products can be cumbersome to deploy, require licenses and extra configuration, and ideally, you&amp;rsquo;d like to achieve this within Kong itself. In this article, I&amp;rsquo;ll show how to use the Exit Transformer plugin to trigger a Slack Webhook via Lua script when a request results in an error.</description>
    </item>
    
    <item>
      <title>Trying Out Kong Gateway&#39;s Plugin Ordering Feature</title>
      <link>https://wenhan.blog/en/posts/20230127_plugin_ordering/</link>
      <pubDate>Fri, 27 Jan 2023 11:42:28 +0900</pubDate>
      
      <guid>https://wenhan.blog/en/posts/20230127_plugin_ordering/</guid>
      <description>While working on a PoC with Kong Gateway, I encountered an issue. The PoC requirements were as follows:
Protect the entire Gateway with the Key-auth plugin Use the Request-transformer plugin to add the required API Key to the header and pass authentication After configuring both plugins, even if the API key was added to the request, authentication still failed.
1 2 3 4 5 6 7 8 9 10 11 # key-auth is enabled ❯ http --header localhost:8000/demo | head -1 HTTP/1.</description>
    </item>
    
    <item>
      <title>Trying Out Kong Gateway&#39;s Route By Header Plugin</title>
      <link>https://wenhan.blog/en/posts/20220802_using-kong-gw-route-by-header-plugin/</link>
      <pubDate>Wed, 03 Aug 2022 01:19:02 +0900</pubDate>
      
      <guid>https://wenhan.blog/en/posts/20220802_using-kong-gw-route-by-header-plugin/</guid>
      <description>Introduction In Kong Gateway, you can define subpaths in Routes to determine which Service to access. For example, if the subpath after the URL is pathA, traffic is routed to serviceA, which ultimately accesses endpointA.
1 http://mykong.org:8000/pathA =&amp;gt; serviceA =&amp;gt; endpointA However, sometimes you may want to determine the forwarding destination more dynamically, not just by subpath. This plugin uses pre-defined headers and destinations as rules, and determines the forwarding destination by looking at the request header information.</description>
    </item>
    
    <item>
      <title>Trying Out Kong&#39;s Canary Release Plugin</title>
      <link>https://wenhan.blog/en/posts/20220531_using-kong-canary-release-plugin/</link>
      <pubDate>Tue, 31 May 2022 13:58:39 +0900</pubDate>
      
      <guid>https://wenhan.blog/en/posts/20220531_using-kong-canary-release-plugin/</guid>
      <description>Introduction With Kong Gateway plugins, you can easily set up canary releases. The canary release modes are not just simple percentages; you can also gradually increase traffic or configure whitelists and blacklists.
This article is a memo on how to perform canary releases.
https://docs.konghq.com/hub/kong-inc/canary/
Creating Service and Route For this demo, the current version will point to http://httpbin.org/xml, and the new release version will point to http://httpbin.org/json. So, if you hit the current version, you&amp;rsquo;ll get an XML response; if you hit the new version, you&amp;rsquo;ll get a JSON response.</description>
    </item>
    
    <item>
      <title>Trying Out Kong&#39;s Mocking Plugin</title>
      <link>https://wenhan.blog/en/posts/20220517_using-kong-mocking-plugin/</link>
      <pubDate>Tue, 17 May 2022 13:58:39 +0900</pubDate>
      
      <guid>https://wenhan.blog/en/posts/20220517_using-kong-mocking-plugin/</guid>
      <description>Introduction The Mocking plugin provides mock endpoints for testing APIs under development. Based on the Open API (OAS) specification, it returns mock responses to requests sent to the API. For flexibility in testing, the Mocking plugin can be easily enabled or disabled. https://docs.konghq.com/hub/kong-inc/mocking/
Note: This plugin can only return 200, 201, and 204 responses. It is designed for testing normal operations and cannot return codes outside the 200 range.
In this article, we&amp;rsquo;ll build a db-less Kong Gateway environment using a Docker container and try out the Mocking Plugin on it.</description>
    </item>
    
  </channel>
</rss>
