mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 23:41:17 -05:00
Merge pull request #485 from alphagov/api_user-cleanup
Api user cleanup
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user