Merge pull request #485 from alphagov/api_user-cleanup

Api user cleanup
This commit is contained in:
Leo Hemsted
2016-07-01 10:58:18 +01:00
committed by GitHub
16 changed files with 341 additions and 357 deletions

View File

@@ -5,14 +5,13 @@ from sqlalchemy.dialects.postgresql import (
UUID,
JSON
)
from sqlalchemy import UniqueConstraint
from app.encryption import (
hashpw,
check_hash
)
from app.authentication.utils import get_secret
from app import (
db,
encryption
@@ -135,6 +134,10 @@ class ApiKey(db.Model, Versioned):
UniqueConstraint('service_id', 'name', name='uix_service_to_key_name'),
)
@property
def unsigned_secret(self):
return get_secret(self.secret)
KEY_TYPE_NORMAL = 'normal'
KEY_TYPE_TEAM = 'team'