Indieweb-utils

Latest version: v0.9.1

Safety actively analyzes 687918 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 3

0.6.1

No change. Changes moved to 0.6.2.

0.6.0

Added

Development

- Support for sending private Webmentions in the `send_webmention` function.
- New docstrings documenting parameters used to send a private webmention using the `send_webmention` function.
- Support for validating private Webmentions in the `validate_webmention` function.
- New docstrings documenting parameters used to validate a private webmention with the `validate_webmention` function.
- `validate_webmention` returns the text and a parsed Beautiful Soup tree of the source of a validated Webmention in the `WebmentionCheckResponse` return object.

Functions

- `discover_indieauth_endpoints` function to discover endpoints mentioned in the [IndieAuth spec](https://indieauth.spec.indieweb.org/) and ticket endpoints used in [TicketAuth](https://indieweb.org/IndieAuth_Ticket_Auth), a proposed extension to IndieAuth.

Tests

- Added tests for `discover_indieauth_endpoints` function.

0.5.0

Added

- `get_reply_context` now performs discovery on `property` and `name` values for og:image, twitter:image:src, description, og:description, and twitter:description tags.

Tests

- Added new tests for the `get_reply_context` function.
- Added `responses.activate` decorators to remaining tests that did not already have this decorator present. This ensures all tests run on the contents of local files rather than making network requests to get data from a page.

Fixed

- `get_reply_context` would use a h-entry even if the h-entry only provided a URL and no other content.
- `indieweb_utils.SCOPE_DEFINITIONS` can now be imported into a project. This previously returned an `ImportError` exception.

0.4.0

Added

Development

- Documentation for the `discover_endpoints` function.
- The `indieauth_callback_handler` function returns the JSON response from an IndieAuth endpoint represented as a dictionary instead of a blank dictionary.
- The `discover_endpoints` docstring contains an example about Microsub and an updated common values list. This is because we recommend use of the `discover_webmention_endpoint` function for Webmention endpoint discovery.

Functions

- `get_reply_urls` to retrieve all of the URLs to which a specified page is replying.
- `get_page_name` to find the name of a page per the IndieWeb [Page Name Discovery](https://indieweb.org/page-name-discovery) algorithm.
- `get_syndicated_copies` to retrieve all of the URLs to which a specified page has been syndicated.

Tests

- Added test cases for:
- `get_reply_urls`
- `get_page_name`
- `get_syndicated_copies`
- Updated test cases for `get_reply_context` were to look for `description` values where appropriate.

Fixed

- The `indieauth_callback_handler` function no longer raises a JSON error during the `_validate_indieauth_response` function call.
- The `get_reply_context` function now returns a description based on the first two sentences of the e-content of a specified page if a summary cannot be found when analysing a h-entry.
- The `get_reply_context` function returns a string `summary` value instead of a dictionary or a list.
- `get_reply_context` now looks at `og:description` and `twitter:description` meta tags for a description if a `description` value cannot be found. This happens when analysing a page that does not contain a h-entry.

0.3.1

Fixed import issue in `setup.cfg` so PyPi can discover the README for indieweb-utils.

0.3.0

Added

Development

- Provide docstrings for all functions in the library that did not have a docstring.
- Fix docstring rendering issues with library documentation so that all docstrings show up on [Read the Docs](https://indieweb-utils.readthedocs.io/en/latest/).
- Add `:raises:` statements to docstrings to document existing
- Add code examples to docstrings and remove redundant examples from RS documentation.
- Add a [SECURITY.md](https://github.com/capjamesg/indieweb-utils/blob/main/SECURITY.md) policy.
- Split up documentation into more sections to enhance one's ability to navigate the documentation.

Functions

- `discover_h_feed()` function to discover the representative h-feed on a page.
- `get_valid_relmeauth_links()` function to find both one-way and bi-directional rel=me links on a web page.
- `get_representative_h_card()` function to get the [representative h-card](https://microformats.org/wiki/representative-h-card-parsing) associated with a web page.
- `get_url_summary()` function to generate a summary from a URL, based on the experimental [CASSIS auto_url_summary PHP function](https://indieweb.org/auto-url-summary#Open_Source).
- This function provides examples for GitHub, Twitter, Upcoming, Eventbrite (.com and .co.uk), Calagator, [IndieWeb Events](https://events.indieweb.org), and the [IndieWeb wiki](https://indieweb.org).
- `autolink_tags()` function to replace hashtags () with relevant tag pages and person tags () with the names and domains of people tagged.
- Create internal helper functions:
- `get_parsed_mf2_data()` to retrieve microformats2 data from a page given a parsed mf2py.Parse object, a HTML string, and a URL.
- `get_soup()` to retrieve a BeautifulSoup object from a provided HTML string and URL.

Tests

- Added test cases for:
- `discover_h_feed()`
- `get_representative_h_card()`
- `get_valid_relmeauth_links()`
- `get_url_summary()`
- `autolink_tags()`

Changed

- Support importing IndieAuth functions directly from `indieweb_utils` without having to use `indieweb_utils.indieauth.`.
- Simplify `get_h_app_item()` logic.
- Raise `HAppNotFound` exception when `get_h_app_item()` cannot identify a h-app microformat.
- Renamed `_discover_endpoints` to `discover_endpoints`.
- `discover_endpoints` can raise a `requests.exceptions.RequestException` if there was an error making a request to retrieve an endpoint.
- `discover_webmention_endpoint()` can now raise LocalhostEndpointFound, TargetNotProvided, UnacceptableIPAddress, and WebmentionEndpointNotFound exceptions when there is an issue validating a webmention.
- `send_webmention()` can now raise MissingSourceError, MissingTargetError, UnsupportedProtocolError, TargetIsNotApprovedDomain, GenericWebmentionError, and CouldNotConnectToWebmentionEndpoint if there was an issue sending a webmention.
- `send_webmention()` now returns the HTTP status code and headers of a successful webmention.
- `get_post_type()` raises an `PostTypeFormattingError` exception if an invalid `custom_properties` tuple is provided.
- `get_reply_context()` raises an `ReplyContextRetrievalError` if there was an error retrieving context for a URL. This function also raises an `UnsupportedScheme` error if a URL does not use either HTTP or HTTPS.
- `validate_webmention()` can raise WebmentionIsGone or WebmentionValidationError exceptions if there was an error validating a webmention.
- `canonicalize_url()` returns the exact URL passed in if the URL contains a protocol that is not HTTP or HTTPS.

Page 2 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.