Requests and responses#

The requests that the handlers serve, and the responses they return, independent of any web framework.

class scim2_server.requests.ScimRequest(method: str, base_url: str, path: str, query: Mapping[str, str]=<factory>, headers: Mapping[str, str] | ~collections.abc.Iterable[tuple[str, str]]=<factory>, body: bytes = b'', subject: Any = None)[source]#

A request to a SCIM server, independent of any web framework.

method: str#

The HTTP method of the request, such as PATCH, whatever its case.

base_url: str#

The root URL of the SCIM endpoints, as the client sees it, such as https://example.com/scim/v2.

path: str#

The path of the request, relative to base_url, such as /Users/2819c223.

query: Mapping[str, str]#

The query parameters of the request.

headers: Mapping[str, str] | Iterable[tuple[str, str]]#

The headers of the request, as a mapping or as a list of pairs. Their names are case insensitive.

body: bytes = b''#

The raw body of the request.

subject: Any = None#

The authenticated subject of the request, as the integration sees it.

The service does not read it, but passes it to the steps an application overrides, such as me_target(). It can be the user of the web framework, the claims of a token, or any other object.

property url: str#

The URL of the request, without its query string.

header(name: str) → str | None[source]#

Return the value of a header, whatever the case of its name.

Repeated headers are joined with commas (RFC 9110 ยง5.3).

class scim2_server.responses.ScimResponse(status: HTTPStatus, body: dict[str, ~typing.Any] | None=None, headers: dict[str, str]=<factory>)[source]#

The response to a SCIM request, independent of any web framework.

status: HTTPStatus#

The HTTP status of the response.

body: dict[str, Any] | None = None#

The JSON body of the response, if any.

headers: dict[str, str]#

The SCIM headers of the response, such as ETag or Location.