-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[C-3921] Stop sending signature headers as params #7774
Changes from all commits
a1511e4
69f1f39
7e92db3
1882563
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,6 @@ | |
SortMethod, | ||
) | ||
from src.queries.reactions import ReactionResponse | ||
from src.utils.auth_middleware import MESSAGE_HEADER, SIGNATURE_HEADER | ||
from src.utils.get_all_nodes import get_all_healthy_content_nodes_cached | ||
from src.utils.helpers import decode_string_id, encode_int_id | ||
from src.utils.redis_connection import get_redis | ||
|
@@ -683,23 +682,6 @@ def __schema__(self): | |
return param | ||
|
||
|
||
# Helper to allow consumer to pass message and signature headers as request params | ||
def add_auth_headers_to_parser(parser, required=True): | ||
parser.add_argument( | ||
MESSAGE_HEADER, | ||
required=required, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Feels like we should keep this but make them non-required, so that the REST API docs/swagger pick them up? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Revitalizing this PR. Yes this is is a good point, but I find it somewhat error prone to remember to call this helper in places, so instead I added this into @schottra also adding you as a reviewer since this is relevant to your current work. Lmk if either of you have concerns. The gist of this change is removing
I dream for a day when we have one parser/response marshaller/endpoint per file... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Love this! It's unfortunate that we have to trade-off optional fields in the SDK with missing documentation on the REST/Swagger side, but I like where it's landed! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah ugh! |
||
description="The data that was signed by the user for signature recovery", | ||
location="headers", | ||
) | ||
parser.add_argument( | ||
SIGNATURE_HEADER, | ||
required=required, | ||
description="The signature of data, used for signature recovery", | ||
location="headers", | ||
) | ||
return parser | ||
|
||
|
||
current_user_parser = reqparse.RequestParser(argument_class=DescriptiveArgument) | ||
current_user_parser.add_argument( | ||
"user_id", required=False, description="The user ID of the user making the request" | ||
|
@@ -742,7 +724,6 @@ def add_auth_headers_to_parser(parser, required=True): | |
type=str, | ||
choices=SortDirection._member_names_, | ||
) | ||
add_auth_headers_to_parser(track_history_parser, False) | ||
|
||
user_favorited_tracks_parser = pagination_with_current_user_parser.copy() | ||
user_favorited_tracks_parser.add_argument( | ||
|
@@ -773,7 +754,6 @@ def add_auth_headers_to_parser(parser, required=True): | |
choices=LibraryFilterType._member_names_, | ||
default=LibraryFilterType.favorite, | ||
) | ||
add_auth_headers_to_parser(user_tracks_library_parser) | ||
|
||
user_collections_library_parser = user_tracks_library_parser.copy() | ||
# Replace just the sort method args with the CollectionLibrarySortMethod version | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love all of these getting removed. Will make migration easier for sure.