Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.auth.indieauth Namespace Reference

Classes

class  LinkTagParser
 

Functions

ParseResult _parse_client_id (str client_id)
 
ParseResult _parse_url (str url)
 
list[str] fetch_redirect_uris (HomeAssistant hass, str url)
 
bool verify_client_id (str client_id)
 
bool verify_redirect_uri (HomeAssistant hass, str client_id, str redirect_uri)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 

Detailed Description

Helpers to resolve client ID/secret.

Function Documentation

◆ _parse_client_id()

ParseResult homeassistant.components.auth.indieauth._parse_client_id ( str  client_id)
private
Test if client id is a valid URL according to IndieAuth section 3.2.

https://indieauth.spec.indieweb.org/#client-identifier

Definition at line 152 of file indieauth.py.

◆ _parse_url()

ParseResult homeassistant.components.auth.indieauth._parse_url ( str  url)
private
Parse a url in parts and canonicalize according to IndieAuth.

Definition at line 135 of file indieauth.py.

◆ fetch_redirect_uris()

list[str] homeassistant.components.auth.indieauth.fetch_redirect_uris ( HomeAssistant  hass,
str  url 
)
Find link tag with redirect_uri values.

IndieAuth 4.2.2

The client SHOULD publish one or more <link> tags or Link HTTP headers with
a rel attribute of redirect_uri at the client_id URL.

We limit to the first 10kB of the page.

We do not implement extracting redirect uris from headers.

Definition at line 80 of file indieauth.py.

◆ verify_client_id()

bool homeassistant.components.auth.indieauth.verify_client_id ( str  client_id)
Verify that the client id is valid.

Definition at line 126 of file indieauth.py.

◆ verify_redirect_uri()

bool homeassistant.components.auth.indieauth.verify_redirect_uri ( HomeAssistant  hass,
str  client_id,
str   redirect_uri 
)
Verify that the client and redirect uri match.

Definition at line 19 of file indieauth.py.

Variable Documentation

◆ _LOGGER

homeassistant.components.auth.indieauth._LOGGER = logging.getLogger(__name__)
private

Definition at line 16 of file indieauth.py.