duck.html.components.core.browser_state¶
Refresh claims for the client using the following APIs.
Flow:
User calls
queue_browser_state, this adds the Page/component request ID to a registry.User calls
sync_browser_stateand it makes a fetch to the appropriate URL and set sensitive data directly from headers which maybe safer e.g. HttpOnly, Secure cookie
Module Contents¶
Functions¶
Returns a boolean on whether the request passed to the component is dirty or needs
Lively to do a |
|
This adds component request and response that needs to be sent when user visits sync browser state view to the registry. |
|
This syncs the browser state like updating sensitive HTTPONLY cookies. |
Data¶
API¶
- duck.html.components.core.browser_state.BROWSER_STATE_REGISTRY¶
‘InMemoryCache(…)’
- duck.html.components.core.browser_state.needs_browser_state_update(component_request: duck.http.request.HttpRequest) bool[source]¶
Returns a boolean on whether the request passed to the component is dirty or needs Lively to do a
fetch()on thesync_browser_stateview.- Parameters:
component_request – The request passed to the component.
- duck.html.components.core.browser_state.queue_browser_state_response(component_request: duck.http.request.HttpRequest, response: duck.http.response.HttpResponse)[source]¶
This adds component request and response that needs to be sent when user visits sync browser state view to the registry.
Args: component_request: The request passed to the component.
- duck.html.components.core.browser_state.sync_browser_state(request)[source]¶
This syncs the browser state like updating sensitive HTTPONLY cookies.
… admonition:: Notes
This will be called within Lively on client side using
fetch().- Returns:
Http response added to queue else 404 HttpResponse.
- Return type: