Skip to content

Instantly share code, notes, and snippets.

View mayorova's full-sized avatar

Daria Mayorova mayorova

  • Red Hat
  • Barcelona
View GitHub Profile
@mayorova
mayorova / 3322071.md
Created April 17, 2018 09:59
3scale billing on application plan change

The behavior depends on several factors:

  • the mode of Billing: Prepaid or Postpaid
  • when the plan change is made

Prepaid billing

1. If the application plan is changed on the same day as is it was created, and so it has never been invoiced before, the fixed costs for the old plan are included to the invoice, and are discounted with a 'Refund' line item. The fixed costs for the old plan are also added to the invoice.

Example.

@mayorova
mayorova / host.t
Last active April 13, 2018 12:42
Host header in OpenResty
use Test::Nginx::Socket::Lua 'no_plan';
run_tests();
__DATA__
=== TEST 1: failing test
--- config
resolver 1.1.1.1;
location = /t {
@mayorova
mayorova / README.md
Last active October 14, 2019 07:48
Mutual SSL with APIcast

Mutual SSL with APIcast

This document describes the steps to enable mutual SSL in APIcast. The instructions are provided for Docker and OpenShift.

Note: this approach will only work in APIcast v3.1.0-rc1 and later.

Prerequisites

  • client certificates
  • API backend that accepts client certificates
@mayorova
mayorova / README.md
Created August 10, 2017 14:44
Mutual SSL in NGINX

Securing traffic to upstream servers with client certificates

Info: https://www.nginx.com/resources/admin-guide/nginx-https-upstreams/

Creating and Signing Your Certs

Source: http://nategood.com/client-side-certificate-authentication-in-ngi

This is SSL, so you'll need an cert-key pair for you/the server, the api users/the client and a CA pair. You will be the CA in this case (usually a role played by VeriSign, thawte, GoDaddy, etc.), signing your client's certs. There are plenty of tutorials out there on creating and signing certificates, so I'll leave the details on this to someone else and just quickly show a sample here to give a complete tutorial. NOTE: This is just a quick sample of creating certs and not intended for production.

@mayorova
mayorova / README.md
Last active June 14, 2018 10:59
Deploy 3scale AMP on Amazon EC2

Deploy 3scale AMP on Amazon EC2

This is an easy way to deploy a simple 3scale AMP setup using oc cluster up. Note: This should only be used for development and testing, do not ever use it in production environments.

You will need:

  • a running instance with 8GB RAM minimum (recommended 16GB) and RHEL