Skip to content

Instantly share code, notes, and snippets.

Dynamic Policy for Access Control

time
2015-05-18 11:15:00-07:00
location
Room 211,

Who can do what? In OpenStack, it is the Policy engine that controls these decisions. A secure deployment means moving beyond the default policy provided with the base distribution. But how do you write policy rules that reflect your security decisions? This presentation, Adam Young, a core Keystone developer from the Red Hat Identity Management team, explain the access control policy mechanism fr...

Enabling Real-world Interoperable Hybrid Cloud Use Cases Using OpenStack's Federated Identity Capabilities

import collections
import re
import routes
from keystone import assignment
from keystone import auth
from keystone import catalog
from keystone.common import controller
from keystone import credential
def _require_single_keyword_arg(self, **kwargs):
provided_params = [name for name, value in kwargs.iteritems() if value]
if not provided_params: raise VE('Something must be passed in')
if len(provided_params) != 1:
msg = _('Only a single keyword arg allowed: received %s') % ', '.join(provided_params)
raise exception.ValidationError(msg)
@dstanek
dstanek / codemash-python-koans.rst
Last active January 6, 2016 21:15
Codemash 2016: Python Koans

Header a

header c

header d ----------

Title

Python Koans - An Introduction To Python

Abstract

Python is a fun, dynamic, flexible language for solving all kinds of problems. It's used everywhere from modest scripts to large systems, powering things like websites, games, film production tools, scientific analysis, and even space programs. Best of all, it's a language that "fits your brain".

This session is a mostly self guided introduction to Python through koans. What’s a koan you ask? It’s a small puzzle or exercise expressed as a test, designed to build your knowledge of the Python syntax and idioms incrementially.

Policy-Endpoint Associations

Create association with endpoint: PUT /OS-ENDPOINT-POLICY/endpoints/{endpoint_id}/policy

Creates an association between the policy and the endpoint. If another association already existed for the specified endpoint, this will replace that association.

Request:

@dstanek
dstanek / di_with_sg.py
Created July 21, 2014 18:39
DI with snake-guice
import abc
class Logger(object):
__metaclass__ abc.ABCMeta
@abstractmethod
def log_it(self, message, *args, **kwargs):
raise NotImplemented
@dstanek
dstanek / di_by_hand.py
Last active August 29, 2015 14:04
DI by hand
import abc
class Logger(object):
__metaclass__ abc.ABCMeta
@abstractmethod
def log_it(self, message, *args, **kwargs):
raise NotImplemented
{
"rules": [
{
"local": {
"user": {
"name": "@@UserName@@"
}
},
"remote": [
{