Skip to content

Commit

Permalink
omg I did so much stuff and didn't commit
Browse files Browse the repository at this point in the history
* Remove all auth and switch to using OpenID Connect
* Split out all APIs to their components; compute, iam, location
* Remove model IDs and switch to names, this makes it easier to dev with k8s
* Add swagger autogen support /swagger/json and /swagger/ui
* Split out metadata server into it's own library
* Make sure model controllers don't constantly save when nothing changed
* Add updated_at field to models
* Add caching via redis so we don't kill the k8s api and speed up responses
* Use vm uuids when communicating with vcenter
* Rename "global" to "system" and split out policies
* Add IAM groups that link to openid groups
* Service Accounts and IAM Groups have sandwich.local "emails"
* Don't generate own user tokens, use OpenID Connect id tokens
* Service Account keys expire after 10 years
* Add IAM system and project policy documents (similar to GCP policy documents)
  * There still is no API yet to modify these documents
* User/Service Account that creates a project is added as the owner
  • Loading branch information
rmb938 committed Jun 23, 2018
1 parent 11c36a2 commit b3b0527
Show file tree
Hide file tree
Showing 125 changed files with 3,536 additions and 3,651 deletions.
3 changes: 3 additions & 0 deletions deli/cache/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from deli.cache.client import CacheClient

cache_client = CacheClient()
41 changes: 41 additions & 0 deletions deli/cache/client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import json

import redis


class CacheClient(object):

def __init__(self):
self.redis_client: redis.StrictRedis = None
self.default_cache_time = 600

def connect(self, url):
self.redis_client = redis.StrictRedis.from_url(url)

def get(self, key):
data = self.redis_client.get(key)
if data is None:
return None
return json.loads(data)

def scan(self, match):
cursor = '0'
while cursor != 0:
cursor, keys = self.redis_client.scan(cursor=cursor, match=match,
count=1000) # Do we keep count hardcoded to 1000?
for key in keys:
item = self.get(key)
if item is None:
continue
yield key, item

def pipeline(self):
return self.redis_client.pipeline()

def set(self, key, data, ex=None):
if ex is None:
ex = self.default_cache_time
return self.redis_client.set(key, json.dumps(data), ex=ex)

def delete(self, key):
return self.redis_client.delete(key)
25 changes: 0 additions & 25 deletions deli/counter/auth/driver.py

This file was deleted.

70 changes: 0 additions & 70 deletions deli/counter/auth/drivers/github/driver.py

This file was deleted.

97 changes: 0 additions & 97 deletions deli/counter/auth/drivers/github/router.py

This file was deleted.

37 changes: 0 additions & 37 deletions deli/counter/auth/manager.py

This file was deleted.

Loading

0 comments on commit b3b0527

Please sign in to comment.