This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import _ from 'lodash-es' | |
import Benchmark from 'benchmark' | |
function getItems(count) { | |
let id = 1 | |
return _.times(count, () => ( | |
{ | |
name: 'city' + id++, | |
visited: true, | |
id, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use actix_web::{web, App, HttpResponse, HttpServer}; | |
use reqwest::Client; | |
use serde_json::Value; | |
async fn test(data: web::Data<AppState>) -> HttpResponse { | |
let client = &data.client; | |
let result = async { | |
client | |
.get("https://httpbin.org/json") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: echoserver | |
namespace: foo | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: echoserver |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: networking.istio.io/v1alpha3 | |
kind: EnvoyFilter | |
metadata: | |
name: api-key-filter | |
namespace: foo | |
spec: | |
workloadLabels: | |
app: echoserver | |
filters: | |
- listenerMatch: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: "security.istio.io/v1beta1" | |
kind: RequestAuthentication | |
metadata: | |
name: echoserver | |
namespace: default | |
spec: | |
selector: | |
matchLabels: | |
app: echoserver | |
jwtRules: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Json Parsing based on https://gist.github.com/tylerneylon/59f4bcf316be525b30ab | |
-- Base64 decoding based on wikipedia description of 8/6bit encoding. | |
-- base64 char array.. note final 2 chars are for RFC4648-URL encoding | |
-- as per JWT spec section 2 terminology 'Base64url Encoding' | |
local alpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_' | |
-- convert to 6 char long binary string. (max int 64!) | |
local function toBinaryString(int) | |
if int > 64 then error("Bad number " .. int .. " to convert to binary") end | |
local remaining = tonumber(int) | |
local bits = '' |