From f1da3c452ff2420c34fc5b4bcc81bec28d28ccd8 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Fri, 9 Mar 2018 16:46:29 -0500 Subject: [PATCH] Remove unused code --- endpoints/appr/models_oci.py | 11 ----------- endpoints/v1/models_interface.py | 16 ---------------- endpoints/v1/models_pre_oci.py | 13 ------------- 3 files changed, 40 deletions(-) diff --git a/endpoints/appr/models_oci.py b/endpoints/appr/models_oci.py index 75d5050fa..3f1c7d19c 100644 --- a/endpoints/appr/models_oci.py +++ b/endpoints/appr/models_oci.py @@ -268,17 +268,6 @@ class OCIAppModel(AppRegistryDataInterface): channel = oci_model.channel.create_or_update_channel(repo, channel_name, release) return ChannelView(current=channel.linked_tag.name, name=channel.name) - def get_user(self, username, password): - err_msg = None - if parse_robot_username(username) is not None: - try: - user = data.model.user.verify_robot(username, password) - except data.model.InvalidRobotException as exc: - return (None, exc.message) - else: - user, err_msg = authentication.verify_and_link_user(username, password) - return (user, err_msg) - def get_blob_locations(self, digest): return oci_model.blob.get_blob_locations(digest) diff --git a/endpoints/v1/models_interface.py b/endpoints/v1/models_interface.py index 93aed61a6..0d03d7005 100644 --- a/endpoints/v1/models_interface.py +++ b/endpoints/v1/models_interface.py @@ -160,22 +160,6 @@ class DockerRegistryV1DataInterface(object): """ pass - @abstractmethod - def load_token(self, token): - """ - Loads the data associated with the given (deprecated) access token, and, if - found returns True. - """ - pass - - @abstractmethod - def verify_robot(self, username, token): - """ - Returns True if the given robot username and token match an existing robot - account. - """ - pass - @abstractmethod def change_user_password(self, user, new_password): """ diff --git a/endpoints/v1/models_pre_oci.py b/endpoints/v1/models_pre_oci.py index 2de743e70..816369089 100644 --- a/endpoints/v1/models_pre_oci.py +++ b/endpoints/v1/models_pre_oci.py @@ -137,19 +137,6 @@ class PreOCIModel(DockerRegistryV1DataInterface): def delete_tag(self, namespace_name, repo_name, tag_name): model.tag.delete_tag(namespace_name, repo_name, tag_name) - def load_token(self, token): - try: - model.token.load_token_data(token) - return True - except model.InvalidTokenException: - return False - - def verify_robot(self, username, token): - try: - return bool(model.user.verify_robot(username, token)) - except model.InvalidRobotException: - return False - def change_user_password(self, user, new_password): model.user.change_password(user, new_password)