mirror of
https://github.com/quay/quay.git
synced 2025-04-18 10:44:06 +03:00
* chore: drop deprecated tables and remove unused code * isort imports * migration: check for table existence before drop
41 lines
884 B
Python
41 lines
884 B
Python
from abc import ABCMeta, abstractmethod
|
|
from collections import namedtuple
|
|
from typing import List
|
|
|
|
from six import add_metaclass
|
|
|
|
USER_FIELDS: List[str] = [
|
|
"uuid",
|
|
"username",
|
|
"email",
|
|
"given_name",
|
|
"family_name",
|
|
"company",
|
|
"location",
|
|
]
|
|
|
|
|
|
class User(namedtuple("User", USER_FIELDS)): # type: ignore[misc]
|
|
"""
|
|
User represents a user.
|
|
"""
|
|
|
|
|
|
@add_metaclass(ABCMeta)
|
|
class EndpointsCommonDataInterface(object):
|
|
"""
|
|
Interface that represents all data store interactions required by the common endpoints lib.
|
|
"""
|
|
|
|
@abstractmethod
|
|
def get_user(self, user_uuid):
|
|
"""
|
|
Returns the User matching the given uuid, if any or None if none.
|
|
"""
|
|
|
|
@abstractmethod
|
|
def get_namespace_uuid(self, namespace_name):
|
|
"""
|
|
Returns the uuid of the Namespace with the given name, if any.
|
|
"""
|