-
Notifications
You must be signed in to change notification settings - Fork 83
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
[SDESK-7484] Create async Content API Subscriber Token and Auth #2825
base: async
Are you sure you want to change the base?
Conversation
SDESK-7484
SDESK-7484
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.
👍 Looks good. A minor improvement regarding HATEOAS & related items.
As for the tests, there are some failing, and it would be very beneficial if we had tests for the item-level HATEOAS, especially considering it's a required feature for some front-end features to work.
Move related links generation from REST endpoints to ResourceModel for better encapsulation and reusability. Cache relationships at class creation time to avoid potential performance issues because of the extraction of annotations. Add utilities for consistent URL generation and annotation handling across class hierarchies.
Added some TODO-ASYNC comments to some ignored type errors for now
SDESK-7484
SDESK-7484
We no longer use `nose` so there is not reason to have the file name with it
I've fixed the web signal broken tests (unrelated) and I'm working on fixing the rest and implementing new tests cases for the new logic. I'll have it ready tomorrow. |
@@ -594,47 +594,7 @@ def _populate_item_hateoas( | |||
} | |||
|
|||
# extract related links from the `resource_config.data_class` relations (annotations) | |||
related_links = self._get_related_links_from_annotations(item) | |||
if related_links: | |||
if related_links := self.resource_config.data_class.get_related_links(item): |
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.
👍 Don't see :=
too often
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.
I saw it once, long ago when it was proposed, then I forgot it was already there in python 3. I really like it, I think I will be using it more often 😃
@@ -148,6 +152,29 @@ def type(self) -> str: | |||
#: Datetime the document was last updated | |||
updated: Annotated[Optional[datetime], Field(alias="_updated")] = None | |||
|
|||
def __init_subclass__(cls) -> None: |
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.
Nicely done 🤓
SDESK-7484
SDESK-7484
Tests have been added. I wanted to add some more tests in the |
Purpose
Implement a new token-based authentication system specific to the ContentAPI, replacing the default Superdesk async auth with a custom SubscriberToken mechanism.
What has changed
SubscriberToken
resource model and an accompanying async service.ResourceConfig
for theSubscriberToken
resource, enabling its REST API. Added corresponding module.SubscriberTokenAuth
class for the ContentAPI.SubscriberTokenAuth
class and related resource code.resource_methods
instead ofitems_methods
).SDESK-7484