Skip to content

Instantly share code, notes, and snippets.

# FIXME(lbragstad): Move this test to tests/test_v3_assignment.py
def test_delete_user_before_role_assignment_succeeds(self):
"""Call ``DELETE`` on the user before the role assignment."""
# Assign the user a role on the project
collection_url = (
'/projects/%(project_id)s/users/%(user_id)s/roles' % {
'project_id': self.project_id,
'user_id': self.user_id})
member_url = ('%(collection_url)s/%(role_id)s' % {
@lbragstad
lbragstad / gist:b4698583a6de482af82f
Last active August 29, 2015 14:07
Publishing meeting from arbiter
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
@lbragstad
lbragstad / demo.py
Last active August 29, 2015 14:09 — forked from dolph/demo.py
"""
Offline validation of oauth access_keys.
"""
import base64
import string
import unittest
import urllib
import uuid
import zlib
@lbragstad
lbragstad / gist:5381c639a3a4e17e1124
Created November 17, 2014 22:31
Example AE Token POC Output
$ python msgpack_demo.py
Initial payload:
['0ccbc3e3420943578c6bfd7d6a4629a5', '7906320555ab4cd0960cb0c0917e72eb', 1416263429, 7200, '4ojGcb-TTmm709-LL5127g']
Encoded payload using msgpack:
1sYnCFfb9jGhwnYP/+Zwn071IKCI=Z-LMbWY7EN3O7pDLVpaK2jO5Nz4-rvWcUhxRXHU4tD9J-oFQGUCogNFHoY5Tb3NxHdWb4dsULGT6TTNq5tR7oaVd95ujfvT9ZrFr0Z0DHEyklzhhurdqhu12nGIdInHJiDqrrC62
Encoded payload length using msgpack:
@lbragstad
lbragstad / localrc
Last active August 29, 2015 14:11
Devstack Keystone Opts
# Reclone the master branch for enabled projects
RECLONE=yes
# Password stuff
ADMIN_PASSWORD=secrete
DATABASE_PASSWORD=secrete
RABBIT_PASSWORD=secrete
SERVICE_PASSWORD=secrete
GIT_BASE=https://github.com
@lbragstad
lbragstad / gist:be89ebb7802be698af29
Created December 10, 2014 14:27
Devstack Notes
# Set env vars to use Keystone V3
export OS_USER_DOMAIN_ID=default
export OS_PROJECT_DOMAIN_ID=default
export OS_IDENTITY_API_VERSION=3
export OS_AUTH_URL=http://10.0.2.15:5000/v3
import os
from keystoneclient.v3 import client
try:
SP_IP = os.environ['SP_IP']
IDP_IP = os.environ['IDP_IP']
SP_ENDPOINT = 'http://%s:35357/v3' % SP_IP
IDP_ENDPOINT = 'http://%s:35357/v3' % IDP_IP
except KeyError as e:

BBQ Scratch Pad

BBQ Sauce

In large stock pot:

  • olive oil
  • whole garlic cloves
  • diced onions
#!/usr/local/env bash
set -ev
apt-get install -y libffi-dev libldap2-dev libsasl2-dev libxslt1.1 libxslt1-dev python-dev curl libssl-dev
curl https://bootstrap.pypa.io/get-pip.py | python
pip install -U virtualenv
@lbragstad
lbragstad / fernet-with-caching.md
Last active March 26, 2016 02:03
mitaka token provider performance

Fernet w/ Caching

[token]
provider = fernet
[cache]
enabled = true

non-concurrent token create: