sequenceDiagram
participant Client
participant Envoy
participant ACL
participant JWKS Server
participant Backend
loop Keys
ACL->>JWKS Server: Fetch JWKS
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
title Client Binding | |
Client -> Client: generate client key & certificate request | |
Client -> Server: send certificate request with device id | |
Server -> Server: generate client certificate | |
Server -> Client: send client certificate | |
loop request | |
Client -> Server: make request using client certificate | |
Server -> Client: reply |
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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use File::Which; | |
use File::Spec; | |
use File::Basename; | |
use Env qw(GOPATH); | |
use Getopt::Long; |
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
package streamutil | |
import ( | |
"golang.org/x/net/context" | |
"google.golang.org/grpc" | |
) | |
struct serverStreamWithContext { | |
grpc.ServerStream | |
ctx context.Context |
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
#!/usr/bin/env python3 | |
import collections | |
def flatten(t): | |
""" | |
Generator flattening the structure | |
>>> list(flatten([2, [2, (4, 5, [7], [2, [6, 2, 6, [6], 4]], 6)]])) | |
[2, 2, 4, 5, 7, 2, 6, 2, 6, 6, 4, 6] |
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
def ordered_sample(population, k): | |
""" | |
Generate k-sized ordered random sample of population | |
Implementation of Kramer algorithm. | |
""" | |
x = 0 | |
size = len(population) | |
for i in xrange(k): | |
x = size - int((size - x) * (random.random() ** (1.0 / (k - i)))) |
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
from itertools import product | |
def intersect_values(left, right): | |
intersection = left.viewkeys() & right.viewkeys() | |
return {key: list(product(left[key], right[key])) for key in intersection} | |
assert intersect_values({'A': [1, 2], 'B': [5]}, {'A': [3, 7]}) == {'A': [(1, 3), (1, 7), (2, 3), (2, 7)]} |